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

fix: sync lowInventoryThreshold number between variants and child options #4519

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

kieckhafer
Copy link
Member

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 to 0 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, as option.lowInventoryThreshold isn't used anywhere. The only change seen should be the number inside the database.

Breaking changes

None

Testing

  1. Add a product with variants and options
  2. Add a "warn at" number to the product variant
  3. Open 3T and see the same number is saved as the lowInventoryThreshold number on that variant, as well as all the option children of said variant.

@kieckhafer kieckhafer changed the base branch from master to release-1.15.0 August 7, 2018 21:54
@kieckhafer kieckhafer self-assigned this Aug 7, 2018
Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@willopez willopez merged commit c0f2422 into release-1.15.0 Aug 9, 2018
@willopez willopez deleted the fix-4358-kieckhafer-lowInventoryThreshold branch August 9, 2018 16:26
@spencern spencern mentioned this pull request Aug 14, 2018
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

Successfully merging this pull request may close these issues.

2 participants