-
Notifications
You must be signed in to change notification settings - Fork 172
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
[5.x]: Changing line items multiple times not updating stock as expected #3922
Comments
@eddiedale Inventory is only committed when the order is completed. Manually editing an order after the order is complete does not adjust stock, so you would need to do that manually if you make a manual edit to an order after it is complete. The only way to adjust stock related to the order at the moment is to fulfil the committed stock with the fulful button action. having said that, we do see a need to support this in the future. Would you expect to have the option to adjust the stock on each save of the order? What would you expect to happen to the original committed stock made at order completion, would you expect it to be committed immediately on order save? |
@lukeholder Thanks for the clarification! It sounds from your explanation that changing a completed order does not change any stock-values at all, but from my testing that seems incorrect. It does indeed remove the committed stock and bring that back to availability. It just does not decrease the available stock/ add committed stock on the newly added product. It feels like an unclear case of either/or. The removal gets handled as expected, but the added product not. And furthermore it's confusing that it only changes back the stock on the originally added product on the first order change, but not on subsequent changes. Then no changes are made to stock at all (as you describe as the default behavior) I would expect that upon order update, it would bring whatever was committed but is now removed from the order to be brought back into availability + the newly added products to be added as committed and decrease the available stock of it. |
eddie-12-03-2025-09.22.09.mp4 |
@eddiedale OK, so deleting the line item will remove the stock transactions (reduce available and add to committed) associated with the line item as you can see. If you had just increased or decreased the stock value for that line item it wouldn't have done anything to the stock counters. This isn't ideal but its the way it works for now. Will keep this ticket open as we discuss our proposed improvements internally. Thanks. |
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
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
The text was updated successfully, but these errors were encountered: