Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Modify Newsletter box Rate Topic   * * * * - 1 votes

 
  • purelife
  • Member
  • Members
  • Join Date: 24-Jun 10
  • 61 posts

Posted 18 September 2010 - 05:33 AM #21

thanks. the code works for checkout registration page. it auto check marks the specials box and defaults to HTML. good enough for me.

Posted Image

the normal registration page doesn't work for me

Posted Image

and adding to my /skins/electro/customer/style.css file

#checkout-newsletter{
display: none;
}

results in this

Posted Image

 
  • hbtrading
  • Senior Member
  • Members
  • Join Date: 07-Oct 09
  • 204 posts

Posted 19 September 2010 - 01:45 AM #22

For the profile page you would need to edit the following file;
/skins/YOURSKIN/customer/addons/news_and_emails/hooks/profiles/account_update.pre.tpl
replacing the code in there with this:
{* $Id: account_update.pre.tpl 8442 2009-12-22 13:18:23Z lexa $ *}

{if $page_mailing_lists}
<div id="checkout-newsletter">
	{include file="common_templates/subheader.tpl" title=$lang.mailing_lists}

	<p>{$lang.text_signup_for_subscriptions}</p>

	{foreach from=$page_mailing_lists item=list}
		<div class="select-field">
			<input type="hidden" name="mailing_lists[{$list.list_id}]" value="0" />
			<input id="profile_mailing_list_{$list.list_id}" type="checkbox" checked="checked" name="mailing_lists[{$list.list_id}]" value="1" {if $user_mailing_lists[$list.list_id]}checked="checked"{/if} class="checkbox" /><label for="profile_mailing_list_{$list.list_id}">{$list.object}</label>
		</div>
	{/foreach}

	<div class="select-field">
	<select name="newsletter_format">
		<option value="{$smarty.const.NEWSLETTER_FORMAT_HTML}" {if $newsletter_format == $smarty.const.NEWSLETTER_FORMAT_HTML}selected="selected"{/if}>{$lang.html_format}</option>
        <option value="{$smarty.const.NEWSLETTER_FORMAT_TXT}" {if $newsletter_format == $smarty.const.NEWSLETTER_FORMAT_TXT}selected="selected"{/if}>{$lang.txt_format}</option>
	</select>
	</div>
    
    </div>
{/if}

I'm not understanding the last part of your post.

 
  • ArnoBT
  • Junior Member
  • Members
  • Join Date: 22-Sep 08
  • 7 posts

Posted 28 October 2010 - 06:09 PM #23

For my it didnot work exactly like this

for the checkout page:
/skins/../customer/addons/news_and_emails/hooks/checkout

i replaced all to:



{if $page_mailing_lists}
<div id="checkout-newsletter">
{include file="common_templates/subheader.tpl" title=$lang.mailing_lists}

<p>{$lang.text_signup_for_subscriptions}</p>

{foreach from=$page_mailing_lists item=list}
<div class="select-field">
<input type="hidden" name="mailing_lists[{$list.list_id}]" value="0" />
<label><input type="checkbox" checked="checked" name="mailing_lists[{$list.list_id}]" value="1" {if $user_mailing_lists[$list.list_id]}checked="checked"{/if} class="checkbox" />{$list.object}</label>
</div>
{/foreach}

<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
</div>

{/if}


for the subscription in blocks
skin/../customer/addons/news_and_emails/blocks/subscribe.tpl

i changed all in:



{if $mailing_lists}
<form action="{""|fn_url}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />

<p>{$lang.text_signup_for_subscriptions}</p>
{foreach from=$mailing_lists item=list}
<div class="select-field">
<label for="mailing_list_{$block.block_id}{$list.list_id}">
<input id="mailing_list_{$block.block_id}{$list.list_id}" type="checkbox" class="checkbox" name="mailing_lists[{$list.list_id}]" value="1" checked="checked" />{$list.object}
</label>
</div>
{/foreach}
<div class="subscription-select-field">
<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
</div>
{strip}
<div class="form-field">
<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label>
<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>
{/if}

I added to the styles.css :

}
.subscription-select-field {
display: none;

}

you will then get:
tick off boxes ticked of with your newsletter next to it
newsletter will be sent in html

it applies for blocks and the checkout pages.


 
  • brians34
  • Junior Member
  • Members
  • Join Date: 02-Dec 10
  • 26 posts

Posted 31 December 2010 - 03:02 AM #24

I'm reading through this thread and there are so many codes listed. I have all three boxes checked for signing up to mailing list, "Checkout", "Registration", and "Mailing Lists Box". I would prefer not having the "Plain Text / HTML" selection box, but if I have to have it I'd prefer to have default as HTML.

Could someone enlighten me as to which of these reply numbers codes I need to change to make each area to work properly?

