Follow these 3 steps:
- Create a Privacy Policy page (if you do not have one already)
- Add a new Consent with I agree checkbox field to the Sign up form
- "Connect" the consent with Privacy Policy through the new Script using the Script Manager
Steps
-
Log in to BigCommerce.
-
From the BigCommerce Dashboard, go to the Storefront:
-
Select Web Pages:
-
Click the Create a Web Page button:
-
Under Page Type, leave the default: Contain content created using the WYSIWYG editor below:
-
Type "Privacy Policy" as the Page Name under Web Page Details:
-
In the Page Content editor, select the HTML:
-
The HTML Source Editor will open. Add your Privacy Policy text.
If you do not have a Privacy Policy, you can use our Privacy Policy Generator and create one within minutes.
On the download page, scroll to the Copy your Privacy Policy section and click on the Copy this to clipboard button:
-
Paste the HTML of your Privacy Policy in the HTML Source Editor:
-
Click Update:
-
When done, click the Save & Exit button at the bottom of the page:
-
Your newly created Privacy Policy page will show up on the View Web Page list as Normal Page:
-
Go back to Storefront and select Settings:
-
The Settings options will open. Scroll down to the Advanced section and select the Account Sign up form option:
-
The Form Fields options will open. Go to Create a New Field:
-
From the Field menu, select Checkboxes:
-
The Create a Checkbox window will open. Fill in the required fields:
- Type "Consent" as the Field Name
- Type "I agree to the Privacy Policy" as the List of Values
- Under the Required option check the box for "Yes this field is required"
-
When done, click Save to close the window:
-
The new Consent checkbox field is added to your Account Sign up form list. From there, continue to the Storefront:
-
Select Script Manager:
-
Click Create a Script:
-
The Create Script options will open. Go through it. For example, name a new script Consent, etc. Under Script type, select Script so that the Script contents code field shows below:
-
Add the script. For the example purposes, we used the script from BigCommerce help that works for Cornerstore Themes Only.
if(document.location.search === "?action=create_account") {
consent_checkbox = document.querySelector("input[value='I agree to the Privacy Policy']").attributes['name'].value;
document.querySelectorAll("label[for='"+consent_checkbox+"']")[0].innerHTML = "I agree to the <a href='/privacy'>Privacy Policy</a>";
};Please note that the script is case sensitive. Therefore, we updated the Privacy Policy link to match the URL we used in this example:
/privacy-policy/
which is the default when you add a new Normal Page type. -
Click Save:
-
The New Script named Consent is added. Go to the View Store to preview changes:
-
The new required field named Consent is added to the register page. The "I agree" checkbox with the linked newly created Privacy Policy page is displayed as part of the sign-up form.