How can I add sign up for newsletter checkbox on create an account form

Solved

How can I add sign up for newsletter checkbox on create an account form

NerdCurator
Shopify Partner
393 72 107

We need to add a checkbox on create an account form so that user can subscribe to news by default just as we have an option to add it on checkout form. Thank you

Believes in delivering optimizing web solutions | Shopify Partner | Working as a web developer for last 8+ years.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Email me: info@nerdcurator.com
Accepted Solution (1)

DavidEKim
Shopify Partner
392 131 193

This is an accepted solution.

@NerdCurator 

Hi,

Please add the code below to the location you want show the checkbox.

 

<label for="marketing">
  <input type="checkbox" name="customer[accepts_marketing]" value="true" id="marketing" /> I agree to receive promotions and coupons.
</label>

 

Change the label text per your needs.

Hope it helps.

Thanks.

If helpful, please Like and Accept Solution.
Want to customize your store, please feel free to contact me.
PeopleVillage - Shopify Partner

View solution in original post

Replies 7 (7)

DavidEKim
Shopify Partner
392 131 193

This is an accepted solution.

@NerdCurator 

Hi,

Please add the code below to the location you want show the checkbox.

 

<label for="marketing">
  <input type="checkbox" name="customer[accepts_marketing]" value="true" id="marketing" /> I agree to receive promotions and coupons.
</label>

 

Change the label text per your needs.

Hope it helps.

Thanks.

If helpful, please Like and Accept Solution.
Want to customize your store, please feel free to contact me.
PeopleVillage - Shopify Partner
jmcquirter
Visitor
3 0 0

Where can you find where to add this code?  I want to make it appear when our customers create an account and not do it at checkout only. 

DavidEKim
Shopify Partner
392 131 193

@jmcquirter 

Hi,

To make the marketing consent box show when your customers create an account, please go to Template > Customers/register.liquid file (if you are using Dawn theme). If you use a different theme and register.liquid file is not there, the register (create an account) code could be in account.liquid. However, the register.liquid file will be available for most themes.

 

Before the <button> for submit button, please add the above code.

 

20230226_195436.png

 

Hope it helps.

If helpful, please Like and Accept Solution.
Want to customize your store, please feel free to contact me.
PeopleVillage - Shopify Partner
jmcquirter
Visitor
3 0 0
What code?
jmcquirter
Visitor
3 0 0

I cannot switch and see the liquid file.  It only will allow me to see .json file. Can I do it from that file format?

 

Abi9
Visitor
2 0 0

This is fantastic advice. I have been trying to do this for over 6 hours today! As I have no coding experience, I had no idea where to start until I saw this post. You have saved my life! Thank you. 🙂

gabrielmedi
Tourist
9 0 1

Thanks for sharing!

Could you please help me with how can I add more margin on the left size? 

Captura de pantalla 2023-04-19 a la(s) 15.20.42.png

 

Thank you in advance