elgentos / magento2-consentmode-v2
elgentos/magento2-consentmode-v2
Consent Mode V2 magento extension for the Hyva theme
magento2-consentmode-v2
This extension is based on the Hyva default cookie bar. All features that are in that extension are in this one.
This extension:
- removes the default Hyva cookie bar
- sets default consentMode
gtag('consent', 'default', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'functionality_storage': 'denied', 'personalization_storage': 'denied', 'security_storage': 'denied', });
- This fires the GTM build in trigger like this:
[image: build-in-trigger.png]
- shows banner when consentMode is not set in localstorage or isUserAllowedSaveCookieName (default magento cookie) is null
[image: banner.png]
- You can click 3 buttons
- Deny: routes you to the noCookies url you can set in the backend
- Customize: set the cookies you selected above
- Allow All: All cookies are allowed (all checkmarks are set)
Logic behind this:
{
'functionality_storage': consent.necessary ? 'granted' : 'denied',
'security_storage': consent.necessary ? 'granted' : 'denied',
'personalization_storage': consent.preferences ? 'granted' : 'denied',
'analytics_storage': consent.statistics ? 'granted' : 'denied',
'ad_storage': consent.marketing ? 'granted' : 'denied',
'ad_user_data': consent.marketing ? 'granted' : 'denied',
'ad_personalization': consent.marketing ? 'granted' : 'denied',
};
- When gtag consent default is set, an event is fired in GTM called:
defaultWhen the settings are changed, theupdateevent is fired.
As you can see in this example:
[image: consent-example.png]
- It adds a button on the absolute bottom of the page so you can always open the cookie settings (this is intentionally not fixed on the viewport)
Would be nice to have multiple events on multiple levels of consent you can add in GTM.
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 1.0.6 | stable | Fail | Not compatible Details | 2024-07-11 11:17:28 |
| 1.0.5 | stable | Not tested | Not yet tested Details | 2024-07-10 10:24:03 |
| 1.0.4 | stable | Not tested | Not yet tested Details | 2024-07-09 09:58:34 |
| 1.0.3 | stable | Not tested | Not yet tested Details | 2024-06-18 08:30:59 |
| 1.0.2 | stable | Not tested | Not yet tested Details | 2024-06-17 12:52:01 |
| 1.0.1 | stable | Not tested | Not yet tested Details | 2024-06-05 09:59:32 |
| 1.0.0 | stable | Not tested | Not yet tested Details | 2024-06-04 12:11:43 |
Requires 4
| Package | Constraint |
|---|---|
| php | >=8.1.0 |
| magento/framework | ^103.0 |
| magento/module-cookie | ^100.4 |
| magento/module-store | ^101.1 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from elgentos
View vendorLink existing guest orders to newly created or existing customer based on e-mail address
Allows customers to enter a secondary email address to login with
Hide Mollie payment methods based on category
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.