The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
🏆 Leaderboard
Actively Maintained v2.0.0

Disable Add to Cart for Guests

sbodak/magento2-b2b-disable-add-to-cart-button-for-guest

Hides the Add to Cart button on product and category pages for non-logged-in visitors, useful for B2B stores that require login before purchasing. Toggleable from the catalog storefront configuration.

5,502
Downloads
Below average
20
GitHub Stars
Below average
2mo ago
Last Release
0
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
5 warnings
PHPStan Level 9

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v2.0.0 on Magento 2.4.9
Jun 1, 2026

Share This Module's Status

Disable Add to Cart for Guests Magento compatibility status badge

README

Loaded from GitHub

Magento 2 - Disable add to cart button for guest

Overview

This module enables the possibility to disable the Add to Cart button on product and category pages for customers who are not logged in. It is useful for B2B stores where guest users should not be able to add products to the cart.

Compatibility

Module version Magento version PHP version
2.0.x 2.4.6 – 2.4.8 7.0 – 8.4
1.0.x 2.1 – 2.3 7.0 – 7.2

Installation

composer require sbodak/magento2-b2b-disable-add-to-cart-button-for-guest
php bin/magento module:enable Bodak_DisableAddToCart
php bin/magento setup:upgrade
php bin/magento cache:clean

Configuration

  1. Go to the Magento admin interface.
  2. Navigate to Stores > Configuration > Catalog > Catalog.
  3. Under the Storefront tab find the Disable Add to cart button for Guests option.
  4. Set it to Yes to activate the plugin.

Module configuration — administration panel

Module configuration - administration panel

Removed Add to Cart button in catalog — frontend view

Remove Add to Cart button in catalog

Removed Add to Cart button on product page — frontend view

Remove Add to Cart button on product page

Running tests

composer install
vendor/bin/phpunit

Uninstall

composer remove sbodak/magento2-b2b-disable-add-to-cart-button-for-guest

Changelog

See CHANGELOG.md.

License

MIT License

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.