-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Apply import defaults to variants of new products in Spree 2 #3425
Apply import defaults to variants of new products in Spree 2 #3425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a smart solution!!!
Spree 2 doesn't have `Product#on_hand=` any more. We actually can't save stock levels without saving the product first which creates a stock item. This hacky solution overwrites the attribute in the entry so that it gets copied to the variant later on. I think a better solution needs some refactoring as proposed in: #2783 (comment)
Should this be staged on fr staging then? |
no, this is master, should follow normal testing process. |
Yes of course 🙈 Was confused by the Spree Upgrade prefix. And I was thinking we had started testing every Spree PR 😺 |
@mkllnk I've tried the very simple case of trying to create a product with the import and my product category was not recognized although I copy-paste the category from the category list... Any idea where it can come from? My testing notes: https://docs.google.com/document/d/14OpOmsyk-jcdkmIrnL61PACZweg5OCArwSaH5rzLTx8/edit# |
@RachL I looked at your testing notes and I'm very surprised. I tested it on my computer and it all worked. Can you test it on another staging server? If it works somewhere else, we need to work out why product import is not working on UK staging. @Matt-Yorkley Any idea? |
@mkllnk oops sorry missed your comment. Yes will do! Moving this to test ready again. @sigmundpetersen I'm not sure I understand why you put it back in dev. Shout if you think it deserves something else than a new test. |
Actually it was you who originally put it back to dev @RachL 😆 I just put it back and forth |
@sigmundpetersen yes indeed, I always clear the testing column, but it seems to me that after Maikel's comment you put it back on test ready, but changed your mind. Anyway if it's not the case, we are all good :) |
@mkllnk it worked on AU staging :) I've found some little things, but that where not introduce by this PR, so moving this to ready to go! https://docs.google.com/document/d/14OpOmsyk-jcdkmIrnL61PACZweg5OCArwSaH5rzLTx8/edit# |
I dont usually merge to master, I am merging this one to get it into the "merge master into 2-0" PR that I want to create now. |
What? Why?
Closes #2783
Spree 2 doesn't have
Product#on_hand=
any more. We actually can't savestock levels without saving the product first which creates a stock
item.
This hacky solution overwrites the attribute in the entry so that it
gets copied to the variant later on. I think a better solution needs
some refactoring as proposed in:
#2783 (comment)
What should we test?
Product import with some default settings to overwrite stock levels and other properties.
Release notes
Changed: Updated the product import code for future Spree updates.
Changelog Category: Changed
How is this related to the Spree upgrade?
This fixes overriding stock levels in Spree 2.