Jump to content

Determine if an order have free shipping


Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...