I am creating a prestashop module where I go trough the cart of orders. From one given cart, I have to get the total amount of shipping tax.
I am hooked on hookActionPaymentConfirmation, and as delivery option the cart object gives me this json value :
object(Cart)[84]
...
public 'delivery_option' => string '{"5":"2,"}' (length=10)
...
I do not find how to use this value in the Prestashop developer guide, and I tried several random things that lead me to find this function is Prestashop core :
public function getDeliveryOption($default_country = null, $dontAutoSelectOptions = false, $use_cache = true)
located in prestashop\classes\Cart.php, line 3074
By reading its content, I figured out that all arguments where optional, so I called the function without arguments. It returned me the JSON data that the cart gave me in a first time
array (size=1)
5 => string '2,' (length=2)
The circle is complete, I am stuck, so I come to you.
Do someone know where I can find the a sort of Prestashop's codex or how to get Shipping amount from an order or a cart ?
Thank you for any help people !