-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(fix): Determine denormalized product inventory status during Shopify import #3366
(fix): Determine denormalized product inventory status during Shopify import #3366
Conversation
Looks good generally, but I have some questions:
And for testing:
|
@spencern looks like you missed the comment above |
@impactmass
Re: this change affecting anyone that already used the current version to import products, that's a great question. I'm pretty sure that top-level field gets updated every time inventory gets changed, but it might be worth including a migration here that loops through all products and updates them anyway? I could write the migration to check for a shopifyId first and then to check for the presence of one of these fields |
I think if we can confirm that the top-level field gets updated every time inventory gets changed, this should be good to approve then. |
… the grid This is how it currently works in Reaction when creating a product and I think was the intention with the grid.
@impactmass Those do get updated as part of this It's then called on L564 by updateVariant, and on L965 by updateProductField. |
I've added one more update in here to fix the way variant images are imported. To this point only the first image imported was added to the grid via It will not affect existing images from Shopify that have been imported. I'm not certain if we want to add a migration here, as it's possible that people have built their apps to account for the way that the media was imported originally, but a migration could be added to set the first image of each variant to have I lean towards this being a fix and not adding a migration, but could understand an argument either way. @impactmass what do you think? |
@impactmass ready for another review here. |
Yes, doing a migration in this case can cause a break in the way someone else already built on earlier imports. So, I tend towards the way it's setup here. |
Fixes an unreported issue where denormalized product inventory status was not set during import of products from Shopify.
This PR resolves this by setting
isSoldOut
,isLowQuantity
, andisBackorder
flags correctly on the top level product during import.