BlackChart Posted July 21, 2017 Share Posted July 21, 2017 I'm writing a module to help create ledger items. To this I need the information when the order is marked for free shipping. I can see the free shipping as a part of $order->total_discounts_tax_incl but this could include several other discounts. How can I see if the discount is from the free shipping option? Hook snippet: public function hookPostUpdateOrderStatus($params) { $this->getSetup(); $new_state = $params['newOrderStatus']; $order = new Order($params['id_order']); $create_status = Configuration::get('_DINERO_CREATE_STATUS'); if ($create_status == $new_state->id) { $token = $this->GetAPIToken(); $this->DineroInsert($token,$order->id,$order->reference,$order->total_products,$order->total_discounts_tax_incl,$order->total_shipping_tax_incl,$order->total_paid_tax_incl); } } Link to comment Share on other sites More sharing options...
benw Posted July 24, 2017 Share Posted July 24, 2017 Maybe get the Carrier from the Order (using $order->id_carrier) and then check the "is_free" property of the Carrier ? 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