Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET Design Patterns
This is the forum to discuss the Wrox book Professional ASP.NET Design Patterns by Scott Millett; ISBN: 978-0-470-29278-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 29th, 2011, 12:07 AM
Authorized User
Join Date: Dec 2010
Posts: 23
Thanks: 3
Thanked 2 Times in 2 Posts
Default Custom Discount "Rules" ?

Thanks for the great book, it's got my head spinning a little but I like the very structured approach to the way you design your code.

I'm playing around with the Agatha's storefront code, and I'm interested in trying to add support for custom discount rules similar to what Magento describes here: http://www.magentocommerce.com/knowl...-do-i-use-them

Any ideas or help you can give me to get started would be much appreciated. Should I create a "DiscountService" class that has some methods on it to take in Product or Cart objects and applies discounts to them, and then hands them back to the cart to update and persist to the DB? Should the Cart or Product classes know how to "discount itself" or should that functionality be injected in somehow?
Old September 20th, 2011, 09:27 AM
elbandit's Avatar
Wrox Author
Points: 599, Level: 8
Points: 599, Level: 8 Points: 599, Level: 8 Points: 599, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2007
Location: Southsea, Portsmouth, Hampshire, United Kingdom.
Posts: 107
Thanks: 10
Thanked 17 Times in 15 Posts

Hi ksouthworth,

Sorry for the late reply!

Maybe the cart should be responsible for applying a discount to itself but something else needs to be responsible for determining if the cart satisfies the rules of a discount/voucher. E.g. You can pass the cart to a discount service and it will arrive at a discount amount it can then tell the cart to deduct that amount from the total price?

Let me know if you wantbto discuss this further as I realise you posted this question a while ago.


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.