Re: checkbox for SMS subscription

How to set SMS subscription checkbox as default?

BM136
Excursionist
42 0 8

Hi,

 

Recently, we display the checkbox in checkout to get customers permission to receive SMS offers.

Is there away to make this checkbox checked by default?

Replies 5 (5)

robwatkins88
Shopify Partner
17 0 1

document.queryselector("input#abc[type=checkbox]").setAttribute("checked", true)

 

Replace abc with the id of the field element. Or do you need even more help to make the change.

BM136
Excursionist
42 0 8

Thanks 🙂

 

And where should I add this code? 

Will this be applied on checkout? 

 

BM136_0-1709621917376.png

 

MaximusP
Tourist
3 0 1

Did you figure out where to put the code?

BM136
Excursionist
42 0 8

Unfortunatly, not yet.

 

And I hope that this can be done from settings (just as email subscription box)

robwatkins88
Shopify Partner
17 0 1

You need to have access to shopify plus to do this, presumably you dont have that. Come August nothing like this will be possible on the new checkout, all this functionality is removed to prevent people doing things like this, which protects shopify.