Currently, our customers checked on their list of products added on cart like sometime ago and notice that 2 or 3 products are gone as it turns out, the product is out of stock.
Default functionality: Remove products on the shopping cart once it is out of stock.
We have our store set so that when an item is out of stock, a customer cannot add it to their cart. However, if an item is added to a cart and then goes out of stock before that customer checks out, the client want the product not deleted in the list under cart page but add a text "out of stock".
This situation usually occurs when:
A customer returns to their abandoned cart and an item in their cart has sold out.
A customer is shopping for a popular product and adds it to their cart, but then the item goes out of stock while the customer is still shopping or decides to check out
Is there a way to have WooCommerce automatically add an "out of stock" text on the product lists in cart.
2
Answers
Check this blog
This will show a message like "99 in stock" or "out of stock" if item is sold out
Add this to your active theme
functions.php
file.