``nordcomputer/module-stockfilter``
Enabels filtering by stock status
* = in production please use the --keep-generated
option
- Unzip the zip file in
app/code/Nordcomputer
and rename the directory toStockfilter
- Enable the module by running
php bin/magento module:enable Nordcomputer_Stockfilter
- Apply database updates by running
php bin/magento setup:upgrade
* - Flush the cache by running
php bin/magento cache:flush
- Add the composer repository to the configuration by running
composer config repositories.nordcomputer/module-stockfilter git "[email protected]:nordcomputer/magento2-stockfilter.git"
- Install the module composer by running
composer require nordcomputer/module-stockfilter
- enable the module by running
php bin/magento module:enable Nordcomputer_Stockfilter
- apply database updates by running
php bin/magento setup:upgrade
* - Flush the cache by running
php bin/magento cache:flush
- Since this extension does not set the attribute for existing products (the value stays empty after installation), you need to set the attribute to
Yes
for every simple product (you can do so by mass-action). - Also every new created product needs to be set to
Yes
(Default value) for at least one time, otherwise, the attribute for that specific product does not get created.
Once the attribute was set to Yes
at least one time, the cronjob does his thing and sets the value automatically with every run.
You can find the configuration for this extension in Stores -> Configuration -> Catalog -> Inventory -> Stock Filter Cronjob Configuration
The Cronjob iterates over all simple products and sets the newly created attribute "filter-stock" according to the stock status of the product.
As this extension creates an attribute, the attribute needs to be removed when the extension get uninstalled.
You can uninstall this extension by running 'bin/magento module:uninstall Nordcomputer_Stockfilter --remove-data'
-
delete the
Stockfilter
directory in/app/code/Nordcomputer
-
delete
filter_stock
from theeav_attribute
table in your database -
run following commands:
bin/magento setup:di:compile bin/magento setup:static-content:deploy -f bin/magento indexer:reindex bin/magento c:f