Title: Message

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]

Reply via email to