Search by

hryvinskyi / magento2-privacy-consent-gdpr-frontend

hryvinskyi

Shows the customer's privacy consents on the GDPR Privacy Settings page of the customer account.

Package info

github.com/hryvinskyi/magento2-privacy-consent-gdpr-frontend

Type:magento2-module

pkg:composer/hryvinskyi/magento2-privacy-consent-gdpr-frontend

Statistics

Installs: 1

Dependents: 0

Suggesters: 1

Stars: 0

Open Issues: 0

1.0.0 2026-11-30 18:52 UTC

This package is auto-updated.

Last update: 2026-11-30 20:09:28 UTC


README

The bridge between the consents page of the privacy consent suite and the Privacy Settings page of the data-subject rights suite. A store that installs both gets one privacy page in the customer account: the customer's requests and their consents, with the Withdraw buttons. The consent packages name nothing of the GDPR packages, and the GDPR packages name nothing of the consents; only this package knows both.

What it does for a store

  • The consents on the Privacy Settings page. The page of hryvinskyi/magento2-gdpr-frontend (gdpr/privacy) gets the customer's consents table after its own settings. It is the table of the consents page: each consent the store view shows with the customer's state, the version, form and date of the latest record, and a Withdraw button for an optional consent the customer gave. The button posts to the consents page's withdraw action, which returns the customer to the page they came from, so the customer lands back on Privacy Settings.
  • No second link while the Privacy Settings page is offered. The account navigation keeps the consents page's own Privacy Consents link for a customer whose store view does not offer Privacy Settings (the GDPR setting for that page is off for their account's store view), so such a customer never loses the way to their consents. For a customer who is offered Privacy Settings, the link is not printed.
  • Never cached. The consents block prints a signed-in customer's own states, so the page it sits on is kept out of the full-page cache.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.x with a Luma-based theme. The suite is built and tested on 2.4.9.
  • PHP 8.3 to 8.5, as the GDPR family.
  • hryvinskyi/magento2-privacy-consent-frontend ^1.0, hryvinskyi/magento2-gdpr-api ^1.0 and hryvinskyi/magento2-gdpr-frontend ^1.0.
  • The platform's Customer module.

Installation

Run from the Magento root. The privacy consent pack lists this package as a suggestion.

composer require hryvinskyi/magento2-privacy-consent-gdpr-frontend
bin/magento module:enable Hryvinskyi_PrivacyConsentApi Hryvinskyi_Clock Hryvinskyi_ClientAddress Hryvinskyi_PrivacyConsent Hryvinskyi_Base Hryvinskyi_HeadTagManager Hryvinskyi_ThemeAssets Hryvinskyi_PrivacyConsentFrontend Hryvinskyi_GdprApi Hryvinskyi_RateLimit Hryvinskyi_DocumentExport Hryvinskyi_Logger Hryvinskyi_Gdpr Hryvinskyi_GdprFrontend Hryvinskyi_PrivacyConsentGdprFrontend
bin/magento setup:upgrade
bin/magento setup:di:compile  # production mode only
bin/magento setup:static-content:deploy -f  # production mode only
bin/magento cache:flush

Verify on the storefront: sign in as a customer and open My Account > Privacy Settings. Below the page's own settings the Privacy Consents table lists the consents the store view shows, and the account navigation lists Privacy Settings and no Privacy Consents.

Configuration

None of its own. Whether a customer is offered Privacy Settings follows the GDPR package's setting hryvinskyi_gdpr/general/enabled, for the store view the customer's account belongs to (see the README of hryvinskyi/magento2-gdpr-frontend).

Limits

  • The page lists consents the store view shows. Records imported from an external journal name no consent, so they are not on this page; the admin journal, the customer's Consents tab and the GDPR export hold them.
  • A guest has neither page. A guest has no account to withdraw from; the store's privacy contact handles a guest's request.
  • A theme that replaces the privacy page's layout without the container content or the block gdpr.privacy.settings loses the consents table; the block is placed after that name.
  • The navigation link is swapped, never removed. The package changes the class of the block customer-account-navigation-privacy-consents-link; a package that renames or removes that block changes this behaviour.

Registrations

Where What
Layout gdpr_privacy_index Block privacyconsent.consents.gdpr in the container content, after gdpr.privacy.settings, not cacheable. It is a Magento\Framework\View\Element\Template with the template Hryvinskyi_PrivacyConsentFrontend::consents.phtml and the argument view_model = Hryvinskyi\PrivacyConsentFrontend\ViewModel\CustomerConsents.
Layout customer_account referenceBlock customer-account-navigation-privacy-consents-link with the class Hryvinskyi\PrivacyConsentGdprFrontend\Block\ConsentsLinkWithoutPrivacyPage, which prints nothing while Hryvinskyi\GdprApi\Api\CustomerPrivacyAvailabilityInterface::isAvailable() says the customer is offered the Privacy Settings page.

The package registers no route, table, command, cron job, event, plugin, preference or ACL resource.

Extension points

Another package puts the consents block on any account page the same way: copy the block definition into its own layout file (the class, the template, the view_model argument and cacheable="false"), rather than referring to this package's handle. The block is self-contained and needs no parent block. A package that wants to hide the consents page's navigation link for its own reason replaces the class of customer-account-navigation-privacy-consents-link, keeping the constructor of Magento\Customer\Block\Account\SortLink.

Tests

Run from the Magento root.

  • Integration: the platform's harness in dev/tests/integration, against its own database, one run at a time. cd dev/tests/integration && php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml ../../../app/code/Hryvinskyi/PrivacyConsentGdprFrontend/Test/Integration. The tests extend the base class of the consent frontend package's integration tests.
  • Static analysis: PHPStan 2.x at level 10 with the package's phpstan.neon.dist (phpstan analyse -c app/code/Hryvinskyi/PrivacyConsentGdprFrontend/phpstan.neon.dist --level=10), and vendor/bin/phpcs --standard=app/code/Hryvinskyi/PrivacyConsentGdprFrontend/phpcs.xml.dist app/code/Hryvinskyi/PrivacyConsentGdprFrontend.

Translations

The package prints no wording of its own: the consents table and the link carry the consent frontend package's translations.