geoclassics Posted February 10, 2017 Share Posted February 10, 2017 We are based in the US and need to collect sales taxes in certain states. We also need to add shipping insurance for many of our products. Shipping insurance in the US is calculated only on the total of product prices, not including taxes. In PrestaShop 1.6, the cart OrderTotal contains the total cost of products PLUS TAXES. OrderTotal is then passed to the shipping module (USPS) to query the cost of shipping method plus shipping insurance. Because OrderTotal is larger than the total cost of products in the cart, the incorrect value is obtained for shipping insurance. How can we calculate an OrderTotal that doesn't include taxes? Or, is there another variable that is a total cost of products in the cart without tax, which can be passed to the shipping module? Or, how do we create one? Please, we are grateful for any help and suggestions. Scott Link to comment Share on other sites More sharing options...
YopixelAE Posted February 10, 2017 Share Posted February 10, 2017 Hello, is there another variable that is a total cost of products in the cart without tax, which can be passed to the shipping module? Or, how do we create one? For instance, in the hook order confirmation (you will select another hook for your purpose) you can pass to Smarty the wanted variable as follows : public function hookOrderConfirmation($params) { $id_customer = $params['cart']->id_customer; // ... $order = $params['objOrder']; $id_order = $order->id; $total_paid = $order->total_paid; $total_paid_tax_excl = $order->total_paid_tax_excl; $this->context->smarty->assign( array( 'id_order' => $id_order, 'total_paid' => $total_paid, 'total_paid_tax_excl' => $total_paid_tax_excl, ) ); $display = $this->display(__FILE__, 'my_tpl_file.tpl'); return $display; } 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now