Dawn Theme Customer Registry Privacy Policy Checkbox

Topic summary

A user needed to add a mandatory privacy policy checkbox to the Shopify Dawn theme’s customer registration page. The initial implementation allowed account creation without checking the box.

Solution Provided:

  • Another user shared updated code that adds a required attribute to the checkbox input
  • The solution includes adding disabled to the submit button, which only becomes enabled when the checkbox is checked
  • This prevents form submission until users accept the privacy policy

Follow-up Questions:

  • One user asked how to customize the checkbox’s shape and color (directed to create a separate community post)
  • Another user asked which file should contain this code (question remains unanswered)

Technical Details:
The code modification involves HTML form elements within the Dawn theme’s registration template, specifically adding checkbox validation and button state management through the required and disabled attributes.

Summarized with AI on November 15. AI used: claude-sonnet-4-5-20250929.

I am trying to add a mandatory checkbox to my customer registration page. I have managed to create a checkbox linking to the privacy policies, but I can create a new account also without ticking the box. Anybody know how to fix this and also give the user notice that the box needs to ticked?

I have inserted the code for the box below the code for the field for the password.

{{ 'customer.register.password' | t }}
{%- if form.errors contains 'password' -%} {{ form.errors.translated_fields['password'] | capitalize }} {{ form.errors.messages['password'] }}. {%- endif -%}
Ich habe die Datenschutzbestimmungen gelesen und stimme ihnen hiermit zu.

{{ 'customer.register.submit' | t }}
{%- endform -%}

Hi @VieCape ,

Please change all code:


  
  

{%- if form.errors contains 'password' -%}

  
  {{ form.errors.translated_fields['password'] | capitalize }} {{ form.errors.messages['password'] }}.

{%- endif -%}

  
  

  

{%- endform -%}

I helped you to add disabled to the button, so if the client doesn’t check the checkbox, the button won’t disable disabled.

Hope it helps!

1 Like

You my friend are a hero, thank you so much!

1 Like

It’s great! Thank you for your help. I want to ask an other question: How can I change the shape and color of the check box?

Hi @serhatsalih ,

You can create a question on the community and send me the link. I will check it.
Because this will help build a better community.
Thank you.

Hello,

I also need to add such checkbox, which file should contain this code?

Thank you very much,

Mike