How to add out-of-stock swatches to Magento 2?

An important part of store management is product availability control. How to make a person return to the store after seeing that product is out of stock? This article will help you learn how showing out-of-stock swatches in Magento 2 can help you to drive more sales and force the visitor to make a purchase decision.

Setting up the swatches

There are several methods for setting up swatches in Magento 2, that you can read about. But there is a way to make it faster and more convenient - install Magento 2 Color Swatches Pro extension.

This extension allows you to customize out-of-stock swatches right in the extension settings, simplifies your user experience, and allows you to solve the Magento 2 configurable product options not showing issues. 

Color Swatches extension provides the ability to select a big amount of different possibilities, such as: 

  1. Allowing customers to copy and share URLs with selected product configurations.
  2. Enabling the feature to display relevant product options' swatches.
  3. Allowing your customers see changes right on the product image when they hover over the product options' swatches. 

The client forms his opinion about the product based on its visual assessment. Therefore, this extension can be a key factor in the success of your store, providing a wide range of functions and settings that allow to make the store more user-friendly.

How to set up out of stock swatches in this Magento 2 extension: advice from Amasty?

1) To get the access to the Color Swatches Pro settings please go to: Stores → Configuration → Color Swatches Pro.

2) Find the Show Out of Stock Configurable Attributes setting.

3) a) set 'No' and Magento hides a simple option when all combinations of this option are out of stock, e.g. 'Red' option when all 'Size' combinations for 'Red' are out of stock.

  1. b) Choose 'Yes' to show configurable attributes which are out of stock. 'Yes' - option works only if Stores - Catalog - Inventory - Stock Options: Display Out of Stock Products = Yes.

4) Do not forget to clear the cache and check the display of the plugins on the frontend.

What is more, this module is compatible with the One Step Checkout extension. These two modules are synergistic with each other. The buyer will have the opportunity to view and check the selected parameters on the cart and checkout page.

Why do you need to show out-of-stock swatches in your Magento 2 store?

?agento 2 show out of stock swatches feature is used to mark an out-of-stock item as a crossed-out swatch. It is more convenient for users to make purchases as they are aware of needed product details and it makes your store user-friendly as users can subscribe to a notification letter to get info on when the product will be available.

How can I display swatches in the product list in Magento 2?

To display swatches in the product list in Magento 2, you can follow these steps:

  1. Navigate to the Magento admin panel and go to Stores > Attributes > Product.
  2. Select the attribute that you want to display as a swatch in the product list.
  3. Scroll down to the "Storefront Properties" section and set "Used in Product Listing" to "Yes".
  4. Save the attribute and go to the product grid in the Magento admin panel.
  5. Select the products that you want to assign the attribute to and click "Actions" > "Update Attributes".
  6. Select the attribute from the list and set its value for the selected products.
  7. Save the changes and refresh the frontend of your Magento store.
  8. You should now see the swatch displayed in the product list for the products that have the attribute assigned.

By following these steps, you can easily display swatches in the product list in Magento 2, which can help improve the shopping experience for your customers and increase sales.

How can we help you?

Didn’t you find the answer to your question? We are always happy to help you out.