You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Stock validation not working as expected when you are adding two of the same variants but with different custom field values.
For example, you have Variant A with tracked inventory, and in stock, you have only 1. You are calling addItemToOrder with Variant A and custom field value 1 and then calling addItemToOrder with the same Variant A but custom field value as 2. Now in order you have 2 order lines (the same variant with different custom fields, which are expected if it's available such as count of stock but not in this example when we have only 1 available stock).
To Reproduce
Steps to reproduce the behavior:
Create a custom field for OrderLine (for example customField with type string)
Create a Variant A with manageable stock and stock count 1
Create an order and add a Variant A with custom field value 1
Add one more time Variant A but now with custom field value 2
You successfully added more than the in-stock available items.
Expected behavior
Receiving an error that no possibility to add more of the Variant A to the order.
Environment (please complete the following information):
@vendure/core version: 2.1.7
Nodejs version: v20.10
Database (mysql/postgres etc): any
Additional context
Also, you can fulfill this order (from steps to reproduce) and then you will have a negative stock value (-1)
The text was updated successfully, but these errors were encountered:
Describe the bug
Stock validation not working as expected when you are adding two of the same variants but with different custom field values.
For example, you have
Variant A
with tracked inventory, and in stock, you have only 1. You are callingaddItemToOrder
withVariant A
and custom field value1
and then calling addItemToOrder with the sameVariant A
but custom field value as2
. Now in order you have 2 order lines (the same variant with different custom fields, which are expected if it's available such as count of stock but not in this example when we have only 1 available stock).To Reproduce
Steps to reproduce the behavior:
customField
with type string)Variant A
with manageable stock and stock count1
Variant A
with custom field value1
Variant A
but now with custom field value2
Expected behavior
Receiving an error that no possibility to add more of the
Variant A
to the order.Environment (please complete the following information):
Additional context
Also, you can fulfill this order (from steps to reproduce) and then you will have a negative stock value (-1)
The text was updated successfully, but these errors were encountered: