fix: sync lowInventoryThreshold number between variants and child options #4519
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #4358
Impact: minor
Type: fix
Issue
Low inventory threshold numbers are stored only on a product variant, not on it's options. We have login in our code to attach the variants number to each option, however even with this logic, in the database, the
lowInventoryThreshold
is always set to0
on the the option.Solution
We are keeping the logic the same, and how we read the numbers the same, but we are now syncing the
lowInventoryThreshold
number to each option, when it's changed on it's parent variant. This may create easier use in the future, but should not create any real changes now, asoption.lowInventoryThreshold
isn't used anywhere. The only change seen should be the number inside the database.Breaking changes
None
Testing
3T
and see the same number is saved as thelowInventoryThreshold
number on that variant, as well as all the option children of said variant.