Jump to content

Newsletter check box set at checked for default


Recommended Posts

try this

 

Before change

 

 

<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) && $smarty.post.newsletter == '1'}checked="checked"{/if}>

 

 

 

After change

 

 

<input type="checkbox" name="newsletter" id="newsletter" value="1" {if !isset($smarty.post.newsletter) || $smarty.post.newsletter == '1'}checked="checked"{/if}>

Edited by shokinro (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

This option while it does have the newsletter option already checked the customer will not actually be added to the newsletter list.

The customer will show as opting for the newsletter but when you view the list no one who registered since changing this code will have actually been added to the list.

Strange I know but I found out the hard way.

 

Sorry shokinro not trying to step on any toes here.

Link to comment
Share on other sites

  • 2 weeks later...
  • 10 months later...

try this

 

Before change

 

 

<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) && $smarty.post.newsletter == '1'}checked="checked"{/if}>

 

After change

 

 

<input type="checkbox" name="newsletter" id="newsletter" value="1" {if !isset($smarty.post.newsletter) || $smarty.post.newsletter == '1'}checked="checked"{/if}>

 

It does not work for me. I have set Force Compile in Performance but the checkbox is not checked.

 

I also have add the following instead of the what you recommend:

<input type="checkbox" name="newsletter" id="newsletter" value="1" checked="checked" />
Link to comment
Share on other sites

  • 1 month later...

This option while it does have the newsletter option already checked the customer will not actually be added to the newsletter list.

The customer will show as opting for the newsletter but when you view the list no one who registered since changing this code will have actually been added to the list.

Strange I know but I found out the hard way.

 

Sorry shokinro not trying to step on any toes here.

 

It works for newsletters, haven't tried for opt-ins but I guess it should be the same.

Edited by innercode (see edit history)
Link to comment
Share on other sites

  • 2 months later...
  • 2 years later...

here is perfect coding for default newsletter :-

 

<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.guest_email) && $smarty.post.newsletter == '1'} checked="checked" {elseif isset($smarty.post.guest_email) && $smarty.post.newsletter == ''}  {else}  checked="checked" {/if} /> 

 

happy selling !!

  • Like 1
Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...
×
×
  • Create New...