From e341f09b200d96209fe8f7b521b7cd4c74e0f93e Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Sun, 20 Mar 2022 19:20:18 +0100 Subject: [PATCH] Do not consider unpromotionable line items discountable --- core/app/models/spree/promotion.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/app/models/spree/promotion.rb b/core/app/models/spree/promotion.rb index f29f0b32668..4e20964c36b 100644 --- a/core/app/models/spree/promotion.rb +++ b/core/app/models/spree/promotion.rb @@ -254,7 +254,8 @@ def order_discountable?(order) end def line_item_discountable?(line_item) - rules.all? { |rule| rule.line_item_discountable?(line_item) } + line_item.variant.product.promotionable? && + rules.all? { |rule| rule.line_item_discountable?(line_item) } end def shipment_discountable?(shipment)