Re: IDEA: Method for Shopping Cart QUANTITY DISCOUNT?

From: Date: Thu, 23 Nov 2000 07:58:53 +0000
Subject: Re: IDEA: Method for Shopping Cart QUANTITY DISCOUNT?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-26696@lists.php.net to get a copy of this message
switch ($num_of_widgets) { case 1: $total_cost = 10; break; case 2: $total_cost = 18; break; case 3: $total_cost = 27.50; break; case 4: $total_cost = 35.33; break; case $num_of_widgets > 4: $total_cost = 40 + (($num_of_widgets - 5) * 5); break; default: // Error $total_cost = 0; break; } This would means the $total_cost is just that, before taxes of course but $num_of_widgets is the quantity. Jay ----- Original Message ----- From: "Derek Sivers" <list@hitmedia.com> To: <php-general@lists.php.net> Sent: Wednesday, November 22, 2000 2:53 PM Subject: [PHP] IDEA: Method for Shopping Cart QUANTITY DISCOUNT? > I know LOTS of us on the PHP list have worked with shopping carts. > > Has anyone found a good solution/method for doing quantity discounts? > > 1 widget = $10 > 2 widgets = $18 > 3 widgets = $27.50 > 4 widgets = $35.33 > 5 widgets = $40.00 > each additional = $5 > > Do you make SEPARATE ITEMS like a bundle? > Like "widget1" is an item at $10 but > "widget2" is a single item, costing $18? > (And if so, do you scroll through and decrease inventory of sub-items > inside the "widget2" package item?) > > I'd be doing this for a store with over 10,000 items, so it'd have to be > easily scalable. > > Any ideas, anyone? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#26696) next »