Jump to content

How to get shipping cost calculate on total_price instead total_products


Recommended Posts


i use prestashop version and need help to figured out this problem: i've set up free shipping above 50 €, but if a customer add to a discount code to the cart and the total decreases under the 50 € he got the free shipping, because it calculates on the total products insted of total price.

Here's an example to explain my problem better:


Product A: 60 €

Total products: 60 €

Total voucher: -20 €

Total price: 40 €


So it takes the free shipping instead calculate the total products instead the total price, that is 40€ and it should not take the free shipping.


Hope anyone can help me to figured out,



Link to comment
Share on other sites

The code is in the Cart class (/classes/Cart.php)

        // Free fees
        $free_fees_price = 0;
        if (isset($configuration['PS_SHIPPING_FREE_PRICE']))
            $free_fees_price = Tools::convertPrice((float)$configuration['PS_SHIPPING_FREE_PRICE'], Currency::getCurrencyInstance((int)$this->id_currency));
        $orderTotalwithDiscounts = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, null, null, false);
        if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0)
            Cache::store($cache_id, $shipping_cost);
            return $shipping_cost;
Link to comment
Share on other sites

  • 4 months later...

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...