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


On Wed, 23 Mar 2005 10:38:04 -0500, Jim McMullen
<[EMAIL PROTECTED]> wrote:
> Yes, I had considered a base coupon class with a subclass for each coupon
> type. But being new to OOP, I get stuck at implementing the classes.
> 
> Would I put coupon instances into a coupon struct in the shopping cart and
> then iterate over them when I call a calcTotal method? If so, how would I
> then apply the single item coupon to the correct item? I was thinking it
> might be more appropriate to put the single-item coupon in the corresponding
> CartItem object, but then I don't think this would work for multiple-item
> coupons (i.e. buy one, get 2nd at NN% off), or would it?
> 
> Thanks for the advice.
> 
> Jim McMullen
> Devlab, Inc.
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Micha Schopman
> Sent: Wednesday, March 23, 2005 10:10 AM
> To: [email protected]
> Subject: RE: [CFCDev] Help with OO Model for Shopping Cart
> 
> 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
> Project Manager
> Modern Media, Databankweg 12 M, 3821 AL  Amersfoort
> Tel 033-4535377, Fax 033-4535388
> KvK Amersfoort 39081679, Rabo 39.48.05.380
> ----------------------------------------------------------------------------
> -------------------------------------------------------------------------
> Modern Media, Making You Interact Smarter. Onze oplossingen verbeteren de
> interactie met uw doelgroep.
> Wilt u meer omzet, lagere kosten of een beter service niveau? Voor meer
> informatie zie www.modernmedia.nl
> ----------------------------------------------------------------------------
> -------------------------------------------------------------------------
> 
>   _____
> 
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Jim McMullen
> Sent: woensdag 23 maart 2005 15:58
> To: [email protected]
> Subject: [CFCDev] Help with OO Model for Shopping Cart
> 
> 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.
> ---------------------------------------------------------- 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]
> ---------------------------------------------------------- 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]
> 
> ----------------------------------------------------------
> 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]
> 


-- 
[EMAIL PROTECTED]
http://blog.rawlinson.us

I have 47! gmail invites,want one?

----------------------------------------------------------
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]

Reply via email to