spree_related_products icon indicating copy to clipboard operation
spree_related_products copied to clipboard

discount Calculator problem

Open cahein opened this issue 9 years ago • 0 comments

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.

cahein avatar Apr 17 '15 10:04 cahein