https://github.com/sreichel/magento2-stackexchange_hideemptycategories
I was wondering if there was a may to have magento hide the category altogether if the products in the category have no stock.
https://github.com/sreichel/magento2-stackexchange_hideemptycategories
Last synced: about 1 month ago
JSON representation
I was wondering if there was a may to have magento hide the category altogether if the products in the category have no stock.
- Host: GitHub
- URL: https://github.com/sreichel/magento2-stackexchange_hideemptycategories
- Owner: sreichel
- License: gpl-3.0
- Created: 2021-11-28T16:55:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-28T17:43:00.000Z (over 3 years ago)
- Last Synced: 2025-03-30T07:23:18.350Z (2 months ago)
- Language: PHP
- Homepage: https://magento.stackexchange.com/questions/229481/how-to-hide-empty-categories-in-magento2
- Size: 14.6 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Magento2: Hide Empty Categories
[](https://packagist.org/packages/mse-sv3n/m2-hide-empty-categories)
[](https://packagist.org/packages/mse-sv3n/m2-hide-empty-categories)
[](https://packagist.org/packages/mse-sv3n/m2-hide-empty-categories)
[](https://packagist.org/packages/mse-sv3n/m2-hide-empty-categories)
[](https://packagist.org/packages/mse-sv3n/m2-hide-empty-categories)
[](https://www.paypal.me/sv3n1)> I'm in the final stages of setting up my magento 2 store. In the backend I have a process using the API to keep stock information up to date. Sometimes the stock drops to 0 for every item in a category, making it empty. If you go to one of those categories you get:
>
> `We can't find products matching the selection.`
>
> This makes sense, but I was wondering if there was a may to have magento hide the category altogether if the products in the category have no stock.**Source:** https://magento.stackexchange.com/questions/229481/how-to-hide-empty-categories-in-magento2
## Installation
```
composer require mse-sv3n/m2-hide-empty-categories
bin/magento setup:upgrade
```## Support
If you have any issues with this extension, open an issue on [GitHub](https://github.com/sreichel/magento2-StackExchange_HideEmptyCategories/issues).## Contribution
Any contribution is highly appreciated. The best way to contribute code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests).## License
[OSL - Open Software Licence 3.0](http://opensource.org/licenses/osl-3.0.php)