infrangible / m2-catalog-login-required
Restricts selected categories and products to logged-in customers: guests are sent to the login page and such products are hidden from their product lists and search results.
Package info
github.com/infrangible-dev/m2-catalog-login-required
Type:magento2-module
pkg:composer/infrangible/m2-catalog-login-required
Requires
- php: >=8.1
- fewedev/base: ~2.4.3
- infrangible/m2-core: ~5.0.7
- infrangible/m2-foundation: ~3.0.2
- magento/framework: ~103.0.6
- magento/module-advanced-search: ~100.4.0
- magento/module-catalog: ~104.0.0
- magento/module-catalog-search: ~102.0.0
- magento/module-customer: ~103.0.0
- magento/module-eav: ~102.1.0
- magento/module-store: ~101.1.0
Requires (Dev)
- infrangible/phpstan-magento: ~1.2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Restricts selected categories and products to logged-in customers: guests who open them are sent to the login page and return to the page after logging in, and products that require a login are hidden from guests in product lists and search results.
Settings
- Login Required on categories (section "General" of the category form) and on products, per store view.
There are no store settings.
Behavior
- Guests who open a category or product with "Login Required" are redirected to the login page before the page is rendered; after logging in, they return to the page.
- Products with "Login Required" are hidden from guests in the product lists of categories, in search results and in
the counts of the layered navigation. Hiding them uses the catalog search index, so run
bin/magento indexer:reindex catalogsearch_fulltextafter installing the module. - Categories with "Login Required" are still shown in the navigation.
Requirements
- Magento Open Source or Adobe Commerce 2.4.6 or newer
- PHP 8.1 or newer
Installation
composer require infrangible/m2-catalog-login-required bin/magento module:enable Infrangible_CatalogLoginRequired bin/magento setup:upgrade bin/magento indexer:reindex catalogsearch_fulltext
In production mode, also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy.
License
Infrangible Catalog Login Required is licensed under the MIT License - see the LICENSE file for details.