Skip to content

[5.x]: Changing the line items in an order does not alter the inventory #4254

@MatthiasBrodelet

Description

@MatthiasBrodelet

What happened?

Description

The webshop client placed an order via the website and called the store to alter that order from 1 product to 5 of the same product.
The order can currently not be fulfilled.
My first guess was that the product variant did not have inventory enabled because I could also not find the order in the inventory history for the product variant.
However when I look at the configuration for the product variant then everything seems to be correct.
Also, when I now change the amount of products for the same order it also does not change anything in the order history.

To isolate the issue I create a completely new order for the same product with an amount of 5.
This gets added to the inventory history.
Then I change the order product amount from 5 to 3 and save the order.
This does not change the inventory history and it does also not remove 2 from the committed column to the available column.

This is a pretty big bug since this means that the inventory is not correct and cannot be trusted.

I still have no clue why the original order does not show up in the order history.
I also cannot prove that our client had inventory disabled for that product variant since there is no edit history for product variants.

Steps to reproduce

  1. Place a new order with x amount of the same product
  2. Change the amount of ordered product in the CP for the order
  3. Check the product variant inventory history to see if it reflects these changes

Expected behavior

The inventory should be updated always even after an order has been made.

Actual behavior

The inventory keeps its original state from when the order has been created.

Craft CMS version

5.9.14

Craft Commerce version

5.5.4

PHP version

8.4

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions