User Tools

Site Tools



For more details see the Custom Stock Status extension page.

Custom Stock Status Magento 2

The extension allows you to inform your shoppers about the current stock statuses of your products. You can use variables and quantity ranges, making clear and catchy statuses to engage your customers.

  • Create multiple custom stock statuses
  • Add statuses to products automatically or manually
  • Show out of stock options of configurable items
  • Upload special icons for stock statuses
  • Display quantity based stock statuses

Add Custom Stock Status

To create new or edit the existing custom stock statuses, go to Admin Panel → Stores → Attributes → Products:

  • Select custom_stock_status attribute;
  • Navigate to the Properties tab → Manage Options (values of your attribute) section;
  • Create the necessary options for the custom stock attribute.
  • To display current product quantity in particular stock status, use {qty} variable, for example: Hurry up! Only {qty} left in stock!
  • Use {qty_threshold} variable to display the product quantity minus stock threshold (the number which triggers the out-of-stock status of a product).
Note that you can use any product attribute as a variable to provide a necessary message in a custom stock status. For instance, use {special_price} to inform customers about upcoming discounts.

Upload icons for Custom Stock Status

To upload the icons for statuses:

  • Select custom_stock_status;
  • Switch to Manage Icons tab.
  • Choose icons for custom stock statuses.
  • Remember to save the attribute, otherwise icons won’t be uploaded.

For more information, check our blog article with the Custom Stock Status extension's overview.

Rules for quantity ranges

To specify the quantity rules, go to Stores → Attributes → Product and select the attribute custom_stock_status_qty_rule.

In the Properties tab, in the Manage Options (values of your attribute) section, create one rule for each product group, for which you will use different levels of stock. E.g. first_rule for shirts and second_rule for phones.

Once you create the rules, go to Quantity Range Statuses and specify ranges for each of these rules.

To enable the stock status rules' column in the settings, go to Admin Panel > Stores > Configuration > Custom Stock Status and set to Yes the Activate rules for Quantity Range Status field.
Manage Quantity Ranges
  • If you would like the statuses to be updated automatically, based on how many items of a product are left in the inventory, please create quantity ranges and assign the necessary statuses to the ranges.
  • If you choose to use range based stock statuses when editing a product, the stock status will change automatically once the product quantity changes.
  • You can also use Stock Status Rule column. With its help, you can specify different quantity levels for the same statuses for different groups of products. E.g. you can show the same status Running out for Product A, when it has quantity from 1 to 5; for Product B, when it has quantity from 1 to 100.

Use backorder rules to automatically assign particular stock statuses to the products.

Apply quantity-based statuses

Go to Admin Panel → Products → Catalog. Select a product.

Custom Stock Status - select the appropriate status for the product at the General tab.

Custom Stock Status Qty Rule - select which quantity rule should apply to this product.

Custom Stock Status Settings


Go to Stores → Configuration → Amasty Extensions → Custom Stock Status, to specify general extension settings.

Display Custom Stock Status for `Out of Stock` Items Only - It is possible to display custom stock statuses only for out of stock products.

Display Default Stock Status with Custom Status -

  • Set to Yes - To display default stock status (in stock\out of stock) next to a custom stock status.
  • Set to No - Not to display default stock status - only custom stock status.

Use Quantity Ranges Based Statuses Only - If you would like to use only automatic, range based statuses, set this option to Yes.

Display Icon Only (No Status Text) - To display only icons for stock statuses (without text), set this option to Yes.

Change Default Configurable Product Status - It’s possible to change product statuses for configurable products.

Display Settings

Choose whether to show custom stock statuses on:

  • Product list page;
  • Shopping cart;
  • Order Confirmation Email.

To place a link in a custom stock status, go to Admin Panel → Stores → Configuration → Custom Stock Status → Info link.

Show Info Link - To enable the feature, set to Yes. A link will be displayed below the Custom Stock Status.

Info Link Text - Input an anchor text that will be displayed below a custom stock status.

CMS Page - Select a desired CMS page to direct customers to. A drop-down contains all the CMS pages, that you have in the web store.

Info link on the frontend:

Expected Date

The Expected Date section allows you to display the date on product pages when a product will back in stock.

Use Expected Date — switch this option to Yes to enable the expected date functionality;

Expected Date Format — choose the expected date format;

Hide Expired Expected Dates — enable this option to hide the expected dates when they expire.

When the expected date functionality is enabled, the new corresponding attribute is created. Also, the attribute will be automatically added to products.

‘Text field’ and ‘Date’ attributes in statuses

You can use any Text field and Date product attributes in custom stock statuses. To do this, add code of the attribute to the status like this:

Back in stock on {eta}

On front end, the code will be replaced with the attribute value for this product.

Frontend Samples

Custom stock status on product pages.
Custom stock status for configurable products.
Custom stock status on the shopping cart page.
Custom stock status on category page.

Rate the user guide
 stars  from 1 votes (Details)
magento_2/custom_stock_status.txt · Last modified: 2018/08/07 11:09 by milosh