Skip to content

Instantly share code, notes, and snippets.

@slaskis
Created August 26, 2011 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaskis/1173346 to your computer and use it in GitHub Desktop.
Save slaskis/1173346 to your computer and use it in GitHub Desktop.
Spree Promo Multiple Automatic Promotions Bug
# In spree/promo/lib/spree_promo.rb
next if current_promotions.present? && !promotion.combine?
amount = promotion.calculator.compute(self).abs
amount = item_total if amount > item_total
- if amount > 0
+ if amount > 0 && !promotion_credit_exists?(promotion)
self.promotion_credits.create(
:source => promotion,
:amount => -amount,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment