Post by YarniaPDX » Mon Mar 05, 2018 2:01 am

Can anyone tell me how to remove the "signup for our newsletter" option from the new customer registration form?

Thanks!

Active Member

Posts

Joined
Sat Sep 04, 2010 7:10 am

Post by IP_CAM » Mon Mar 05, 2018 9:43 am

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
---

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by YarniaPDX » Wed Mar 07, 2018 3:51 am

Perfect, thank you!

Active Member

Posts

Joined
Sat Sep 04, 2010 7:10 am

Post by pinklotus » Wed Oct 30, 2019 9:16 am

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-->

New member

Posts

Joined
Sat May 30, 2015 6:35 am
Who is online

Users browsing this forum: No registered users and 25 guests