Jump to content

Changing field value in orders table when order is placed


rhoenig

Recommended Posts

I'd like to modify the total_shipping field in the orders table once the customer clicks confirm order (using paypalpro module).  I've looked everywhere and can't figure out where the order is saved or where total_shipping is set.  

 

Any advice would be great.  I would like to find this in the core files and then will move it to the overrides.

 

Thank you
Robert

Edited by rhoenig (see edit history)
Link to comment
Share on other sites

It's the validateOrder function in classes/PaymentModule.php that creates the order. It's lines 315-317 in PrestaShop v1.6.1.9 that set the shipping:

$order->total_shipping_tax_excl = (float)$this->context->cart->getPackageShippingCost((int)$id_carrier, false, null, $order->product_list);
$order->total_shipping_tax_incl = (float)$this->context->cart->getPackageShippingCost((int)$id_carrier, true, null, $order->product_list);
$order->total_shipping = $order->total_shipping_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...