Page 1 of 1

Removing newsletter signup

Posted: Mon Mar 05, 2018 2:01 am
by YarniaPDX
Can anyone tell me how to remove the "signup for our newsletter" option from the new customer registration form?

Thanks!

Re: Removing newsletter signup

Posted: Mon Mar 05, 2018 9:43 am
by IP_CAM
Well, you could change in the:
theme/template/account/register.twig file:
This Section:

Code: Select all

<fieldset>
<legend>{{ text_newsletter }}</legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ entry_newsletter }}</label>
<div class="col-sm-10"> {% if newsletter %}
<label class="radio-inline">
<input type="radio" name="newsletter" value="1" checked="checked" />
{{ text_yes }}</label>
<label class="radio-inline">
<input type="radio" name="newsletter" value="0" />
{{ text_no }}</label>
{% else %}
<label class="radio-inline">
<input type="radio" name="newsletter" value="1" />
{{ text_yes }}</label>
<label class="radio-inline">
<input type="radio" name="newsletter" value="0" checked="checked" />
{{ text_no }}</label>
{% endif %} </div>
</div>
</fieldset>
to this:

Code: Select all

<fieldset>
<div class="form-group">
<input type="hidden" name="newsletter" value="0" checked="checked" />
</div>
</fieldset>
----
and in the:
theme/template/checkout/register.twig file:
This Section:

Code: Select all

<div class="checkbox">
  <label for="newsletter">
    <input type="checkbox" name="newsletter" value="1" id="newsletter" />
    {{ entry_newsletter }}</label>
</div>
to this:

Code: Select all

<div class="checkbox">
    <input type="hidden" name="newsletter" value="0" id="newsletter" />
</div>
But it's untested on your Version. Still it would be switchable, if one knows,
where in the Admin Section to find it's switch. And this way, the Newsletter
Setting would be '0' = no Newsletter.
Good Luck, and always make Copies first! ;)
Ernie
---

Re: Removing newsletter signup [SOLVED]

Posted: Wed Mar 07, 2018 3:51 am
by YarniaPDX
Perfect, thank you!

Re: Removing newsletter signup

Posted: Wed Oct 30, 2019 9:16 am
by pinklotus
Hi Ernie!

I would like to add a "Subscribe to Newsletter" checkbox on the Account Register and Order Checkout pages. How can I embed the MailChimp checkbox code below into the .twig files to replace the default Newsletter radio buttons? Which .twig files should be updated? OC 3.0.3.2. Thank you so much for your help :)

<!-- Begin MailChimp Signup Form -->

<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="//dada.us14.list-manage.com/subscribe/post?u=804ce11ffe4a5684c85f88d38&amp;id=d5ab97dfc9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<input type="checkbox" value="1" name="group[4917][1]" id="mce-group[4917]-4917-0"><label for="mce-group[4917]-4917-0">Subscribe to our mailing list</label>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_804ce11ffe4a5684c85f88d38_d5ab97dfc9" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>

<!--End mc_embed_signup-->