{"id":28509,"date":"2025-06-24T10:14:49","date_gmt":"2025-06-24T14:14:49","guid":{"rendered":"https:\/\/plumrocket.com\/docs\/?p=28509"},"modified":"2025-06-24T10:14:51","modified_gmt":"2025-06-24T14:14:51","slug":"how-to-add-consent-checkboxes-manually-5","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-gdpr-pro\/v1\/devguide\/add-checkboxes-manually","title":{"rendered":"How to Add Consent Checkboxes Manually"},"content":{"rendered":"\n<p>In this guide, you can learn how to manually place checkboxes in the needed location of the page with the help of the Data Privacy module, which is a part of <a href=\"\/magento-gdpr\">Magento 2 GDPR<\/a>, <a href=\"\/magento-ccpa\">CCPA<\/a>, and <a href=\"\/magento-lgpd\">LGPD<\/a> extensions.<\/p>\n\n\n\n<p>There are default locations that you can view in the Magento admin panel -&gt;Plumrocket -&gt; Data Privacy -&gt; <a href=\"\/docs\/magento-data-privacy\/v3\/configuration#consent-locations\">Consent Locations<\/a>. At the moment, 4 Magento checkbox locations are available: registration, checkout, newsletter subscription forms, and contact us form. <\/p>\n\n\n\n<p>Additionally, the locations can be added by other Plumrocket extensions, or you can create your custom ones. Please follow this guide to learn how to create custom consent locations.<\/p>\n\n\n\n<h3 id=\"h-example-1-displaying-checkboxes-using-layout-containers\">Example 1. Displaying Checkboxes Using Layout Containers<\/h3>\n\n\n\n<p><strong>If your page is built using containers, then you should use the code from the example below.<\/strong><\/p>\n\n\n\n<p>In this example, we will add checkboxes on the Registration Page. Add a container to the XML layout file:<\/p>\n\n\n\n<ol><li>Open the file:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">\/frontend\/layout\/customer_account_create.xml<\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\"><li>Add the code as shown below:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;referenceContainer name=\"form.additional.info\">\n    &lt;block name=\"data_privacy_checkbox\"\n        template=\"Plumrocket_DataPrivacy::x-init\/location_checkbox_list.phtml\"\n        ifconfig=\"prgdpr\/general\/enabled\">\n        &lt;arguments>\n            &lt;argument name=\"locationKey\" xsi:type=\"string\">registration&lt;\/argument>\n            &lt;argument name=\"scope\" xsi:type=\"string\">pr-data-privacy-registration&lt;\/argument>\n        &lt;\/arguments>\n    &lt;\/block>\n&lt;\/referenceContainer><\/code><\/pre><\/div>\n\n\n\n<p><strong>Where:<\/strong><\/p>\n\n\n\n<ul><li>&#8220;<strong>locationKey<\/strong>&#8221; is a location identifier, which you can find in the <a href=\"\/docs\/magento-data-privacy\/v3\/configuration#consent-locations\">Consent Locations grid<\/a>.<\/li><li>&#8220;<strong>scope<\/strong>&#8221; is a unique identifier for each checkbox list.<\/li><\/ul>\n\n\n\n<h3 id=\"h-example-2-displaying-checkboxes-using-layout-blocks\">Example 2. Displaying Checkboxes Using Layout Blocks<\/h3>\n\n\n\n<p><strong>Create layout blocks if you need to add checkboxes within HTML content. Use the code from the example below.<\/strong><\/p>\n\n\n\n<p>In this example, we will add checkboxes to the Newsletter Subscription form.<\/p>\n\n\n\n<h4 id=\"h-step-1-insert-block-into-the-page-xml-layout\">Step 1. Insert block into the page XML layout<\/h4>\n\n\n\n<ol><li>Open the file:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">\/frontend\/layout\/default.xml<\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\"><li>Add the code as shown below:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;referenceBlock name=\"form.subscribe\">\n    &lt;block name=\"prgdpr_newsletter_checkbox\"\n        template=\"Plumrocket_DataPrivacy::x-init\/location_checkbox_list.phtml\"\n        ifconfig=\"prgdpr\/general\/enabled\">\n        &lt;arguments>\n            &lt;argument name=\"locationKey\" xsi:type=\"string\">newsletter&lt;\/argument>\n            &lt;argument name=\"scope\" xsi:type=\"string\">pr-data-privacy-newsletter&lt;\/argument>\n        &lt;\/arguments>\n    &lt;\/block>\n&lt;\/referenceBlock><\/code><\/pre><\/div>\n\n\n\n<h4 id=\"h-step-2-insert-block-into-the-page-html-template\">Step 2. Insert block into the page HTML template<\/h4>\n\n\n\n<ol><li>Open the file:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">\/frontend\/templates\/subscribe.phtml<\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\"><li>Add the highlighted code as shown below:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre data-line=\"10,11\"><code class=\"language-php\">&lt;div class=\"field newsletter\">\n    &lt;label class=\"label\" for=\"newsletter\">&lt;span>\n        &lt;?= $block->escapeHtml(__('Sign Up for Our Newsletter:')) ?>&lt;\/span>&lt;\/label>\n    &lt;div class=\"control\">\n        &lt;input name=\"email\" type=\"email\" id=\"newsletter\"\n            placeholder=\"&lt;?= $block->stripTags(__('Enter your email address')) ?>\"\n            data-validate=\"{required:true, 'validate-email':true}\"\/>\n    &lt;\/div>\n&lt;\/div>\n\n&lt;?= $block->getChildHtml('prgdpr_newsletter_checkbox') ?>\n\n&lt;div class=\"actions\">\n    &lt;button class=\"action subscribe primary\"\n        title=\"&lt;?= $block->stripTags(__('Subscribe')) ?>\" type=\"submit\">\n        &lt;span>&lt;?= $block->escapeHtml(__('Subscribe')) ?>&lt;\/span>\n    &lt;\/button>\n&lt;\/div><\/code><\/pre><\/div>\n\n\n\n<h3 id=\"h-example-3-displaying-checkboxes-using-ui-components\">Example 3. Displaying Checkboxes Using UI Components<\/h3>\n\n\n\n<p><strong>If your page is based on UI Components, then you should use the code from the example below.<\/strong><\/p>\n\n\n\n<p>Let\u2019s try to add checkboxes on the Checkout Page. Add container and UI Component to the XML layout file:<\/p>\n\n\n\n<ol><li>Open the file:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">\/frontend\/layout\/checkout_index_index.xml<\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\"><li>Add the code as shown below:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;referenceContainer name=\"content\">\n    &lt;block\n        class=\"MagentoFrameworkViewElementTemplate\"\n        name=\"prgdpr_checkbox\"\n        template=\"Plumrocket_GDPR::consent-checkboxes-jslayout.phtml\"\n    >\n        &lt;arguments>\n            &lt;argument name=\"prgdprPage\" xsi:type=\"string\">checkout&lt;\/argument>\n        &lt;\/arguments>\n    &lt;\/block>\n&lt;\/referenceContainer>\n\n&lt;referenceBlock name=\"checkout.root\">\n    &lt;arguments>\n        &lt;argument name=\"jsLayout\" xsi:type=\"array\">\n            &lt;item name=\"components\" xsi:type=\"array\">\n                &lt;item name=\"checkout\" xsi:type=\"array\">\n                    &lt;item name=\"children\" xsi:type=\"array\">\n                        &lt;item name=\"steps\" xsi:type=\"array\">\n                            &lt;item name=\"children\" xsi:type=\"array\">\n                                &lt;item name=\"billing-step\" xsi:type=\"array\">\n                                    &lt;item name=\"children\" xsi:type=\"array\">\n                                        &lt;item name=\"payment\" xsi:type=\"array\">\n                                            &lt;item\n                                                name=\"children\"\n                                                xsi:type=\"array\"\n                                            >\n                                                &lt;item\n                                                    name=\"payments-list\"\n                                                    xsi:type=\"array\"\n                                                >\n                                                    &lt;item\n                                                        name=\"children\"\n                                                        xsi:type=\"array\"\n                                                    >\n                                                        &lt;item\n                                                            name=\"before-place-order\"\n                                                            xsi:type=\"array\"\n                                                        >\n                                                            &lt;item\n                                                                name=\"children\"\n                                                                xsi:type=\"array\"\n                                                            >\n                                                                &lt;item\n                                                                    name=\"prgdpr-consent-checkboxes\"\n                                                                    xsi:type=\"array\"\n                                                                >\n                                                                    &lt;item\n                                                                        name=\"component\"\n                                                                        xsi:type=\"string\"\n                                                                        >Plumrocket_GDPR\/js\/view\/consent-checkbox&lt;\/item\n                                                                    >\n                                                                    &lt;item\n                                                                        name=\"sortOrder\"\n                                                                        xsi:type=\"string\"\n                                                                        >200&lt;\/item\n                                                                    >\n                                                                    &lt;item\n                                                                        name=\"displayArea\"\n                                                                        xsi:type=\"string\"\n                                                                        >before-place-order&lt;\/item\n                                                                    >\n                                                                    &lt;item\n                                                                        name=\"dataScope\"\n                                                                        xsi:type=\"string\"\n                                                                        >prgdprConsent&lt;\/item\n                                                                    >\n                                                                    &lt;item\n                                                                        name=\"provider\"\n                                                                        xsi:type=\"string\"\n                                                                        >prgdprConsentProvider&lt;\/item\n                                                                    >\n                                                                &lt;\/item>\n                                                            &lt;\/item>\n                                                        &lt;\/item>\n                                                    &lt;\/item>\n                                                &lt;\/item>\n                                            &lt;\/item>\n                                        &lt;\/item>\n                                    &lt;\/item>\n                                &lt;\/item>\n                            &lt;\/item>\n                        &lt;\/item>\n                    &lt;\/item>\n                &lt;\/item>\n            &lt;\/item>\n        &lt;\/argument>\n    &lt;\/arguments>\n&lt;\/referenceBlock>\n    <\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you can learn how to manually place checkboxes in the needed location of the page with the help of the Data Privacy module, which is a part of Magento 2 GDPR, CCPA, and LGPD extensions. There are default locations that you can view in the Magento admin panel -&gt;Plumrocket -&gt; Data Privacy &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-gdpr-pro\/v1\/devguide\/add-checkboxes-manually\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Add Consent Checkboxes Manually&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[418],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Add Consent Checkboxes Manually - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"In this guide, you can learn how to manually place checkboxes in the needed location of the page with the help of the Data Privacy module, which is a part\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Add Consent Checkboxes Manually\" \/>\n<meta property=\"og:description\" content=\"In this guide, you can learn how to manually place checkboxes in the needed location of the page with the help of the Data Privacy module, which is a part\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-24T14:14:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-24T14:14:51+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Add Consent Checkboxes Manually - Plumrocket Documentation","description":"In this guide, you can learn how to manually place checkboxes in the needed location of the page with the help of the Data Privacy module, which is a part","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually","og_locale":"en_US","og_type":"article","og_title":"How to Add Consent Checkboxes Manually","og_description":"In this guide, you can learn how to manually place checkboxes in the needed location of the page with the help of the Data Privacy module, which is a part","og_url":"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually","og_site_name":"Plumrocket Documentation","article_published_time":"2025-06-24T14:14:49+00:00","article_modified_time":"2025-06-24T14:14:51+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually#webpage","url":"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually","name":"How to Add Consent Checkboxes Manually - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"datePublished":"2025-06-24T14:14:49+00:00","dateModified":"2025-06-24T14:14:51+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8"},"description":"In this guide, you can learn how to manually place checkboxes in the needed location of the page with the help of the Data Privacy module, which is a part","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-data-privacy\/v3\/devguide\/add-checkboxes-manually#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento 2 Extensions","item":"https:\/\/plumrocket.com\/magento-extensions"},{"@type":"ListItem","position":2,"name":"Magento 2 GDPR","item":"https:\/\/plumrocket.com\/magento-gdpr"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-gdpr"},{"@type":"ListItem","position":4,"name":"v1","item":"https:\/\/plumrocket.com\/docs\/magento-gdpr\/v1"},{"@type":"ListItem","position":5,"name":"Developer Guide","item":"https:\/\/plumrocket.com\/docs\/magento-gdpr-pro\/v1\/devguide"},{"@type":"ListItem","position":6,"name":"How to Add Consent Checkboxes Manually"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","caption":"Plumrocket"}}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/28509"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=28509"}],"version-history":[{"count":1,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/28509\/revisions"}],"predecessor-version":[{"id":28510,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/28509\/revisions\/28510"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=28509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=28509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=28509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}