Thanks
CS v. 2.1.2

 
  • lefaek
  • Member
  • Members
  • Join Date: 21-Dec 10
  • 36 posts

Posted 31 December 2010 - 04:51 PM #25

change the code
<select name="newsletter_format">
<option value="{$smarty.const.NEWSLETTER_FORMAT_TXT}" {if $newsletter_format == $smarty.const.NEWSLETTER_FORMAT_TXT}selected="selected"{/if}>{$lang.txt_format}</option>
<option value="{$smarty.const.NEWSLETTER_FORMAT_HTML}" {if $newsletter_format == $smarty.const.NEWSLETTER_FORMAT_HTML}selected="selected"{/if}>{$lang.html_format}</option>
</select>


with this
<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">

in the following 3 files

>skins/your-skin/customer/addons/news_and_emails/hooks/profiles/account_update.pre.tpl
>skins/your-skin/customer/addons/news_and_emails/blocks/subscribe.tpl
>skins/your-skin/customer/addons/news_and_emails/hooks/checkout/checkout_steps.pre.tpl
Find the best host for your ecommerce at JudgeHost.com

 
  • purelife
  • Member
  • Members
  • Join Date: 24-Jun 10
  • 61 posts

Posted 23 April 2011 - 07:33 AM #26

I upgraded to 2.1.4 and the code from this thread doesn't work anymore.

It now looks like this after update.
Posted Image

If i replace the code from this thread, the whole mailing list block disappears.

The code in skins/electro/customer/addons/news_and_emails/blocks/subscribe.tpl looks like this after update:

{* $Id: subscribe.tpl 10972 2010-10-21 13:58:18Z klerik $ *}

{if $items}
<form action="{""|fn_url}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />

<p>{$lang.text_signup_for_subscriptions}</p>
{foreach from=$items item=list name="mailing_lists"}
	<div class="select-field">
		<label for="mailing_list_{$block.block_id}{$list.list_id}">
			<input id="mailing_list_{$block.block_id}{$list.list_id}" type="checkbox" class="checkbox" name="mailing_lists[{$list.list_id}]" value="1" />{$list.object}
		</label>
	</div>
{/foreach}
<div class="select-field">
	
<select name="newsletter_format" id="newsletter_format{$block.block_id}">
		<option value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">{$lang.html_format}</option>
	<option value="{$smarty.const.NEWSLETTER_FORMAT_TXT}">{$lang.txt_format}</option>
	</select>
</div>
{strip}
<div class="form-field">
	<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label>
	<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>
{/if}

I tried using this code from this thread:

{* $Id: subscribe.tpl 7806 2009-08-12 10:22:35Z alexions $ *}
{** block-description:mailing_lists **}

{if $mailing_lists}
<form action="{$index_script}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />

{foreach from=$mailing_lists item=list}
	<div class="select-field">
		<input id="mailing_list_{$list.list_id}" type="hidden" class="hidden" name="mailing_lists[{$list.list_id}]" value="1" />
	</div>
{/foreach}
<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
</select>
{strip}
<div class="form-field">
	<label for="subscr_email" class="cm-required cm-email hidden">{$lang.email}</label>
	<input type="text" name="subscribe_email" id="subscr_email" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>
{/if}

Any ideas? Thanks in advance. :P

 
  • nikmark
  • Junior Member
  • Members
  • Join Date: 30-Jul 10
  • 37 posts

Posted 29 April 2011 - 04:04 PM #27

I'm having the same issue (newsletter box gone) Any luck with this yet?

 
  • CS-Cart team
  • CS-Cart support team
  • Moderators
  • Join Date: 04-Apr 11
  • 3808 posts

Posted 03 May 2011 - 11:33 AM #28

I'm having the same issue (newsletter box gone) Any luck with this yet?


Hello nikmark,

Please try to use the following part of code:

{if $items}
<form action="{""|fn_url}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />

<p>{$lang.text_signup_for_subscriptions}</p>
{foreach from=$items item=list name="mailing_lists"}
	<div class="select-field">
		<label for="mailing_list_{$block.block_id}{$list.list_id}">
			<input id="mailing_list_{$block.block_id}{$list.list_id}" type="checkbox" class="checkbox" name="mailing_lists[{$list.list_id}]" value="1" />{$list.object}
		</label>
	</div>
{/foreach}
<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
{strip}
<div class="form-field">
	<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label>
	<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>
{/if}

Thank you.

Sincerely yours, CS-Cart Support Team

 

User guide       |  Developer documentation  |  Core API documentation


 
  • nikmark
  • Junior Member
  • Members
  • Join Date: 30-Jul 10
  • 37 posts

Posted 03 May 2011 - 01:51 PM #29

Thanks for the reply! But no luck with the new code...


Hello nikmark,

Please try to use the following part of code:

{if $items}
<form action="{""|fn_url}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />

