Shopping Cart Discount System

Karl DeSaulniers <[email protected]>
Newsgroups gmane.comp.php.general,gmane.comp.php.database
Message-ID <[email protected]>
Hello Everyone,
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 whole  
cart
including shipping, rush charges then add the tax after applying the  
discount?

Sorry for the run-on question, hope this makes sense enough to merit  
help.

HNY,

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com

PS: Because this question could be answered by either database or  
general, is the only reason for the double post.
Wont be making a habit of it.. :)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.