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

In Spree 2.2 adding Product Sale Prices adds the price twice #4

Closed
berkes opened this issue Aug 7, 2014 · 3 comments
Closed

In Spree 2.2 adding Product Sale Prices adds the price twice #4

berkes opened this issue Aug 7, 2014 · 3 comments

Comments

@berkes
Copy link

berkes commented Aug 7, 2014

When adding product sale prices at e.g. http://0.0.0.0:3000/admin/products/ruby-on-rails-mug/sale_prices, prices get added twice.

It is not some JS error adding a row double, the entry is added twice to the Database. I can see it afterwards in the DB and the logs list two times the query that inserts a new sales price.

I am not sure what triggers this, but I assume some hook or trigger is called twice.

@ronzalo
Copy link
Owner

ronzalo commented Aug 7, 2014

When sale price is added on backend, is for all currencies and for all variants. I'll add some test for this behavior.

@berkes
Copy link
Author

berkes commented Aug 7, 2014

It seems to be an issue with the new Spree::Price#sale_price= setter, which adds a price. And is (accidentally) called from def new_sale, where a variable is set sale_price = ....

Fixing that, changes the behaviour, but does not solve it. I am digging deeper.

@berkes
Copy link
Author

berkes commented Aug 7, 2014

Scratch that. It is indeed a case where I have two Prices on a variant, one in USD and one in EUR.

I assume this is by design then.

@berkes berkes closed this as completed Aug 7, 2014
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

2 participants