Open
Description
What happened?
Description
When changing an order in the control panel:
1x Line Item X removed and 1x Line Item Y added.
This will correctly increment the stock value of Line Item X, but not decrement the stock value of Line Item Y.
Furthermore if this order is updated, and the process is done again (reverted) neither value will be updated.
Steps to reproduce
- Complete an order of an item (Item X)
- Check stock values of Item X and Item Y (before values)
- Edit the order, and remove the line item (Item X) and add Item Y instead.
- See that Item X correctly has one more available, but Y is unchanged
- Go back to the order, and remove Item Y, and add Item X
- See that neither of the stock values are changed.
- The same happens with simply removing the items from the order, or adding any other item (Item Z). This will not decrement stock values.
Expected behavior
One would reasonably expect that adding a line item decrements its stock value, and that removing a line item increments the availability of it.
Craft CMS version
5.6.6
Craft Commerce version
5.3.2.2
PHP version
8.3.16
Operating system and version
No response
Database type and version
MySQL 8.0.41
Image driver and version
No response
Installed plugins and versions
Craft Commerce 5.3.2.2
Freeform 5.9.10
Redactor 4.2.0
SEOmatic 5.1.11
Stripe for Craft Commerce 5.0.6
Table Maker 5.0.4