Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discount Calculator problem #105

Open
cahein opened this issue Apr 17, 2015 · 0 comments
Open

discount Calculator problem #105

cahein opened this issue Apr 17, 2015 · 0 comments

Comments

@cahein
Copy link

cahein commented Apr 17, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant