|
I’d personally model the coupon as a
separate object, and maybe extending a default discount object. The discount
object is always calculated on checkout and this enables you to do multiple
discount types using inheritance. Not only coupons, but also
customer specific discounts. Micha Schopman Modern Media, Databankweg 12 M, 3821
AL Amersfoort ----------------------------------------------------------------------------------------------------------------------------------------------------- Modern Media, Making You Interact Smarter. Onze oplossingen
verbeteren de interactie met uw doelgroep. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jim McMullen I have a typical CFC-based shopping cart (ShoppingCart
object holds a struct of CartItem objects). This works well and I have no
real problem with it. However, I now need to implement a pretty
robust coupon/discount functionality into the app, and I can't seem to
figure out how to do it. I need to allow for four types of coupons: (1) Whole order coupon (NN% off entire order) (2) Single item coupon (NN% off this item) (3) Multiple item coupon (buy one (or two), get the 2nd (or
third) NN% off) (4) Free item coupon (buy this item, get a free
toaster) I think I can figure out how to model a single coupon
type, but as I'm an OOP newb, figuring out how to model and implement
the whole range has got my head spinning. Can anyone point me in the right direction? Jim McMullen Devlab, Inc. |
Title: Message
- [CFCDev] Help with OO Model for Shopping Cart Jim McMullen
- Re: [CFCDev] Help with OO Model for Shop... Xavi
- RE: [CFCDev] Help with OO Model for Shop... Angus Johnson
- RE: [CFCDev] Help with OO Model for ... Jim McMullen
- Re: [CFCDev] Help with OO Model ... Jared Rypka-Hauer - CMG, LLC
- RE: [CFCDev] Help with OO Model for Shop... Micha Schopman
- RE: [CFCDev] Help with OO Model for ... Jim McMullen
- Re: [CFCDev] Help with OO Model ... Bill Rawlinson
- RE: [CFCDev] Help with OO Mo... Jim McMullen
- Re: [CFCDev] Help with ... Bill Rawlinson
