Re: IDEA: Method for Shopping Cart QUANTITY DISCOUNT?
| From: | Thomas Deliduka | Date: | Wed, 22 Nov 2000 20:43:15 +0000 |
| Subject: | Re: IDEA: Method for Shopping Cart QUANTITY DISCOUNT? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26703@lists.php.net to get a copy of this message | ||
On 11/22/00 2:53 PM this was written:
> 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.
I have a cart that handles this but it was way back when I was just learning
PHP. If I went over it again I probably would be able to code it much easier
now.
The basic premise is this:
In the table there is these fields:
price
quanity_discount flag (1 or 0)
q1 (first level where the discount begins, meaning 10 or more items)
q1price
q2
q2price
etc up to 4 levels.
Then when I display the item I see that quantity_discount is flagged and I
display it like this:
Price: 2.00
10+: 1.75
100+: 1.20
1000+: 0.75
something like that.
Then when they enter in number for the cart I do a determination based on
the Q levels where the price fits and then calculate it accordingly.
It works well, but like I said, I would probably code it more efficiently
then it is now if I went back to it.
--
Thomas Deliduka
IT Manager
-------------------------
New Eve Media
The Solution To Your Internet Angst
http://www.neweve.com/