Forums / Built-in Shipping and Payment Modules / Flat rates for different categories

Flat rates for different categories

Views: 880

Results 1 to 6 of 6
26 May 2013, 11:54 PM
#1
joetighe avatar

joetighe

New Zenner

Join Date:
Jan 2013
Posts:
3
Plugin Contributions:
0

Flat rates for different categories

I have a flat rate of $5.00 configured, but need to charge a higher rate if certain products are ordered. Can the following be configured for shipping?

I want to charge a flat rate of $5.00 for an order (no matter the quantity or price of products ordered) if the product is from Category A or B or both. (The maximum total shipping fee would be $5.00 if from these two categories.)
Now, if a product (no matter the quantity or price of products ordered) is from Category C, D, or E, the flat rate changes to $10.00...whether or not Category A or B products are also in the order.

Examples:
1 item from Category A - $5.00 flat rate
1 item from Category B - $5.00 flat rate.
2 items from Category B - $5.00 flat rate
3 items from Category A and 10 items from Category B - $5.00 flat rate.
3 items from Category A and 10 items from Category B - $5.00 flat rate.

1 item from Category C - $10.00 flat rate
2 items from Category D - $10.00 flat rate
3 items from Category E - $10.00 flat rate
2 items from Category D and 1 item from Category E - $10.00 flat rate.
1 item from Category A and 1 item from Category C - $10.00 flat rate.

Thanks in advance for any help.

27 May 2013, 2:57 AM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Flat rates for different categories

Not sure if this can be done without hacking into the code.

You would need to test what is in the cart and then apply a surcharge (flat rate + surcharge) for products in categories which demand a higher flat rate.

I have done something similar a few years ago where I needed to test for products from certain manufacturers and if found in cart then display a message on all the checkout pages.

See http://www.zen-cart.com/showthread.php?168159-Conditional-message-on-shopping-cart-page

Of course this needs to be modified accordingly and then you need to do some coding to add the surcharge

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

27 May 2013, 4:07 AM
#3
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Flat rates for different categories

Here is a hack which I have just tested on one of my local 1.3.9h test stores:

  1. backup your includes/modules/shipping/flat.php file and your DB
  2. in admin uninstall (remove) the Flat Rate shipping module
  3. replace your includes/modules/shipping/flat.php with the one attached in this post
  4. open the attached file and change the categories numbers to the categories ID's of your choice
  5. save and upload the file
  6. re-install your Flat Rate shipping module

If you encounter errors then uninstall the Flat Rate shipping module and replace my file with your backup

Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

27 May 2013, 7:34 PM
#4
joetighe avatar

joetighe

New Zenner

Join Date:
Jan 2013
Posts:
3
Plugin Contributions:
0

Re: Flat rates for different categories

Frank, thanks for your quick reply.
I'll give it a try first thing in the morning and and report back.

29 May 2013, 12:20 PM
#5
joetighe avatar

joetighe

New Zenner

Join Date:
Jan 2013
Posts:
3
Plugin Contributions:
0

Re: Flat rates for different categories

Good job Frank! Everything is working just fine. Thanks again for your help.
Joe

29 May 2013, 1:47 PM
#6
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Flat rates for different categories

joetighe:

Good job Frank! Everything is working just fine. Thanks again for your help.
Joe

Glad you got this working - pleasure to be of help to you!

Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.