On Dec 31, 2012, at 3:51 PM, tamouse mailing lists wrote:
On Mon, Dec 31, 2012 at 2:31 AM, Karl DeSaulniers <k...@designdrumm.com
Hope all are well. Quick and hopefully painless question.
Is there any examples on how to build a discount system
into your shopping cart out there that anyone knows of?
I am using MySQL and PHP. I have built one of my own so far,
but am having trouble making sense of what goes where.
For example. If a product has miscellaneous charges,
lets say.. glitter is extra on your shirt.
How is discounts applied? I mean, as far as discounts go,
lets say its 20% a shirt and this shirt has glitter.
Is it best practice to apply the discount to just the shirt
or the shirt and glitter as a combo discount.
I know this is somewhat dependent on the owners choice
of what he/she wants to give the discount on,
but my question is of the programing of it.
Do I build conditions for the shirt to get a discount applied
then the miscellaneous charges, or combine the totals of the two,
then apply the discount to the sum?
Then lets say there is a cart discount also being applied.
Is it best practice to apply this to the total of items then
add the shipping, rush charges and tax, or to the total of the
including shipping, rush charges then add the tax after applying the
These sound much more like business operating questions than
programming questions, per se. I think it really depends a lot on what
other businesses in the same niche as yours do, or if you can find
out. Once you have figured out the business practices, coding them
should be easier, I'd say, but doing it the other way 'round seems
like would lead to confusion.
Some questions from a really non-business person:
1. Why are you offering discounts at all? What do you hope to
accomplish by offering discounts?
2. Who qualifies for which discounts and why?
3. Do discounts apply to just the base merchandise, or the whole end
piece, with whatever customisations it might have, and if so or if
4. Are there different discount rates applied to base merchandise and
subsequent customisations, and if so, why?
5. Is there any reason to make this complicated, or instead just offer
a flat rate discount on final price, before taxes and S&H?
My appologies if this is an OT thread. I was in the midst of coding
these things when I asked it.
Yes, it is a little confusing. This is a small t-shirt company a
friend and I are putting together.
I have thought out most of the business logic for the company and the
The only thing I guess I forgot to plan in was these discounts and how
to apply them.
I currently have discounts per item and per the cart. The discounts
are set up to apply on birthdays
and added by admins for discounting items to clear inventory. The cart
discounts are set to apply
at a certain interval of purchase amounts. For eg. (and im really just
throwing numbers) if someone buys $1,000
worth of merch, they are sent a 50% off your cart discount to their
I guess the question was more how to apply the discounts to the cart.
Discount item + miscellaneous or just item.
Discount cart or cart + shipping + handling. I was also asking if
anyone had or knew of a sample script I could pick apart.
That was probably the programing part of the question. But thank you
guys for taking the time to answer.
I believe it helped. We will see.. :)
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php