sbodak / magento2-b2b-disable-add-to-cart-button-for-guest
This extension allows you to disable Add to cart button for guest. Useful feature for B2B store.
Package info
github.com/sbodak/magento2-b2b-disable-add-to-cart-button-for-guest
Type:magento2-module
pkg:composer/sbodak/magento2-b2b-disable-add-to-cart-button-for-guest
2.0.0
2026-04-18 21:03 UTC
Requires
- php: ~7.0|~7.1|~7.2|~7.3|~7.4|~8.0|~8.1|~8.2|~8.3|~8.4
- magento/framework: >=103.0.0
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is not auto-updated.
Last update: 2026-04-18 21:59:51 UTC
README
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
- Go to the Magento admin interface.
- Navigate to Stores > Configuration > Catalog > Catalog.
- Under the Storefront tab find the Disable Add to cart button for Guests option.
- Set it to Yes to activate the plugin.
Module configuration — administration panel
Removed Add to Cart button in catalog — frontend view
Removed Add to Cart button on product page — frontend view
Running tests
composer install vendor/bin/phpunit
Uninstall
composer remove sbodak/magento2-b2b-disable-add-to-cart-button-for-guest
Changelog
See CHANGELOG.md.


