Those are good thoughts, Bill. I will take them into consideration in my design.
I've been thinking that I need some kind of "coupon manager" object. Every time the customer adds/removes an item to/from the cart, or whenever the customer enters a coupon code, the entire ShoppingCart object would be passed into the CouponManager object -- which would then examine the cartItems against the coupon code(s) and add/remove the relevant Coupon objects to/from the ShoppingCart. Does this sound reasonable? I still haven't worked out how to calculate item pricing and totals from these Coupon objects, but wouldn't this be best done by the ShoppingCart itself upon cart display or order processing? Jim McMullen Devlab, Inc. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Rawlinson Sent: Wednesday, March 23, 2005 11:21 AM To: [email protected] Subject: Re: [CFCDev] Help with OO Model for Shopping Cart i think the buy one get second at nn% off would work just like a single item coupon - when the CartItem is added to cart your system would check for existance of another copy of the same CartItem and if so add the Coupon. Another option is to have the CartItem id associated with the Coupon - but then you run into other problems such as if someone has three of the same item then removes the item that had the coupon associated with it you may accidently remove the Coupon when you shouldn't have. Your whole order coupon could have a "Stickiness" to it that makes it non-removable so you dont have to worry about it being associated with an item (or type of item). A single item coupon can have the item type associated with it - this way if they add 2 or more of the same item, but then later remove all but one the coupon will still stay around. the free item coupon would need to be much like a single item coupon but have the necessary information about the free item within it as well as the type of item it is associated with that is being purchased. I didn't really give this alot of thought, sorry, so if my logic is mucked up - or i'm overlooking a pitfall - sorry. Bill ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