<p>{$lang.text_signup_for_subscriptions}</p>
{foreach from=$items item=list name="mailing_lists"}
	<div class="select-field">
		<label for="mailing_list_{$block.block_id}{$list.list_id}">
			<input id="mailing_list_{$block.block_id}{$list.list_id}" type="checkbox" class="checkbox" name="mailing_lists[{$list.list_id}]" value="1" />{$list.object}
		</label>
	</div>
{/foreach}
<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
{strip}
<div class="form-field">
	<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label>
	<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>
{/if}

Thank you.


www.appliedenergyproducts.com
CS Cart 2.1.4

 
  • nikmark
  • Junior Member
  • Members
  • Join Date: 30-Jul 10
  • 37 posts

Posted 03 May 2011 - 07:06 PM #30

Ok! It worked! All good! Thank You!!!

Hello nikmark,

Please try to use the following part of code:

{if $items}
<form action="{""|fn_url}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />

<p>{$lang.text_signup_for_subscriptions}</p>
{foreach from=$items item=list name="mailing_lists"}
	<div class="select-field">
		<label for="mailing_list_{$block.block_id}{$list.list_id}">
			<input id="mailing_list_{$block.block_id}{$list.list_id}" type="checkbox" class="checkbox" name="mailing_lists[{$list.list_id}]" value="1" />{$list.object}
		</label>
	</div>
{/foreach}
<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
{strip}
<div class="form-field">
	<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label>
	<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>
{/if}

Thank you.


www.appliedenergyproducts.com
CS Cart 2.1.4

 
  • purelife
  • Member
  • Members
  • Join Date: 24-Jun 10
  • 61 posts

Posted 27 May 2011 - 10:30 PM #31

Using the code from 3 posts up i was able to get mine to look like this.

Posted Image

Is there any way to get rid of the check box and the word Specials so it's selected by default?

Thanks! :D

 

Posted 12 July 2011 - 03:24 AM #32

Using the code from 3 posts up i was able to get mine to look like this.


Posted Image


Is there any way to get rid of the check box and the word Specials so it's selected by default?


Thanks! :D


Use the following code. just replace the whole subscribe.tpl with it.
itll give you the newsletter box as below, just email box and go button.
defaults to HTML and signs the user up to all your mailing lists

Posted Image
{* $Id: subscribe.tpl 10972 2010-10-21 13:58:18Z klerik $ *}

{if $items}
<form action="{""|fn_url}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />
{foreach from=$items item=list name="mailing_lists"}
	<div class="hidden">
		<label for="mailing_list_{$block.block_id}{$list.list_id}">
			<input id="mailing_list_{$block.block_id}{$list.list_id}" type="hidden" class="hidden" name="mailing_lists[{$list.list_id}]" value="1" />{$list.object}
		</label>
	</div>
{/foreach}
<div class="hidden">
	<select name="newsletter_format" id="newsletter_format{$block.block_id}">
		<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
	</select>
</div>
{strip}
<div class="form-field">
	<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label>
	<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>

Attached Files



 
  • b4lly
  • Junior Member
  • Members
  • Join Date: 29-Oct 08
  • 81 posts

Posted 03 August 2011 - 06:00 AM #33

Use the following code. just replace the whole subscribe.tpl with it.
itll give you the newsletter box as below, just email box and go button.
defaults to HTML and signs the user up to all your mailing lists

Posted Image

{* $Id: subscribe.tpl 10972 2010-10-21 13:58:18Z klerik $ *}

{if $items}
<form action="{""|fn_url}" method="post" name="subscribe_form">
<input type="hidden" name="redirect_url" value="{$config.current_url}" />
{foreach from=$items item=list name="mailing_lists"}
	<div class="hidden">
		<label for="mailing_list_{$block.block_id}{$list.list_id}">
			<input id="mailing_list_{$block.block_id}{$list.list_id}" type="hidden" class="hidden" name="mailing_lists[{$list.list_id}]" value="1" />{$list.object}
		</label>
	</div>
{/foreach}
<div class="hidden">
	<select name="newsletter_format" id="newsletter_format{$block.block_id}">
		<input type="hidden" id="newsletter_format" name="newsletter_format" value="{$smarty.const.NEWSLETTER_FORMAT_HTML}">
	</select>
</div>
{strip}
<div class="form-field">
	<label for="subscr_email{$block.block_id}" class="cm-required cm-email hidden">{$lang.email}</label>
	<input type="text" name="subscribe_email" id="subscr_email{$block.block_id}" size="20" value="{$lang.enter_email|escape:html}" class="input-text cm-hint" />
	{include file="buttons/go.tpl" but_name="newsletters.add_subscriber" alt=$lang.go}
</div>
{/strip}
</form>


Thanks for the code. Please note it is missing the final line:

{/if}

Plays a bit of havoc without it.
Thanks again