Jump to content

Free shipping possible only on selected carriers?


Recommended Posts

Hello all!

 

Is it possible to apply free shipping only to certain carriers? I have 5 different carriers, but two of them are used to deliver special orders and are very expensive, so I dont want them calculated in the free shipping. So, is it possible to enable them only for "normal" carriers?

 

Thanks

 

// Kenneth

Link to comment
Share on other sites

The trick is not to use the free shipping. B) 

Instead, set up your shipping price ranges to give free shipping at the price you want.

 

Price range for Mail

0 to $100 = $10.00

$101 to 10,000 = 0

 

Price range for XPRESS MAIL

0 to $100 = $20.00

$101 to 10,000 = $40.00

 

Get the idea?

Link to comment
Share on other sites

The trick is not to use the free shipping. B) 

 

Instead, set up your shipping price ranges to give free shipping at the price you want.

 

Price range for Mail

0 to $100 = $10.00

$101 to 10,000 = 0

 

Price range for XPRESS MAIL

0 to $100 = $20.00

$101 to 10,000 = $40.00

 

Get the idea?

I get the concept, but I fail to see from where I can do this. In my carriers, I can only define weight as a parameter, not a price...

 

// Kenneth

Link to comment
Share on other sites

Hi,

 

There is simple hack if you don't mind changing a bit of code.

 

Edit the file /classes/Cart.php ...note I'm using PS. v1.5.4 and my file is edited so the exact line number may vary.

 

Scroll down to around line 2651 (for priced based)

 

Edit the line that looks like:

if (isset($configuration['PS_SHIPPING_FREE_PRICE']))

AND CHANGE IT TO:

if (isset($configuration['PS_SHIPPING_FREE_PRICE']) && $id_carrier == XX)

Remember, 'XX' is the ID number of the carrier you want to make free. Make sure to change it to a ID number otherwise it will result in an error.

 

Also, take a look at this line (around 2662) especially if you are using shipping by weight. I always change both of mine, just so that I don't have to worry about updating it if I decide to switch to weight based shipping. Anyways, look for this line:

&& (float)$configuration['PS_SHIPPING_FREE_WEIGHT'] > 0)

AND change it to:

&& (float)$configuration['PS_SHIPPING_FREE_WEIGHT'] > 0 && $id_carrier == XX)

Again, changing the 'XX' to the ID number of the shipping carrier you wish to make free.

 

ADDITIONAL INFO:

 

If you want to make multiple shipping carriers free just add more of the AND statements to the end of the changed lines of code. IE:

&& (float)$configuration['PS_SHIPPING_FREE_WEIGHT'] > 0 && $id_carrier == XX && $id_carrier == XY)

Also, this is IMPORTANT!

 

You have to change the ID number everytime you update any of the shipping carriers. Prestashop is setup to create a "new" carrier with a new ID number everytime you edit/update/change any of the carriers. Therefore, if the ID number of the carrier changes than the above hacks won't work without updating them to reflect the new IDs. You shouldn't being updating your carriers that often, but if you do you need to make sure you make the changes to these lines.

 

Hope this helps!

  • Like 1
Link to comment
Share on other sites

It's not much of a change... you add 1 condition to 2 lines in the same file.

 

However, i understand your concern, and in that case your only other option is to purchase a module. Yea, there isn't a free one out there that does this.

 

Just FYI... we are now using Presto-Changeo's shipping modules... USPS and UPS. They work flawlessly and much better than the ones included with PS by default. Plus support is simply amazing. Worth checking out.

Link to comment
Share on other sites

×
×
  • Create New...