Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Get rid entirely of "Newsletter and Email Details"?

Get rid entirely of "Newsletter and Email Details"?

Locked

Started by dude_s on 14 Oct 2007, 2:12 AM · Views: 3,178

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
14 Oct 2007, 2:12 AM
#1
dude_s avatar

dude_s

New Zenner

Join Date:
May 2005
Posts:
39
Plugin Contributions:
0

Post #1 by dude_s

Im my effort to streamline the checkout as much as possible, I have now set my eyes on the "Newsletter and Email Details" box, see attachment. As you can tell, I figured out how to hide the "Subscribe to Our Newsletter" check box in Admin > Customer Details. But how do I get rid of the entire box?

I only ever send emails in plain text, no need to ask.

14 Oct 2007, 3:28 AM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Post #2 by merlinpa1969

comment it out in includes/templates/YOUR TEMPLATE/templates/tpl_create_account_default.php and tpl_login_default.php

Zen cart PCI compliant Hosting

14 Oct 2007, 3:55 AM
#3
dude_s avatar

dude_s

New Zenner

Join Date:
May 2005
Posts:
39
Plugin Contributions:
0

Post #3 by dude_s

Thanks!

16 Oct 2007, 5:38 AM
#4
dude_s avatar

dude_s

New Zenner

Join Date:
May 2005
Posts:
39
Plugin Contributions:
0

Post #4 by dude_s

Unfortunately those files are not very well documented and I'm not yet a seasoned PHP whiz to read this like an open book. What exactly do I comment out there? I believe it has to do with this line

<?php echo zen_draw_form('create_account', zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onsubmit="return check_form(create_account);"') . zen_draw_hidden_field('action', 'process') . zen_draw_hidden_field('email_pref_html', 'email_format'); ?>

I deleted the

 . zen_draw_hidden_field('email_pref_html', 'email_format')
```but it doesn't seem to have any effect.
16 Oct 2007, 12:36 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #5 by drbyte

dude_s:

Unfortunately those files are not very well documented and I'm not yet a seasoned PHP whiz to read this like an open book.
Actually, they are well documented ... by the HTML.
Ignore the PHP. It's the HTML you need to look at.

If you look at the browser source for that page, and then look at the template file, you'll see some fairly obvious correlations.
You'll see that there are the checkbox fields for the newsletter and the radio buttons for the email format.
You'll see that those are inside <fieldset> tags.

Since you said you want to remove all of those pieces, wouldn't you want to remove the <fieldset> and all that's inside it? Thus, you'd remove the HTML code for the <fieldset>, all the fields inside (whether generated by PHP or HTML), and the closing </fieldset> for that section.

ie all of this:```

<fieldset> <legend><?php echo ENTRY_EMAIL_PREFERENCE; ?></legend> <?php if (ACCOUNT_NEWSLETTER_STATUS != 0) { ?> <?php echo zen_draw_checkbox_field('newsletter', '1', $newsletter, 'id="newsletter-checkbox"') . '<label class="checkboxLabel" for="newsletter-checkbox">' . ENTRY_NEWSLETTER . '</label>' . (zen_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="alert">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?> <br class="clearBoth" /> <?php } ?> <?php echo zen_draw_radio_field('email_format', 'HTML', ($email_format == 'HTML' ? true : false),'id="email-format-html"') . '<label class="radioButtonLabel" for="email-format-html">' . ENTRY_EMAIL_HTML_DISPLAY . '</label>' . zen_draw_radio_field('email_format', 'TEXT', ($email_format == 'TEXT' ? true : false), 'id="email-format-text"') . '<label class="radioButtonLabel" for="email-format-text">' . ENTRY_EMAIL_TEXT_DISPLAY . '</label>'; ?> <br class="clearBoth" /> </fieldset> ```

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 Oct 2007, 5:15 PM
#6
dude_s avatar

dude_s

New Zenner

Join Date:
May 2005
Posts:
39
Plugin Contributions:
0

Post #6 by dude_s

Ok, thanks. This worked! :-)

The first file mentioned above only has one fieldset and when I removed that at first, the whole form was gone. That's why I didn't figure that out.

I'm getting the hang of things, but I gotta say it's often quite overwhelming. Thought I could install this and be up and running in a day. It's been almost a week now, and I'm still struggling with things like this...

22 Jul 2008, 7:10 AM
#7
jenpen avatar

jenpen

Zen Follower

Join Date:
Sep 2007
Location:
Far South Coast, NSW, Australia
Posts:
427
Plugin Contributions:
0

Post #7 by jenpen

comment it out in includes/templates/YOUR TEMPLATE/templates/tpl_create_account_default.php and tpl_login_default.php

This folder just doesn't exist in my zencart (v1.3.7.1) - yes I know to replace YOUR TEMPLATE with my template name, before anyone checks ...
So where could these files be? I'd love to delete the Newsletter stuff.

22 Jul 2008, 10:28 PM
#8
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Post #8 by lissae

Copy the files from includes/templates/template_default/templates/ to includes/templates/YOUR TEMPLATE/templates/ and edit them there :)

HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

24 Jul 2008, 3:08 AM
#9
jenpen avatar

jenpen

Zen Follower

Join Date:
Sep 2007
Location:
Far South Coast, NSW, Australia
Posts:
427
Plugin Contributions:
0

Post #9 by jenpen

I opened those files in the template_default folder and the code you mention above is not there. This is the whole file tpl_create_account_default.php:

<?php /** * Page Template * * Loaded automatically by index.php?main_page=create_account.<br /> * Displays Create Account form. * * @package templateSystem * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_create_account_default.php 6528 2007-06-25 23:25:27Z drbyte $ */ ?> <div class="centerColumn" id="createAcctDefault"> <h1 id="createAcctDefaultHeading"><?php echo HEADING_TITLE; ?></h1> <?php echo zen_draw_form('create_account', zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onsubmit="return check_form(create_account);"') . zen_draw_hidden_field('action', 'process') . zen_draw_hidden_field('email_pref_html', 'email_format'); ?> <h4 id="createAcctDefaultLoginLink"><?php echo sprintf(TEXT_ORIGIN_LOGIN, zen_href_link(FILENAME_LOGIN, zen_get_all_get_params(array('action')), 'SSL')); ?></h4> <fieldset> <legend><?php echo CATEGORY_PERSONAL; ?></legend> <?php require($template->get_template_dir('tpl_modules_create_account.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_create_account.php'); ?> </fieldset> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SUBMIT, BUTTON_SUBMIT_ALT); ?></div> </form> </div>

Is it because I'm using v1.3.7.1? If so, where do I go to delete the email/newsletter options box? :(

24 Jul 2008, 4:02 AM
#10
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Post #10 by lissae

The file you want to edit is tpl_modules_create_account.php, I did not take enough notice of the filenames up above when I posted before LOL

HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe