Skip to content

[4.x]: Out of stock product in cart causes problems, unable to update cart after this #3873

Open
@jornwildenbeest

Description

@jornwildenbeest

What happened?

Description

When having a product in your cart that went out of stock, while you had it in your cart, it causes problems.
When you try to add another product to your cart, it always returns the "“{description}” is currently out of stock." and not adding the product o your cart.

Same goes for editing other line items in your cart, let's say you want to change the qty or delete another product, it is not possible because of this one product that is out of stock.

Steps to reproduce

  1. Add multiple products to your active cart.
  2. reduce the stock of 1 product to 0 through the control panel.
  3. Try adding another product to your cart through a product detail page for example

Expected behavior

  1. The product still gets added to you cart.

Actual behavior

You get an error that it is not possible to update your cart because that product is currently out of stock, but this is far from user friendly.

Craft CMS version

4.13.9

Craft Commerce version

4.7.2

PHP version

8.1

Operating system and version

Mac OS

Database type and version

Mysql 8

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions