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

Stock availability bug with multiple variants in assembly #162

Open
jkelleyj opened this issue Aug 25, 2017 · 2 comments
Open

Stock availability bug with multiple variants in assembly #162

jkelleyj opened this issue Aug 25, 2017 · 2 comments

Comments

@jkelleyj
Copy link

When more than one variant is used on an assembly product, if any one of the variants has an out of stock part, no variant can be added to the cart because the availability validator uses quantity_without_part_line_items on the line item to get the parts. This pulls all parts on the product as opposed to the variant specified.

For example:
Assembly Product

  • master
  • variant 1
    • part 1a
    • part 2a
  • variant 2
    • part 1b
    • part 2b

Whenever part 2b is OOS, variant 1 can not be added to the cart. It happens to work if one is already in the cart, b/c quantity_with_part_line_items is used in the availability validator in that case. But when the item is added the first time, it fails due to a stock error in the line item validation.

We can change the quantity_without_part_line_items method to use the chosen assembly variant's parts (this works for master when no variants as well as an assembly variant).

jkelleyj added a commit to jkelleyj/spree-product-assembly that referenced this issue Aug 25, 2017
jkelleyj added a commit to jkelleyj/spree-product-assembly that referenced this issue Aug 25, 2017
@czottmann
Copy link

+1

1 similar comment
@kinduff
Copy link

kinduff commented Nov 23, 2017

+1

jkelleyj added a commit to jkelleyj/spree-product-assembly that referenced this issue May 11, 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

No branches or pull requests

3 participants