Forums / Built-in Shipping and Payment Modules / shipping cost based on product type?

shipping cost based on product type?

Locked

Views: 2,540

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
18 Jul 2006, 8:24 PM
#1
shopper1 avatar

shopper1

New Zenner

Join Date:
Jul 2006
Posts:
3
Plugin Contributions:
0

shipping cost based on product type?

I've been trying to figure out how to get different shipping rates for different product types.

product type A is a flat rate of $5, no matter how many items are purchased, shipping total = $5.
product type B is a table rate based on price (up to $19.99, shipping costs = $8. $20 to $24.99, shipping costs = $9 ...).

The problem occurs when a customer wants to purchase some of product type A and some of product type B. I need to calculate shipping from products of mixed rates.

I'm trying to create my own shipping module with an algorithm to handle the math. I've got the module set up, but I don't know what variables I can use in my algorithm. Can I use the product_id field? And how do I know how many of each product are in the customers basket? I rather not access the MySQL database. I heard someone used session variables to get a count of what was in the shopping cart.

Can anyone help with this or have a better suggestion?

Thanks,
Tom

19 Jul 2006, 5:40 PM
#2
shopper1 avatar

shopper1

New Zenner

Join Date:
Jul 2006
Posts:
3
Plugin Contributions:
0

Re: shipping cost based on product type?

Now I know why similar questions have been asked many times, but no real answer. After you figure it out, you are sick of the topic and don't want anything to do with it anymore. But I will write what I found.

I looked in the shopping_cart.php file and found some session variables that can be used in calculating total shipping cost. I'm using the weight variable right now and making sure all my flat rate products have zero weight. All the other products have a non zero weight. So that is how I differentiate between product types. Later I will change this and have a key word in the product name. If the key word is found in the product name, then it has a certain shipping rate. Else it has a different shipping rate. Then I sum up the individual shipping totals to get the grand total. There are other ways I'm sure, but this is the first solution that came to mind.

19 Jul 2006, 6:14 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: shipping cost based on product type?

Yes ... in order to do what you are proposing you will need some customization ...

You will have to let us know how this ends up working for you ...

Thanks for the update ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!