spree_related_products
spree_related_products copied to clipboard
discount Calculator problem
With spree 2.4.6 and spree_related_products 2-4-stable, the Calculator doesn't work. This small change in 'app/models/spree/calculator/related_product_discount.rb' fixed it:
order.line_items.each do |li|
mastervariant = li.variant.product.master
if discount_applies_to.include? mastervariant
discount = relations.detect {|rel| rel.related_to.master == mastervariant}.discount_amount
...
Maybe there is a better way to fix the problem, but it works.