yireo / magento2-salesblock2
Block transactions based on various rules
Yireo SalesBlock2 for Magento 2
Prevent Magento 2 orders from being placed, based on specific rules.
Also see yireo.com/software/magento-extensions/salesblock2
Installation
To install this module, use composer:
composer require yireo/magento2-salesblock2
Afterwards, enable the module and run the setup upgrade, to make sure the database table is properly created:
bin/magento module:enable Yireo_SalesBlock2
bin/magento setup:upgrade
Next, install (and enable) one or more of the additional plugins. Without these plugins, the SalesBlock2 extension will not work:
- github.com/yireo/Yireo_SalesBlock2ByIp
- github.com/yireo/Yireo_SalesBlock2ByEmail
- github.com/yireo/Yireo_SalesBlock2ByGeo (also requires the PHP GeoIP module)
Usage
Navigate in the Magento Admin Panel to the Store Configuration to enable this module. Then, navigate in the Magento Admin Panel to Sales > Sales Block Rules to configure a rule. A rule consists of the following parts:
- Enable: Yes or no.
- Label: For managing things in your backend.
- Conditions: One or more conditions that all need to be met, before the rule is a match. The conditions are activated only through additional modules (see above). For instance, you could say that you are blocking sales for a person, coming from a certain IP range and using a specific email address.
- Frontend label: The message to display to the blocked customer on the frontend.
- Frontend text: An additional explanation to display to the blocked customer.
For additional details, see the READMEs of all submodules.
Current status
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[Unreleased]
[2.2.8] - 19 October 2026
Fixed
- Stop returning a value from command constructors
- Add
intreturn type to CLI commandexecute()methods for Symfony Console compatibility
[2.2.7] - 22 October 2025
Fixed
- Change virtual type ending with Logger to prevent DI debug message
- PHP 8.4 compat
- Fix issue with rule not found by any matcher
[2.2.6] - 14 August 2025
Fixed
- Better fix
[2.2.5] - 14 August 2025
Fixed
- PHP 8.4 compat
[2.2.4] - 11 April 2024
Fixed
- Removed helper
[2.2.3] - 11 April 2024
Fixed
- Bug when no rules are matched by any matcher
[2.2.2] - 9 April 2024
Fixed
- Compat psr/log with Magento 2.4.7
- Rename Match/ folder to RuleMatch/ for PHP 8.2 compat
[2.2.1] - 8 April 2028
- Failed release
[2.2.0] - 16 April 2022
Fixed
- PHP 8 compatibility (and therefore Magento 2.4.4)
[2.1.5] - 16 March 2022
Fixed
- Converted InstallSchema into DB schema XML
Removed
- Remove deprecated unit tests
[2.1.4] - 10 March 2022
Removed
- Removed unneeded module version
- Remove button dep with CMS module
[2.1.3] - 9 March 2022
Fixed
- Fix broken namespace
bd20f5d4773b621e93f13932581e6b2fc85fb677
[2.1.2] - 2 March 2022
Fixed
- Remove dep with SalesBlock2ByEmail module
[2.1.1] - 2 March 2022
Fixed
- Remove PHP dep from composer
- Add required utility to core package
[2.1.0] - 18 February 2021
Fixed
- Code compliance with Magento PHPCS
- Fixed issue with Guest Checkout email not being properly picked up
Added
- Added additional event observer to guarantee blocking of guest orders
- Debugging with
var/log/yireo_salesblock.logfile
[2.0.4] - 24 November 2020
Fixed
- Issue when checkout is accessed directly
- Removed deprecated observer
- Set items_count to 0 as well to force "no-items" in cart
[2.0.3] - 29 July 2020
Added
- Magento 2.4 compatibility
[2.0.2] - 15 July 2019
Added
config.xmlwith default settings- Handy methods in rule repository
- Strict typing in rule repository and interface
- Integration test for rule repository
- Integration test for rule helper with simulation of IP and email matching
[2.0.1] - 4 July 2019
Added
- Add KeepAChangeLog support
- Move configuration to separate Yireo section
[2.0.0] - November 2018
Added
- Magento 2.3 compatibility
- Major rewrite to decouple rules from main module
[1.0.1] - August 2018
Added
- Create separate Configuration class instead of using Helper
- Add message in grid when module is disabled through setting
[1.0.0] - August 2018
Added
- Public release
- Composer support
[0.0.3] - June 2019
Added
- Beta testing on limited sites
- Improved exception handling
[0.0.2] - November 2017
Added
- Main migration of functionality
- Setup UiComponents
- Basic Integration Tests
[0.0.1] - September 2017
Added
- First draft
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 2.2.9 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-10-19 07:59:02 |
| 2.2.8 | stable | Not tested | Not yet tested Details | 2026-10-19 07:25:53 |
| 2.2.7 | stable | Fail | Magento 2.4.7-2.4.8 Details | 2025-10-22 11:21:22 |
| 2.2.6 | stable | Not tested | Not yet tested Details | 2025-08-14 10:28:56 |
| 2.2.5 | stable | Not tested | Not yet tested Details | 2025-08-14 10:21:36 |
| 2.2.4 | stable | Not tested | Not yet tested Details | 2024-04-11 10:11:32 |
| 2.2.3 | stable | Not tested | Not yet tested Details | 2024-04-11 09:53:18 |
| 2.2.2 | stable | Not tested | Not yet tested Details | 2024-04-09 13:56:26 |
| 2.2.1 | stable | Not tested | Not yet tested Details | 2024-04-08 10:10:04 |
| 2.2.0 | stable | Not tested | Not yet tested Details | 2022-04-16 13:16:57 |
| 2.1.5 | stable | Not tested | Not yet tested Details | 2022-03-16 12:38:05 |
| 2.1.4 | stable | Not tested | Not yet tested Details | 2022-03-10 18:27:19 |
| 2.1.3 | stable | Not tested | Not yet tested Details | 2022-03-09 16:09:18 |
| 2.1.2 | stable | Not tested | Not yet tested Details | 2022-03-02 08:53:21 |
| 2.1.1 | stable | Not tested | Not yet tested Details | 2022-03-02 08:50:52 |
| 2.1.0 | stable | Not tested | Not yet tested Details | 2022-03-02 08:40:02 |
| 2.0.4 | stable | Not tested | Not yet tested Details | 2020-11-24 13:34:57 |
| 2.0.3 | stable | Not tested | Not yet tested Details | 2020-07-29 09:33:34 |
| 2.0.2 | stable | Not tested | Not yet tested Details | 2019-07-15 18:32:13 |
| 2.0.1 | stable | Not tested | Not yet tested Details | 2019-07-08 11:45:23 |
| 2.0.0 | stable | Not tested | Not yet tested Details | 2018-11-29 20:32:06 |
| 1.0.0 | stable | Not tested | Not yet tested Details | 2018-08-22 07:23:50 |
Requires 16
| Package | Constraint |
|---|---|
| ext-json | * |
| ext-pcre | * |
| magento/framework | ^101.0|^102.0|^103.0 |
| magento/module-backend | ^100.0|^101.0|^102.0 |
| magento/module-catalog | ^104.0 |
| magento/module-checkout | ^100.0 |
| magento/module-cms | ^100.0|^101.0|^102.0|^103.0|^104.0 |
| magento/module-config | ^101.2 |
| magento/module-customer | ^103.0 |
| magento/module-quote | ^100.1|^101.0|^102.0 |
| magento/module-sales | ^103.0 |
| magento/module-store | ^100.1|^101.0 |
| magento/module-ui | ^101.2 |
| php | >=8.2 <8.6 |
| psr/log | ^1 || ^2 || ^3 |
| symfony/console | ^5.0 | ^6.0 | ^7.0 |
Requires-dev 2
| Package | Constraint |
|---|---|
| phpunit/phpunit | ^10.0 |
| yireo/magento2-integration-test-helper | ~0.0 |
Suggests 3
| Package | Reason |
|---|---|
| yireo/magento2-salesblock2-by-email | * |
| yireo/magento2-salesblock2-by-geo | * |
| yireo/magento2-salesblock2-by-ip | * |
No QA results yet
QA pipelines haven't run for this version. Compatibility and quality results appear here once the vendor publishes a tagged release that gets ingested.
More from yireo
View vendorReplace bundled third party packages from Magento
N/A
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.