How to Display Stock Availability Message on Product Page in Magento 2
Several stock scenarios exist for a single product in a Magento 2 store.
As a part of a good shopping experience, it is important for the admin to display the stock status to the frontend customer according to the inventory.
For example, when your product is out of stock and you do not inform the potential customer prior, they end up doing the entire shopping spree only to find out at the checkout step that they cannot get that item.
It is disappointing!
Instead, display stock availability message on product page in Magento 2 store as per the inventory and never deliver a bad user experience! Another way is to remove stock availability from the product page in Magento 2 altogether that I talked about in my earlier post.
Methods to Display Stock Availability Message on Product Page in Magento 2:
Method 1:
- Login to admin panel
- Go to Stores > Configuration
- Expand Catalog and select Inventory to configure the inventory.
- Expand Product Stock Options
- Set yes to “Manage Stocks“
Method 2: Change stock message from the Catalog page
- Go to Stores > Configuration
- Under Catalog, select Inventory
- Expand “Stock Options”
- Set “yes” in both the following fields:
- Display Out of Stock Products
- Display Products Availability in Stock on StoreFront
That’s it.
Any doubts about the method? If so, please mention them in the Comments section below. I’d be happy to help.
Also, do not hesitate to share the solution with the Magento community via social media.
Thank you.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How to Install Magento 2 Extension
How to Add Column to Customer Sales Order History Page in Magento 2
Next