Hi Liam, I was able to replicate it on my development store. Happy to share more details privately about our merchant stores, but here’s a quick summary:
When trying to add 2 items to the cart (with only 1 in stock), it correctly blocks the action. However, after that, trying to add just 1 item also fails, even though it should work.
When using a regular tab, the product shows as “sold out” despite 1 unit being available. In an incognito tab, it works fine.
Steps to Reproduce:
Try adding 2 items to the cart (only 1 in stock) — the system blocks it as expected.
Afterward, try adding 1 item — it fails, even though it’s available.
Refresh in a regular tab, and the product shows as “sold out,” but it should allow 1 item.
Open in an incognito tab, and it adds the product to the cart as expected.
This appears be the same Cart Corruption bug we documented in August last year on the old forums (link includes detailed reproduction steps, and loom videos also):
We’ve got an open ticket with Dustin from Plus Front End Dev support: Your ticket ID is 50143592.
Through the back and forth, it sounds like this is still in the engineering teams backlog.
Any chance you could check in on this ticket please @Liam-Shopify ?
TLDR:
Failing to add a bundle product that is (requires_components) to cart (because it fails cart transformation validation), corrupts the cart for the next add to cart event that is a valid cart transformation. Only a /cart/clear solves this issue.
Invalid ghost products remain in cart
We are concerned that ghost versions of invalid bundle products are lingering in the cart.
When an invalid bundle is added to the cart and you proceed to the checkout page, you encounter the error message, “Some items are no longer available and have been removed from your cart” (referring to the bundle product that shouldn’t have been added because it was invalid and returned an error).
It appears that the “cannot add to cart” error does not effectively prevent the product from being added.
This may be the reason for future conflicts (corrupted cart) when trying to add a valid version of that bundle to the cart.
Here is a video recording of ghost products remaining in cart:
We set the bundle metafield to empty to simulate an invalid bundle
We add the invalid bundle to cart - this returns an error “The bundle product can not be added to cart”
Yeah, this has been a constant issue, and it’s always a headache to explain to merchants. The experience feels buggy, and they worry about losing sales because of it.
Do you think we can reach out to someone in Shopify team to address this and get an update on this?
We’ve been struggling to get an update from our ticket for this.
Any chance you could please follow up @Liam-Shopify ?
@Ashfaq Are you using expand or merge operations in your example? Are you also seeing the CartTransform as a success even when the cart error is cached incorrectly?
It’s been incredibly hard to get steps to repeat the exact issue on our merchants stores. It’s intermittent and incredibly frustrating for customers, merchants, and us.
The bug is:
A bundle fails to add to cart for a reason (yours is inventory, our replicable steps were to force a fail with empty component metafields).
The Cart Transform shows success.
The error is cached in the cart
Subsequent adds to cart of the same bundle product with correct data that should succeed, also fail (functions succeeds, add.js fails)
Proceeding to checkout seems to show a ‘ghost’ product in cart that is not available in the form of a ‘Out of stock’ error popup
We’re also facing an issue with seemingly random “the product xx is already sold out” errors. Even though inventory of all items is definitely in stock. We also use lineItemProperties that we validate against variant metafields. @Liam-Shopify this seems to have been an issue for way over 6 months from the various discussions in shopify’s partner slack and here.
I have noticed this issue on a client’s site where this seems to occur randomly. We’ve observed the message "Some items are no longer available and have been removed from your cart " show up on checkout, even though the product is in stock. We are unable to determine the cause or the impact of this issue. Is there a way to understand what is causing this and if there’s a solution to resolve it?
Unfortunately I also get many “Out of stock” error reports from merchants even having the necessary amount of products in the stock. It seem to happen when the cart transformation (merge operation) is activated.
Would be really great to have an update on the status of this error because merchants are very frustrated by this and we cannot provide them a solution.
Hi @Dmitri_Pavlutin you seem to be the latest who is having this issue.
I am not a Shopify staff honestly I am fairly new to Shopify but I have been here for a year and above and have been working on themes and client issues. I pretty much love debugging code. I am not sure if I can come up with a solution to this but I would definitely love to take a look at the store if it’s alright with you.
Yes, many developers are encountering the 422 error from the Shopify AJAX API’s add.js endpoint, even when items are clearly in stock. This issue often arises due to stale or cached product data in the user’s browser, causing the API to think the item is unavailable. It typically resolves when using incognito mode or after clearing the cache, indicating a caching conflict. Shopify developers recommend implementing cache-busting techniques or forcing a fresh cart state to prevent customer frustration. If you’re a developer facing this, monitor affected themes or apps that may interfere with product data or cart scripts.
Just following up to see if there are any updates on this issue. Several merchants are still encountering the same error message, even when simply clicking the “Add to Cart” button. Here’s a demo video for reference: Shopify soldout issue · CleanShot Cloud
The Ajax API POST to update.js and add.js return 422 error with message “The Product “XXX” is already sold out”.
Please note that we’ve already verified the product inventory.
Hey @ayoub just in case you are looking for a solution until Shopify comes with an update you can try custom coding this. I mean listen for the events and then doing the related operation using cart api endpoints.