On Dec 31, 2012, at 3:36 AM, Ashley Sheridan wrote:
Karl DeSaulniers <karl@xxxxxxxxxxxxxxx> wrote:
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.. :)
I would apply the discounts where they made sense from a customer
POV. Would you expect a t-shirt discount to be applied to only the
base item or the product as a whole? I'd say tge whole thing. You
could have various areas in your code that apply discounts at
different levels: per item, per group of items (bogof, etc), and per
basket.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
That does make more sense now that you say.
I guess I would want or expect the discount to apply to the whole thing.
Thanks Ash.
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php