Hi
I use a plugin for delivery by a local courier “Econt Express”.
Plugin considered shipping costs in real time, based on the weight of the product.
Delivery cost is taken from the database of Econt Express.
For this reason in chekout page the module of Econt Express adds a new field with the cost of delivery.
You can test it here: https://www.parallelreality-bg.com/bookshop/?page_id=6
I hid the fields Total and subtotal because I don’t need them in this case.
The idea of the code above is to take the cost of shipping and the subtotal and sum them in Order page.
Through this code I can take the cost of delivery, but I can’t take the subtotal.
If necessary, I can provide the module for testing.