How to Display Out of Stock Products in Magento 2
When managing an e-commerce store, particularly one based on Magento 2, effectively displaying out-of-stock products can significantly impact your customer experience and business operations. This guide will provide a thorough exploration of how to display out of stock products in Magento 2, ensuring that your site remains user-friendly and efficient even when items are unavailable.

Introduction to Out of Stock Management in Magento 2
In the fast-paced world of e-commerce, the visibility of out-of-stock products is crucial. Displaying these items can enhance customer experience by allowing users to see product availability, maintain interest in your brand, and even encourage future purchases when the item is back in stock. According to a study by eMarketer, visibility of out-of-stock products can improve overall site engagement and reduce bounce rates.
Effective out-of-stock management also impacts SEO. Search engines like Google may view your site more favorably if it provides clear information about product availability. This transparency can contribute to better indexing and ranking of your product pages, as outlined in Google’s Webmaster Guidelines.
>>> How Out of Stock extension improve inventory managing in Magento 2: https://mastodon.social/@bsscommerce/112833441054522278
How to Display Out of Stock Products in Magento 2: Configuring Out of Stock Display Settings
To ensure that out-of-stock products are displayed correctly, follow these steps:
Accessing Magento 2 Admin Panel
Start by logging into your Magento 2 admin panel. This is your control center for managing all aspects of your store. Navigate to the dashboard and prepare to adjust your catalog settings.
Adjusting Catalog Settings
- Go to Stores > Configuration: From the admin panel, select ‘Stores’ from the main menu, then click on ‘Configuration.’
- Select Catalog: Under the ‘Catalog’ section, choose ‘Catalog’ again. This section allows you to configure various product display settings.
- Product Alerts: Ensure that ‘Display Out of Stock Products’ is set to ‘Yes.’ This setting will allow products that are out of stock to appear on your site, though you might want to customize their visibility as needed.
Configuring Product Page Settings
- Navigate to Catalog > Products: Access the product listing page where you can configure individual product settings.
- Edit Product: Select the product you wish to adjust and click ‘Edit.’
- Stock Status: Under the ‘Quantity’ section, ensure that ‘Stock Status’ is configured to display the product as ‘Out of Stock’ when inventory levels reach zero.
By following these steps, you ensure that out-of-stock products are not hidden from customers, thus maintaining a complete view of your product catalog.
Customizing Out of Stock Messages and Display
Customization of out-of-stock messages is essential for maintaining a consistent and professional look across your store. Here’s how you can tailor the display:
Using Magento Themes for Customization
- Locate Theme Files: Access your theme files via the admin panel or through your hosting provider’s file manager. Navigate to the directory where your theme’s templates are stored.
- Modify Templates: Edit the template files responsible for product display. Look for files like catalog_product_view.phtml and adjust the HTML and PHP code to include custom messages or styling for out-of-stock products.
Adding Custom CSS for Out of Stock Products
- Create Custom CSS: Open your theme’s CSS file or create a new one for custom styles. You can add styles specifically for out-of-stock messages.
Example Code:
.out-of-stock {
color: red;
font-weight: bold;
background-color: #f8d7da;
padding: 10px;
border-radius: 5px;
}
- This code snippet highlights out-of-stock products with a noticeable background and text color, making the status clear to users.
Customizing your site’s appearance and messaging ensures that customers receive consistent and helpful information regarding product availability.
Advanced Techniques for Displaying Out of Stock Products
For more sophisticated handling of out-of-stock products, consider the following advanced techniques:
Utilizing Magento Extensions
Magento offers a variety of extensions designed to enhance the management of out-of-stock products. Some popular options include:
- BSS Out of Stock Notification: With its automated notifications, customizable email templates, detailed stock reports, and user-friendly interface, it offers a comprehensive solution for keeping customers engaged and informed.
>>> View more details: https://bsscommerce.com/magento-2-out-of-stock-notification-extension.html
- Mageplaza Out of Stock Notification: This extension allows customers to sign up for notifications when a product is back in stock. It’s a valuable tool for maintaining customer engagement.
- Amasty Out of Stock Notification: Provides advanced features like automatic email notifications and detailed stock reports.
Extensions like these can streamline your out-of-stock management and improve overall site functionality.
Developing Custom Modules
For highly customized needs, you may opt to develop your own Magento modules. This process involves:
- Creating a New Module: Develop a module that integrates with Magento’s inventory management system to provide tailored out-of-stock handling features.
- Custom Logic: Implement custom business logic to control how and when out-of-stock products are displayed based on specific criteria unique to your store.
Custom modules offer flexibility and control over how out-of-stock products are handled, allowing for a more tailored customer experience.
>>> Read more: Enable Magento 2 Low Stock Notification Email to Admin
SEO Implications of Displaying Out of Stock Products
Displaying out-of-stock products can have significant SEO benefits. Here’s how:
Impact on Search Engine Indexing
Search engines prefer sites that provide complete and accurate information. Displaying out-of-stock products ensures that users and search engines alike have access to a full view of your inventory. This transparency can positively impact your search engine rankings.
Best Practices for SEO
- Use Structured Data: Implement schema markup to help search engines understand the status of your products. For example, use the Product schema type to mark products as out of stock.
- Optimize Meta Descriptions: Ensure that your meta descriptions include relevant keywords and convey that the product is out of stock. This helps maintain relevance in search results even when items are unavailable.
By following these best practices, you enhance the SEO performance of your site while providing clear and accurate information to users.
FAQs about Displaying Out of Stock Products in Magento 2
How can I automatically notify customers when products are back in stock?
You can use extensions like the aforementioned Mageplaza or Amasty to automate notifications. These tools allow customers to sign up for alerts and receive automatic emails when products are restocked.
Can I display out-of-stock products only to certain user groups?
Yes, Magento’s advanced catalog permissions allow you to set visibility rules based on user groups. You can configure these settings to show out-of-stock products to specific user groups while hiding them from others.
Additional Resources and Tools
For further information and tools related to managing out-of-stock products in Magento 2, consider exploring:
- Magento Documentation
- Magento Marketplace for Extensions
- Magento Developer Blog
These resources offer additional insights and tools to enhance your out-of-stock product management strategies.
Conclusion
By following this comprehensive guide on how to display out of stock products in Magento 2, you can effectively manage out-of-stock products in Magento 2, enhancing both user experience and SEO performance. Implementing these strategies will ensure that your e-commerce site remains informative and engaging, even when certain products are unavailable.