Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add no other promotions rule #2959
This is a promotion rule that seems like it should ship with Solidus. The primary reason I feel this way is because it requires modifying the Spree::PromotionHandler::Coupon class.
Another solution might be extracting
I like this idea but I'm afraid of how it would work. The way it's currently written the NoOtherPromotions promo wouldn't apply if other promotions were already there. What if that was a better promotion than what is currently applied? AFAIK the default frontend doesn't allow users to manage promos applied to an order which would entirely lock the user out of using this promo. Should the application of this promo remove other promos if better?
Not really sure what the best path is just thinking out loud.
@ericsaupe I don't disagree with you. However, I do think there should be an option for stores who don't want coupon stacking of any kind and this is a rather generic implementation of that which can be extended for more specific use cases (e.g. picking the best coupon).
I would also really like if there was a global config option that disabled coupon stacking on ALL coupons, but that is a little less granular than this method.
Just to clarify, the way it works, a promotion with this rule could not be applied if another promotion was already applied AND no other other promotion could be applied after it was applied. So it is only possible to use such a promotion as the ONLY promotion.