Jump to content

Problem with free shipping on some products in the cart. Prestashop 1.7


Recommended Posts

I have created a cart rule in which I choose a product that has free shipping. 

When I add that product to the cart everything works fine and the free shipping appears, but when I add a product without free shipping in which I should add the shipping price of that product, they both appear as free shipping.

I have tried to create two rules one for the "Not free" and for the "free" products and it still works the same way.

I have tried to create a carrier for the free shipping, but I am not interested in that operation.

If someone can help me I would be grateful.

Best regards.

Link to comment
Share on other sites

  • 2 weeks later...

Hello,
The way the Prestashop free shipping cart rules operate is that you can use the rule/voucher code if the specified product is in the cart; in this instance, free shipping will be applied regardless of whether any additional products are added to the cart.
As you indicated, one thing you might do is to create a free shipping carrier, choose it for the desired products, and choose different carriers for the remaining things:
https://prnt.sc/LZayob98B6ge
Prestashop will typically split the order in this scenario, creating one with free delivery carrier and a second order with the remaining items with another carrier.

I hope that I could help.
Have a nice day, Leo.

Link to comment
Share on other sites

On 2/13/2023 at 1:35 PM, Prestachamps said:

Hello,
The way the Prestashop free shipping cart rules operate is that you can use the rule/voucher code if the specified product is in the cart; in this instance, free shipping will be applied regardless of whether any additional products are added to the cart.
As you indicated, one thing you might do is to create a free shipping carrier, choose it for the desired products, and choose different carriers for the remaining things:
https://prnt.sc/LZayob98B6ge
Prestashop will typically split the order in this scenario, creating one with free delivery carrier and a second order with the remaining items with another carrier.

I hope that I could help.
Have a nice day, Leo.

Thanks for answering @Prestachamps, there is no module that can do what I want? 

Link to comment
Share on other sites

  • 1 year later...

A real solution.

Find /classes/Cart.php

Find the method getPackageShippingCost

Right at the top add the lines below:

        $qry = new DbQuery;
        $qry->select("free_shipping");
        $qry->from("cart_cart_rule", "cd");
        $qry->innerJoin("cart_rule", "cr", "cd.id_cart_rule = cr.id_cart_rule");
        $qry->where("id_cart = {$this->id}");
        $qry->where("free_shipping = 1");
        if(Db::getInstance()->getValue($qry))
            return 0;
 

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