On Tuesday 15 October 2002 15:35, Steve Jackson wrote:
> Hi all,
> I have a problem which I'm not sure the best way to go about. We will be
> shipping products based on weight and I have two types of product with
> differing weights. Basically we want to charge one price for shipping
> less than 10 KG and one for anything over that.
> I wonder how to go about it. I have the weights for each product and
> have my products organised into two categories in MySQL DB. So anything
> in category 1 means less than 30 items is below 10 Kilos and 15 in
> category 2.

Perhaps I don't understand you properly -- why you need two categories? How is 
shipping charge calculated? 

Do you just have two rates (which your 1st paragraph seems to imply) -- ie If 
the total weight of products is under 10KG charge $5, otherwise charge $10? 

> How would you code this? I have tried adding a weight category to my
> products table and calculating total weight (then a simple if statement
> would do the trick) 

... In which case, yes a simple if statement would suffice.

> but it leads to other problems which I couldn't
> de-bug. Basically adding to my products table means my DB won't update
> due to a Mysql error (column count didn't match or something) 

Perhaps if you post your code and your db schema here then someone may be able 
to help.

Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

"God is a comedian playing to an audience too afraid to laugh."
- Voltaire

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to