How can I set the subscription block to be shown based on product quantity?

How can I set the subscription block to be shown based on product quantity?

Starting with version 1.20.0 it is possible to subscribe to stock notifications based on product quantity instead of stock status. The feature works with backorder and pre-order products, including those managed by Amasty Pre Order. You need to install the 'amasty/module-xnotif-stock-availability-mode' package from composer suggest to use this functionality (the functionality is available as a part of an active product subscription or support subscription). 

Once installed, you can find the 'Check Stock Availability Based On' setting in the module configuration (Amasty > Out of Stock Notifications > Configuration > Stock Subscription)



This setting does not affect the display of the Add to Cart button. It only controls the display of the subscription block from the module.

If Check Stock Availability Based On is set to Stock Status, the module works as it does now. The product stock is determined by the stock status: In Stock or Out of Stock. The subscription block is displayed only for products with the Out of Stock status.
- If Check Stock Availability Based On is set to Quantity, the module checks the product stock as follows.
     When Magento Inventory modules are disabled the product is considered in stock if: Qty > Minimum Stock QuantityThe product is considered out of stock if: Qty < Minimum Stock Quantity.
     When Magento Inventory modules are enabled the product is considered in stock if: Salable Quantity > 0. The product is considered out of stock if: Salable Quantity < 0. 




      • Related Articles

      • How to apply statuses only to products with specific quantity?

        The module works with the Magento product attributes as a basis for forming the product collection that receives a custom stock status. In Magento, quantity is a system attribute that cannot be used in rules' conditions. Due to this, setting a status ...
      • Is it possible to hide the out of stock subscription block for specific products?

        Yes, there's an option to hide the stock alert block for particular products. To achieve that, follow the steps below. Step 1. Navigate to Catalog → Products. Step 2. Pick the product you wish to hide the Stock Alert block for and open its ...
      • How to import stock?

        Inventory import depends on the number of sources/stocks that are created on Magento instance in Stores > Inventory > Stocks & Stores > Inventory > Sources. Case 1. Import to the instance with only one stock and source. Please use the following ...
      • How to Apply Customer Group Catalog Rules to Out-of-Stock Products?

        Out-of-the-box, the Customer Group Catalog module allows enabling rules to cover out-of-stock products. To explicitly include out-of-stock items in your customer group catalog rules, use either of these options: Option 1: Use the Apply to Out of ...
      • Custom Stock Status API

        We have created a public API collection for Custom Stock Status module with all available queries and sample data that you can both test via our demo endpoints and copy to run local tests in your Magento environment. More details about using public ...