radar/spree — pull request #10 by huoxito (2013-09-03 05:33:57+00:00)
Title: Differentiate promotions

Hi there o/

So I've started trying to work on a way to differentiate promotions. The main goal here is to grab only specific kinds of promotions in each specific spot. I guess the two most common examples are a promotion activated by a coupon code or by an item added to cart.

I spent a couple of hours on it tonight and the only thing I come up with was subclassing Promotion. Honestly I'm not sure myself that's the best idea here. Would you say it's worth it? does it look like a good idea?

The other part of this PR, this one I like indeed as it sounds like a good idea to me, is that I'm trying to make this pattern where each kind of promo would have its own handler. So I renamed the previously create PromotionItemHandlers and CouponApplicator to PromotionHandler::Cart and PromotionHandler::Coupon respectively. Please take a look at the PromotionHandler::Cart when you have a chance. I'm trying to build it in a way that allows users to make it highly customizable from within their rails application or extensions.

This is still a working in progress I just wanted to show you how I started it, any feedback / help very very welcome. I made this list of stuff we should accomplish or at least look at in the promotion system, would you agree they're relevant?

- [ ] Differentiate promotions
- [ ] Associate promotions applied to an order (probably by adding a db table to join them both)
- [ ] Turn on / off promotions (or their eligibility considering adjustments)
- [ ] Check give an item for free is possible
- [ ] Check free shipping promotions are still possible

thanks!