User Manual - Custom Stock Status
- Installing Custom Stock Status for Magento 2
- Set up cron
- Uninstalling Custom Stock Status
- Compatibility
- 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.
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:
cd path_to_the_store_root_folder |
run the following command:
php bin/magento module:enable Aheadworks_CustomStockStatus |
then:
php bin/magento setup:upgrade |
after:
php bin/magento setup:static-content:deploy -f |
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. |
Composer Installation
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:
cd path_to_the_store_root_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:
cd path_to_the_store_root_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:
bin/magento setup:upgrade |
Recompile your Magento store if you are in the Production mode:
bin/magento setup:di:compile |
To verify that the extension is enabled, run this command:
bin/magento module:status |
Clean store cache, by running the following command:
bin/magento cache:clean |
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:
crontab -e |
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.
Uninstalling Custom Stock Status
Since Magento introduced declarative Database you need to be very carefull when uninstalling or disabling the module.
NOTE: Please be very careful when uninstalling/disabling this module. This module uses a declarative DB scheme. Once the module is uninstalled the DB tables will be lost. |
Manual Removal
1) Run command:
bin/magento module:uninstall --non-composer Aheadworks_CustomStockStatus
|
It will remove hide price attributes from the system (e.g. eav_entity_type table).
2) Disable extension:
bin/magento module:disable Aheadworks_CustomStockStatus
|
3) Run setup upgrade:
bin/magento setup:upgrade
|
It will remove module related tables from the system (hp_rule_entity, hp_rule_product, etc).
4) Remove module files manually:
app/code/Aheadworks/CustomStockStatus
|
Automatic Removal (via Composer)
1) Disable extension:
bin/magento module:disable Aheadworks_CustomStockStatus
|
2) Run setup upgrade:
bin/magento setup:upgrade
|
3)
php bin/magento module:uninstall Aheadworks_CustomStockStatus
|
Compatibility
Module Version |
Magento Version |
PHP |
1.0.5 and earlier versions |
2.3.Х - 2.3.6 2.4.0 - 2.4.3 |
7.4 and earlier versions |
As of version 1.0.6 |
2.3.7-p3+ 2.4.0 - 2.4.4 |
7.4, 8.1 |
As of version 1.0.7 |
2.4.0 - 2.4.5 |
7.4, 8.1 |
As of version 1.0.8 |
2.4.4- 2.4.6 |
8.1 |
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;
Extension configuration
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.
Notification Settings
The 'Notification Settings' section contains low stock alert & back-in-stock notification configuration.
The notification sender email is specified in a corresponding field.
If the back-in-stock subscription is enabled customers will see a related button next to an out-of-stock product. The notification request pop-up appears upon clicking the button. If you want to display your store Private Policy link in the pop-up choose the relevant option. Also, it is p[ossible to specify the destination of the link in the 'Privacy Policy CMS Page' 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.
Rule Management
Rule Grid
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
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
Product conditions specify the products to which the rule will be bound to.
Display Options
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. |
Multi-stock inventory supportThe custom stock status displayed on each website is determined by aggregating the quantities of items from various sources. For example: Website 1: Source 1 (quantity: 10) Website 2: Source 3 (quantity: 100) On Website 1, the stock status shows a total of 30 items from its different sources combined. Likewise, Website 2's stock status reflects a total of 300 items gathered from its various sources. This calculation makes sure that each website's stock status shows the total availability considering items from different places. |
Notification Requests
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.
Frontend View
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.
The 'Email Me When Back in Stock' button is available when 'Display Out of Stock Products' is set to 'Yes' (for configurable products only). To enable the 'Display Out of Stock Products' option, go to the Stores > Configuration > Catalog > Inventory > Stock Options from the backend.
The compounds are the name and email fields and the Privacy Policy checkbox. Only the email entry is required to be filled to send a notification request successfully.
Already used our product?
We would appreciate your feedback. Please, leave a review.