User Manual - Custom Stock Status
- Installing Custom Stock Status for Magento 2
- Set up cron
- Introducing Custom Stock Status for Magento 2
- Supported product types
- Extension configuration
- Rule Management
- Notification Requests
- Demand for Out of Stock Items
- Frontend View
Magento 2 Custom Stock Status is a tool for alerting customers on low stock alerts within your store and conducting customer behavior by pushing them to purchase.
Compatibility: Magento Open Source 2.3.X - 2.4.X, Magento Commerce 2.3.X. - 2.4.X
Installing Custom Stock Status for Magento 2
Command Line Installation
- Backup your web directory and store database
- Download the Custom Stock Status installation package
- Upload the contents of the Custom Stock Status installation package to your store root directory
- In the SSH console of your server, navigate to your store root folder:
run the following command:
php -f bin/magento module:enable Aheadworks_CustomStockStatus
php -f bin/magento setup:upgrade
php -f bin/magento setup:static-content:deploy
5. Flush the store cache; log out from the backend and log in again
Make sure the installation is done from the FTP administrator account. Otherwise, set 775 permissions to the store root directory after the extension is deployed.
If you are installing an extension from Aheadworks for the first time, you need to add our composer repository to your Magento store:
1. Login to your ssh console and navigate to your store folder:
Run the following command:
composer config repositories.aheadworks composer https://dist.aheadworks.com/
On successful execution of the command you will be able to use the composer to install the extensions.
To install the extension:
2. Login to your ssh console and navigate to your store folder:
3. Run the following command to install the latest version of the extension:
composer require aheadworks/module-customstockstatus
if you need to install a specific version, run this command:
composer require aheadworks/module-customstockstatus:<version>
Specify the version of the extension in <version>
When prompted, enter Public Key (Username) and Private Key (Password):
Both Public Key (Username) and Private Key (Password) can be found in My Projects and Licenses in your personal account on our site:
4. Enable the extension:
php -f bin/magento module:enable <Module_Name>
Add the product name in <Module_Name>
Next, register the extension:
Recompile your Magento store if you are in the Production mode:
To verify that the extension is enabled, run this command:
Clean store cache, by running the following command:
Log out and Log in the backend again.
To upgrade the extension:
5. To update or upgrade an extension:
Download the updated extension file. Take note of the module-name and version. Export the contents to your Magento root.
If a composer package exists for the extension, run one of the following.
Update per module name:
composer update aheadworks/module-customstockstatus
Updater per version:
composer require aheadworks/module-customstockstatus:<version>
Run the following commands to upgrade, deploy, and clean the cache.
php bin/magento setup:upgrade --keep-generated
Set up cron
The Get Product Status extension uses cron for automatic stock staus updates.
If you have already configured cron jobs for your Magento installation, then you can skip this step. Read the following instructions on setting cron job for your Magento store: Magento user guide.
Generally, it will be enough to run in the SSH console of your server the following command:
And insert the following line:
*/3 * * * * php -c <ini-file-path> <your Magento install dir>/bin/magento cron:run
Don't forget to confirm saving request when exit.
Introducing Custom Stock Status for Magento 2
The Get Product Status extension for Magento 2 presents a customizable block for a stock status display based on specific conditions. With the extension you
- Display stock statuses on category and product pages, and in a shopping cart;
- Indicate product quantity and quantity ranges as triggers for rule application;
- Use icons, images, and text for a stock status block;
- Allow customers to subscribe to back-in-stock notifications;
- Select templates for back-in-stock and low-stock alerts.
Supported product types
- Simple: the status is displayed on the catalog and product page
- Configurable: the status is displayed on the catalog and product page when a customer has configured a product (e.g. a certain child product was selected)
- Grouped: not supported, i.e. the status on the product page is not displayed. However, the stock status will be displayed on the cart page because children are considered as separate products;
- Bundle: not supported.
- Downloadable/virtual / Gift Card with quantity: The status is displayed on the cart page or in mini cart, because these are the only places where the quantity of items of these product types can be edited;
To start working with Magento 2 Custom Stock Status configure the basics of the extension. Follow Stores > Configuration > Aheadworks extensions > Custom Stock Status.
Stock Status Block Settings
First of all, decide whether the Custom Stock Status will be displayed along with the default Stock Status. Enable the option if you need both the stock statuses to cover for each other in case of some issues occurred
The 'Display mode' field defines the options for stock status block customization while creating a rule.
- 'Text and Icon' allows using icons next to the block.
- 'Text and image' adds a field for image inserting.
Display settings help to select where to show custom stock status besides a product page. The 'Category Page' and 'Shopping Cart' options are available for adding.
The 'Notification Settings' section contains low stock alert & back-in-stock notification configuration.
The notification sender email is specified in a corresponding field.
Low Stock Alert Quantity is the number of products left in stock that triggers low stock alert sending.
Templates for both back-in-stock and low stock alert emails can be selected here in the section.
All the rules related to custom stock statuses application can be found on the following path: Catalog > Custom Stock Statuses.
You can perform individual actions, such as enabling, disabling, or deleting, to the rules or manage them massively in a single grid.
From this page you can move to a particular rule page or create a new one by clicking 'Add New Rule' button.
General Settings for custom stock status rules are pretty much standard.
- Start with naming the rule for your comfortable use.
- Decide whether the rule is enabled or not for the moment..
- Specify rule priority to apply the rule accordingly in relation to other similar rules.
- Select a store view where the rule will be active.
Product conditions specify the products to which the rule will be bound to.
Stock status display options are based on a specified product quantity.
It's possible to set up a few options to the same product if there's a difference in item quantity.
- Product quantity field allows setting up the display mode based on several parameters:
- less than - the current display mode will be applied if the product quantity is less than a particular number;
- greater than - the current display mode will be applied if the product quantity is greater than a particular number;
- equals or less than - the current display mode will be applied if the stock item quantity matches the number inserted in the field or is less than the number;
- equals or greater than - the current display mode will be applied if the stock item quantity matches the number inserted in the field or is less than the number;
- range - the current display mode will be applied if the stock item quantity is within a particular number range you specify in the fields 'from' & 'to'.
- 'Custom Stock Status Text' is a field for adding a text message on stock status.
- 'Upload image/icon' are boxes for visualizing stock status. They can be added via the drag-and-drop functionality or the standard upload window.
Icon and image display is closely related to the 'Display Mode' setting in the extension configuration section. If you choose 'text & icon' mode no image will be shown. If you settle on the 'text & image' option the icon display will become unavailable.
The extension allows customers to submit requests for notifications when products of their interest return to stock. Magento 2 Custom Stock Status automates the process of sending back-in-stock alerts you just need to specify the sender and the template for such emails.
All the notification request you can view in Catalog > Notification Requests with the info on a relevant product, customer name and email address, and status of the request to know what actions can be done to satisfy all the customers' needs.
Demand for Out of Stock Items
The grid with customer subscriptions to out of stock products can be found on the following path: Catalog > Demand for Out of Stock Items. The info presented here helps to analyze customer demand by highlighting the number of subscriptions and plan re-supplying according to the data when the product went out of stock.
Custom Stock Status can be displayed on both category and product pages, and in the shopping cart. If specified in the backend settings the notification button is shown along with the particular status.
Category Page Display
Product Page Display
Shopping Cart Display
Notification Request Box
The notification request box appears upon clicking the 'Email Me When Back In Stock' button.