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
{{ message }}
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
When I try to add a product with a bigger quantity than is available (POST /carts/{token}/items) I get the following response :
{"code":500,"message":"Not enough stock for product variant: my_product"}
That is great but when I update the quantity of the product, PUT /carts/{token}/items/{identifier} it always passes even if the quantity is much higher than the available stock.
Looking into vendor/sylius/shop-api-plugin/src/Controller/Cart/ChangeItemQuantityAction.php I can see tht it is the validate function fron the DefaultCommandProvider that is called. There are no constraints passed to this function. What could we do to check the inventory when the quantity gets changed ?