Jump to content

Add Transport charges after Order is done


WEMS

Recommended Posts

In frontoffice of Prestashop  the customer make an Transaction of an amount of CHF 255.- with Paypal (Free Delivery after an amount CHF 250.-)

 

30 Minutes later we give to that customer an manual discount to some products and have now an total amount of CHF 155.- - unfortunately the Transport charges was not added. How can we add transport charges after the order is taken (that are not free under an amount of 250.-)

Link to comment
Share on other sites

The shipping calculation is done Cart class getPackageShippingCost(),

It uses order total amount after discount to calculate shipping carrier, so the logic and behaviour is correct.

 

If you want to calculate the shipping fee before discount, then you will need to modify the Cart class, getPackageShippingCost().

Link to comment
Share on other sites

Ok, it is also logical that we should be able to give manually discounts on an order or make any change and the total amount change after that. The tool should respect the cart rule, or not ?

 

Where exactly can I edit that ?

Link to comment
Share on other sites

Ok, it is also logical that we should be able to give manually discounts on an order or make any change and the total amount change after that. The tool should respect the cart rule, or not ?

 

 

 
PrestaShop does not support that, so you will have to implement this by your own.
You need the code logic of related part and modify the logic.
For example, you will need get and pass the $order_total before discount.
 
 
                if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) {
                    $shipping = $carrier->getDeliveryPriceByWeight($this->getTotalWeight($product_list), (int)$id_zone);
                } else {
                    $shipping = $carrier->getDeliveryPriceByPrice($order_total, (int)$id_zone, (int)$this->id_currency);
                }
 
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...