Forums / Addon Sideboxes / MailChimp Newsletter Sidebox

MailChimp Newsletter Sidebox

Views: 189,702

Results 201 to 220 of 403
11 Aug 2013, 8:32 PM
#201
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

MailChimp Newsletter Sidebox

This contribution already does that. And has for the last two years. :)

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

15 Sep 2013, 1:38 AM
#202
pauldz avatar

pauldz

New Zenner

Join Date:
Sep 2013
Location:
United States
Posts:
1
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

I don't know if this has already been answered: I successfully installed the module. Everything works fine when I enter a new email address in the sidebox. However, in the set up new acccount box in the checkout page, I get both a mailchimp confirmation email as well as the traditional zencart welcome email. Is it supposed to do that, or did I miss something so that the traditional ZC welcome email isn't generated? Thanks

15 Sep 2013, 4:38 AM
#203
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

swguy:

This contribution already does that. And has for the last two years. :)

Does it by default does it not?

Signature not needed

15 Sep 2013, 4:54 AM
#204
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: MailChimp Newsletter Sidebox

Yes. But if someone has a template change and doesn't merge it or uses some signup mod or whatever, it might appear not to work.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

15 Sep 2013, 5:30 AM
#205
uswebworx avatar

uswebworx

Zen Follower

Join Date:
Sep 2006
Location:
USA
Posts:
297
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

swguy:

Yes. But if someone has a template change and doesn't merge it or uses some signup mod or whatever, it might appear not to work.

Guess I need to check mine then, I think I did it ha ha thanks for clarifying!

Signature not needed

29 Dec 2013, 3:45 PM
#206
yukionna avatar

yukionna

New Zenner

Join Date:
Nov 2013
Posts:
22
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

I've read up on this plug-in and it could be what I'm looking for to add a newsletter-only option to my website. I have one question and one concern I'd like to post to the group to get information and opinions from others before I make my final decision.

Question: Is this plug-in a sidebox-only mod or is the plug-in configurable to be placed in the header or footer of the page as well. I am not using side columns on my website so would need to configure the code for the header/footer of my website.

Concern: MailChimp developers making unpublished changes to the MailChimp code which affects this plug-in. I read in this thread that the MailChimp developers constantly tweak their code. That worries me as I wouldn't want to wake up some morning and find out that the email plug-in on my site doesn't work due to an unpublished MailChimp mod. My understanding from reading the thread is that swguy tries to stay on top of those mods which is great but I'm worried about the plug-in not working on my site between the gap of time of the MailChimp mod and the time that swguy updates the plug-in.

29 Dec 2013, 4:29 PM
#207
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

This plugin allows for the addition of the side box and for the newsletter check box on the create account page to work with MailChimp. There is no footer or header 'box'.

MailChimp can and does make changes that affect this plugin. Thankfully, it's not too often and the community here is pretty quick to identify the changes and make adjustments (thanks swguy).

Jim
Wheaton Website Services

29 Dec 2013, 4:57 PM
#208
yukionna avatar

yukionna

New Zenner

Join Date:
Nov 2013
Posts:
22
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

jeking:

This plugin allows for the addition of the side box and for the newsletter check box on the create account page to work with MailChimp. There is no footer or header 'box'.

MailChimp can and does make changes that affect this plugin. Thankfully, it's not too often and the community here is pretty quick to identify the changes and make adjustments (thanks swguy).

Thanks for the quick reply. What I was looking for in functionality (and thought this plug-in did this) was a "box" like the "sign up for newsletter" box seen in the header of this forum page.

1 Jan 2014, 10:43 AM
#209
escapedape avatar

escapedape

New Zenner

Join Date:
Jun 2005
Posts:
16
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Hi All,

I'm a little lost at the moment...

I've followed the instructions and can get subscriptions to mailchimp to work via a sidebox sign-up but not via the create account process.

When I register a new user on my site via the create account process a subscription to mailchimp does not occurr; some details:

  1. Zencart v1.50

  2. No log is created in the cache folder of the site, I changed the code to write to /logs/mailchimp.log but still no log appears

  3. No subscription appears in mailchimp

  4. It's almost as it t he create_account.php is not calling the code at all (yet it does create accounts).

  5. I've searched my site for any other create_account.php in case I've missed an overloaded file somewhere. Here's an excerpt from the file:

    // restore cart contents
    $_SESSION['cart']->restore_contents();

    // hook notifier class
    $zco_notifier->notify('NOTIFY_LOGIN_SUCCESS_VIA_CREATE_ACCOUNT');

    if ((int)$newsletter == 1) {
    mailchimp_add($email_address, $email_format);
    }

    // build the message content
    $name = $firstname . ' ' . $lastname;

I'm not quite sure where to look now :-( Tips would be greatly appreciated!

By the way; the create account process doesn't jump to Mailchimp's site to verify the subscription does it?

Regards,
Troy.

1 Jan 2014, 9:45 PM
#210
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: MailChimp Newsletter Sidebox

Did you verify that they checked the newsetter box? Did you try printing the value of $newsletter before the if statement?

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

2 Jan 2014, 9:01 AM
#211
escapedape avatar

escapedape

New Zenner

Join Date:
Jun 2005
Posts:
16
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

swguy:

Did you verify that they checked the newsetter box? Did you try printing the value of $newsletter before the if statement?

Yep, I tested the process myself - tested with both checked and unchecked.

I added the value of the $newsletter in my ZC intro email to discover it was always 0.

I'm not a php programmer but following the logic of the includes/code it appears that another plugin (how_did_you_hear_about_us_v150) had modified this bit of code in the file "tpl_modules_create_account.php"

<?php echo '<label class="m-checkbox m-wrap" for="newsletter-checkbox">' . zen_draw_checkbox_field('newsletter', '0', $newsletter, 'id="newsletter-checkbox"') . ENTRY_NEWSLETTER . '</label>' . (zen_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="alert">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?>

<br class="clearBoth" /

I diff'd this with the same file pre-installation version of the same file and saw that 'newsletter', '0' was 'newsletter', '1'

Setting this back to 1 seems to have activated the newsletter subscribes. Not sure what the ramifications of the change I've made will have...

...but I guess that's an issue for the other plugin not this one.

Thanks for your pointer.

Troy.

19 Jun 2014, 8:52 PM
#212
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

Re: MailChimp Newsletter Sidebox

mikecnz:

Hi,

I got this to work with FEC,

simply add the code

if ((int)$newsletter == 1) {
mailchimp_add($email_address, $firstname, $lastname, $email_format);
}

to /includes/modules/fec_create_account instead of /includes/modules/your-template/create_account and follow the instructions above for includes/functions/extra_functions/mailchimp_functions.php. I made a typo in mailchimp_functions.php hence the reason for my e-mail above - but once I fixed it, everything worked as it should.

I did this (with the exception of adding the additional fields) and I cannot get the mailchimp to kick in when the newsletter box is clicked when using Fast Easy Checkout. Scott - do you have any recommendations? Or should I ask Jeff at Numinix?

Thanks for any help you can give me!

21 Jun 2014, 4:20 PM
#213
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

Re: MailChimp Newsletter Sidebox

Just as an FYI - I WAS getting the double optin emails - they were going to JUNK folder, so I did not see them! Everything worked perfectly! LOL

Now I am on a mission to figure out how to get the newsletter signup "box" to be in a header or footer of a site. Any suggestions will be welcomed!

stellarweb:

I did this (with the exception of adding the additional fields) and I cannot get the mailchimp to kick in when the newsletter box is clicked when using Fast Easy Checkout. Scott - do you have any recommendations? Or should I ask Jeff at Numinix?

Thanks for any help you can give me!

1 Jul 2014, 4:56 PM
#214
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Hello,
I'm using the add customer mod to add customer from admin, can we trigger mailchimp when adding a customer from admin? i assume this

   if ((int)$newsletter == 1) { 
       mailchimp_add($email_address, $email_format);
   }

is suppose to go in somewhere in the add_customers.php file

Here is the contents of my add_customers.php:

<?php
/**
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 *
 * add_customers module modified by Garden 2012-07-20
 * www.inzencart.cz Czech forum for ZenCart
 * Modified for Zen Cart 1.5.0, lat9 2012-08-31
 */
require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

$action = (isset($_POST['action'])) ? $_POST['action'] : false;
$error = false;
$processed = false;
$cInfo = array();
$theFormats = array('YYYY/MM/DD', 'MM/DD/YYYY', 'YYYY-MM-DD', 'MM-DD-YYYY', 'YYYY/DD/MM', 'DD/MM/YYYY', 'YYYY-DD-MM', 'DD-MM-YYYY');

require_once('add_customers_backend.php');

// ---- Determine what to do next ... single add vs. country change vs. multiple/file add
if (zen_not_null($action)) {
  switch ($action) {
    case 'add_single':
      $array = validate_customer($_POST, 'date_format_s');
      $errors = $array['errors'];
      $cInfo = $array['cInfo'];

      if (count($errors) < 1) {
        $customerName = insert_customer($_POST);
        $feedback = sprintf( MESSAGE_CUSTOMER_OK, $customerName);
      }
	  break;
	  
	case 'add_multiple':
      $array = check_file_upload();
      $errors = $array['errors'];
      $feedback = $array['feedback'];
	  break;
	  
	case 'resend_email':
      if (!isset($_POST['resend_id'])) {
	    $errors[] = ERROR_NO_CUSTOMER_SELECTED;
		
      } else {	  
        $sql = "SELECT customers_gender, customers_firstname, customers_lastname, customers_email_address FROM " . TABLE_CUSTOMERS . " WHERE customers_id = '" . (int)$_POST['resend_id'] . "'";
        $custInfo = $db->Execute($sql);
		if ($custInfo->RecordCount() == 0) {
		  $errors[] = ERROR_NO_CUSTOMER_SELECTED;
		  
		} else {
		  $thePassword = false;
		  if (isset($_POST['reset_pw']) && $_POST['reset_pw'] == 1) {
		    $thePassword = zen_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
            $sql = "UPDATE " . TABLE_CUSTOMERS . "
                    SET customers_password = '" . zen_encrypt_password($thePassword) . "'
                    where customers_id = '" . (int)$_POST['resend_id'] . "'";
            $db->Execute($sql);
		  }
          sendWelcomeEmail ($custInfo->fields['customers_gender'], $custInfo->fields['customers_firstname'], $custInfo->fields['customers_lastname'], $custInfo->fields['customers_email_address'], $thePassword);
		  
		  $feedback[] = CUSTOMER_EMAIL_RESENT;
		}
      }
	  break;
	  
	default:
	  break;
  }
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/stylesheet_acfa.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">

<script type="text/javascript" src="includes/menu.js"></script>
<script type="text/javascript" src="includes/general.js"></script>
<script type="text/javascript">

function init()
{
  cssjsmenu(\'navbar\');
  if (document.getElementById)
  {
    var kill = document.getElementById(\'hoverJS\');
    kill.disabled = true;
  }
}

</script>

</head>

<body onLoad="init()">
<?php
require(DIR_WS_INCLUDES . 'header.php');

$infoDivContents = '';
if (count($errors) > 0) {
  $infoDivContents = '<div class="errorDiv"><p class="errorBold">' . ERROR_CUSTOMER_ERROR_1 . (($action == 'insert_multiple' && zen_not_null($_FILES['bulk_upload']['name'])) ? (' (' . $_FILES['bulk_upload']['name'] . ')') : '') . ':' . '</p><ul>';

  foreach ($errors as $line_no=>$error) {
    if (is_array($error)) {
      $infoDivContents .= '<div class="error">' . sprintf(ERROR_ON_LINE, ($line_no+1)) . '</div><ul>';

      foreach ($error as $err) {
        $infoDivContents .= '<li class="error">' . $err. '</li>';
      }
      $infoDivContents .= '</ul>';
    } else {
      $infoDivContents .= '<li class="error">' . $error . '</li>';
    }
  }
  
  $infoDivContents .= '</ul></div>';
}

if (count($feedback)) {
  $infoDivContents .= '<div class="okDiv"><p class="okBold">' . ((count($errors) && $_POST['insert_mode'] == 'file') ? MESSAGE_LINES_OK_NOT_INSERTED : MESSAGE_CUSTOMERS_OK) . '</p><ul>';
 
  foreach ($feedback as $line_no=>$feedback_msg) {
    $infoDivContents .= '<li class="ok">' . (($feedback_msg != '' && !is_array($feedback_msg)) ? $feedback_msg : sprintf(LINE_MSG, $line_no+1, $feedback_msg['customers_firstname'], $feedback_msg['customers_lastname'])) . '</li>';
  }
  
  $infoDivContents .= '</ul></div>';
}

$insert_mode = (isset($_POST['insert_mode'])) ? $_POST['insert_mode'] : 'file';
$newsletter_array = array( array('id' => '1', 'text' => ENTRY_NEWSLETTER_YES), array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO) );

if (isset($_POST['date_format_m'])) {
  $selectedDateFormat_m = (int)$_POST['date_format_m'];
} else {
  $currentDateFormat_m = str_replace('%m', 'MM', str_replace('%d', 'DD', str_replace('%Y', 'YYYY', DATE_FORMAT_SHORT)));
  $selectedDateFormat_m = array_search($currentDateFormat_m, $theFormats);
}
if (isset($_POST['date_format_s'])) {
  $selectedDateFormat_s = (int)$_POST['date_format_s'];
} else {
  $currentDateFormat_s = str_replace('%m', 'MM', str_replace('%d', 'DD', str_replace('%Y', 'YYYY', DATE_FORMAT_SHORT)));
  $selectedDateFormat_s = array_search($currentDateFormat_s, $theFormats);
}

for ($i=0, $n=sizeof($theFormats), $dateFormats=array(); $i<$n; $i++) {
  $dateFormats[$i]['id'] = $i;
  $dateFormats[$i]['text'] = $theFormats[$i];
}

$resendID = (isset($_POST['resend_id'])) ? $_POST['resend_id'] : 0;
?>
  <h1><?php echo HEADING_TITLE; ?></h1>
  <table border="0" width="100%" cellspacing="2" cellpadding="2">
	<tr>
      <td width="100%" valign="top">
        <table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
		    <td id="multiple"><table border="0" cellspacing="2" cellpadding="2">
			  <tr>
                <td id="csv_in">
	    		  <div class="headingLabel"><?php echo CUSTOMERS_BULK_UPLOAD; ?></div>
			  <?php if ($action == 'add_multiple') echo $infoDivContents; ?>
              <?php echo zen_draw_form('customers', FILENAME_ADD_CUSTOMERS, '', 'post', 'enctype="multipart/form-data"') . zen_hide_session_id(). zen_draw_hidden_field( 'action', 'add_multiple'); ?>
                    <div class="formArea"><table border="0" cellspacing="2" cellpadding="2">
                      <tr>
                        <td><div class="back mainLabel"><?php echo CUSTOMERS_FILE_IMPORT; ?></div><input type="file" name="bulk_upload" /></td>
                      </tr>
                      <tr>
                        <td>
                          <div class="back mainLabel"><?php echo CUSTOMERS_INSERT_MODE; ?></div>
                          <div class="back">
                            <input type="radio" name="insert_mode" value="part" <?php echo ($insert_mode == 'part') ? 'checked="checked"' : ''; ?>/><?php echo CUSTOMERS_INSERT_MODE_VALID; ?><br />
                            <input type="radio" name="insert_mode" value="file" <?php echo ($insert_mode == 'file') ? 'checked="checked"' : ''; ?>/><?php echo CUSTOMERS_INSERT_MODE_FILE; ?>
                          </div>
                        </td>
                      </tr>
                      <tr>
	                    <td><div class="back mainLabel"><?php echo DATE_FORMAT_CHOOSE_MULTI; ?></div><?php echo zen_draw_pull_down_menu('date_format_m', $dateFormats, $selectedDateFormat_m); ?></td>
	                  </tr>
                      <tr>
                        <td>
                          <div style="width:350px; text-align: right;">
                            <a href="<?php echo HTTP_SERVER . DIR_WS_CATALOG; ?>add_customers_formatting_csv.html" target="_blank"><?php echo FORMATTING_THE_CSV; ?></a> <input type="submit" name="add_customers_in_bulk" value="Upload" />
                          </div>
                        </td>
                      </tr>
                    </table></div>
                  </form>
                </td>
              </tr>
			  
			  <tr>
			    <td>
	    		  <div class="headingLabel"><?php echo RESEND_WELCOME_EMAIL; ?></div>
			  <?php if ($action == 'resend_email') echo $infoDivContents; ?>
              <?php echo zen_draw_form('resend', FILENAME_ADD_CUSTOMERS, '', 'post', 'enctype="multipart/form-data"') . zen_hide_session_id() . zen_draw_hidden_field ('action', 'resend_email'); ?>
                    <div class="formArea"><table border="0" cellspacing="2" cellpadding="2">
                      <tr>
                        <td><div class="back mainLabel"><?php echo TEXT_CHOOSE_CUSTOMER; ?></div><div class="main"><?php echo zen_draw_pull_down_menu('resend_id', create_customer_drop_down(), $resendID); ?></div></td>
	                  </tr>
                      <tr class="clearBoth">
                        <td><div class="back mainLabel"><?php echo TEXT_RESET_PASSWORD; ?></div><div class="main"><input type="checkbox" id="reset_pw" value="1" name="reset_pw" <?php echo (isset($_POST['reset_pw'])) ? 'checked="checked"' : ''; ?>/></div></td>
                      </tr>
                      <tr>
                        <td>
                          <div style="width:350px; text-align: right;">
                            <input type="submit" name="resend" value="<?php echo BUTTON_RESEND; ?>" />
                          </div>
                        </td>
                      </tr>
                    </table></div>
                  </form>
				</td>
			  </tr>
            </table></td>
			
            <td id="single"><div class="headingLabel"><?php echo CUSTOMERS_SINGLE_ENTRY; ?></div><?php if ($action == 'add_single' && zen_not_null($_POST['insert_x']) && zen_not_null($_POST['insert_y'])) echo $infoDivContents; ?><?php echo zen_draw_form('customers_1', FILENAME_ADD_CUSTOMERS, '', 'post') . zen_hide_session_id() . zen_draw_hidden_field( 'action', 'add_single'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
              </tr>
              <tr>
                <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<?php
  $customers_authorization_array = array( array('id' => '0', 'text' => CUSTOMERS_AUTHORIZATION_0),
                                          array('id' => '1', 'text' => CUSTOMERS_AUTHORIZATION_1),
                                          array('id' => '2', 'text' => CUSTOMERS_AUTHORIZATION_2),
                                          array('id' => '3', 'text' => CUSTOMERS_AUTHORIZATION_3)
                                        );
?>
                  <tr>
                    <td class="main mainLabel"><?php echo CUSTOMERS_AUTHORIZATION; ?></td>
                    <td class="main"><?php echo zen_draw_pull_down_menu('customers_authorization', $customers_authorization_array, $cInfo->customers_authorization); ?></td>
                  </tr>			  
<?php
  if (ACCOUNT_GENDER == 'true') {
?>
                  <tr>
                    <td class="main mainLabel" style="vertical-align:top;"><?php echo ENTRY_GENDER; ?></td>
                    <td class="main">
                      <input type="radio" name="customers_gender" value="m" <?php echo ($cInfo->customers_gender == 'm') ? 'checked' : ''; ?> /><?php echo MALE; ?>
                      <span class="spacer"></span>
                      <input type="radio" name="customers_gender" value="f" <?php echo ($cInfo->customers_gender == 'f') ? 'checked' : ''; ?> /><?php echo FEMALE; ?>
                    </td>
                  </tr>
<?php
  }
?>
                  <tr>
                    <td class="main mainLabel"><?php echo ENTRY_FIRST_NAME; ?></td>
                    <td class="main"><input size="30" name="customers_firstname" value="<?php echo $cInfo->customers_firstname; ?>" /></td>
                  </tr>

                  <tr>
                    <td class="main mainLabel"><?php echo ENTRY_LAST_NAME; ?></td>
                    <td class="main"><input size="30" name="customers_lastname" value="<?php echo $cInfo->customers_lastname; ?>" /></td>
                  </tr>
<?php
  if (ACCOUNT_DOB == 'true') {
?>
                <tr>
	              <td class="back mainLabel"><?php echo DATE_FORMAT_CHOOSE_SINGLE; ?></td>
				  <td class="main"><?php echo zen_draw_pull_down_menu('date_format_s', $dateFormats, $selectedDateFormat_s); ?></td>
  	            </tr>
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
                  <td class="main"><input size="30" name="customers_dob" value="<?php echo $cInfo->customers_dob; ?>" /></td>
                </tr>
<?php
  }
?>
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
                  <td class="main"><input size="30" name="customers_email_address" value="<?php echo $cInfo->customers_email_address; ?>" /></td>
                </tr> 

              </table></td>
            </tr>
<?php
  if (ACCOUNT_COMPANY == 'true') {
?>
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formAreaTitle"><?php echo CATEGORY_COMPANY; ?></td></tr>
            <tr>
              <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_COMPANY; ?></td>
                  <td class="main"><input size="30" name="entry_company" value="<?php echo $cInfo->entry_company; ?>" /></td>
                </tr>
              </table></td>
            </tr>
<?php
  }
?>
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formAreaTitle"><?php echo CATEGORY_ADDRESS; ?></td></tr>
            <tr>
              <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main Label"><?php echo ENTRY_STREET_ADDRESS; ?></td>
                  <td class="main"><input size="30" name="entry_street_address" value="<?php echo $cInfo->entry_street_address; ?>" /></td>
                </tr>           
<?php
  if (ACCOUNT_SUBURB == 'true') {
?>
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_SUBURB; ?></td>
                  <td class="main"><input size="30" name="entry_suburb" value="<?php echo $cInfo->entry_suburb; ?>" /></td>
                </tr>
<?php			  
  }
?>
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_CITY; ?></td>
                  <td class="main"><input size="30" name="entry_city" value="<?php echo $cInfo->entry_city; ?>" /></td>
                </tr>                                   

                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_POST_CODE; ?></td>
                  <td class="main"><input size="30" name="entry_postcode" value="<?php echo $cInfo->entry_postcode; ?>" /></td>
                </tr>
			  
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_COUNTRY; ?></td>
                  <td class="main"><?php echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), (zen_not_null($cInfo->entry_country_id) ? $cInfo->entry_country_id : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY), 'onchange="this.form.submit();"'); ?></td>
                </tr>
<?php
  if (ACCOUNT_STATE == 'true') {
?>
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_STATE; ?></td>
                  <td class="main">
<?php
    $theZones = zen_prepare_country_zones_pull_down ((zen_not_null($cInfo->entry_country_id) ? $cInfo->entry_country_id : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY));
	if (count($theZones) > 1) {
	  echo zen_draw_pull_down_menu('entry_zone_id', $theZones, $cInfo->entry_zone_id);
	  
	} else {
      $entry_state = zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state);
      echo zen_draw_input_field('entry_state', zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state));
	}
  }
?>
                  </td>
                </tr>
              </table></td>
            </tr>
		  
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formAreaTitle"><?php echo CATEGORY_CONTACT; ?></td></tr>
            <tr>
              <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
                  <td class="main"><input size="30" name="customers_telephone" value="<?php echo $cInfo->customers_telephone; ?>" /></td>
                </tr>
<?php
  if (ACCOUNT_FAX_NUMBER == 'true') {
?>
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_FAX_NUMBER; ?></td>
                  <td class="main"><input size="30" name="customers_fax" value="<?php echo $cInfo->customers_fax; ?>" /></td>
                </tr>
<?php
  }
?>
              </table></td>
            </tr>
		  
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formAreaTitle"><?php echo CATEGORY_OPTIONS; ?></td></tr>
            <tr>
              <td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_EMAIL_PREFERENCE; ?></td>
                  <td class="main">
<?php
  $email_pref_text = ( (empty($cInfo) && ACCOUNT_EMAIL_PREFERENCE != '1') || $cInfo->customers_email_format == 'TEXT' ) ? true : false;
  $email_pref_html = !$email_pref_text;
  echo zen_draw_radio_field('customers_email_format', 'HTML', $email_pref_html) . ' ' . ENTRY_EMAIL_HTML_DISPLAY . '   ' . zen_draw_radio_field('customers_email_format', 'TEXT', $email_pref_text) . ' ' . ENTRY_EMAIL_TEXT_DISPLAY ;
?>
                  </td>
                </tr>
			  
                <tr>
                  <td class="main Label"><?php echo ENTRY_NEWSLETTER; ?></td>
                  <td class="main"><?php echo zen_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0')); ?></td>
                </tr>
			  
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_PRICING_GROUP; ?></td>
                  <td class="main">
<?php
  $group_array_query = $db->execute("select group_id, group_name, group_percentage from " . TABLE_GROUP_PRICING);
  $group_array[] = array('id'=>0, 'text'=>TEXT_NONE);

  while (!$group_array_query->EOF) {
    $group_array[] = array('id'=>$group_array_query->fields['group_id'], 'text'=>$group_array_query->fields['group_name'].' '.$group_array_query->fields['group_percentage'].'%');
    $group_array_query->MoveNext();
  }

  echo zen_draw_pull_down_menu('customers_group_pricing', $group_array, $cInfo->customers_group_pricing);
?>
                  </td>
                </tr>
<?php
  if (CUSTOMERS_REFERRAL_STATUS == 2) {
?>
                <tr>
                  <td class="main mainLabel"><?php echo CUSTOMERS_REFERRAL; ?></td>
                  <td class="main"><?php echo zen_draw_input_field('customers_referral', $cInfo->customers_referral, zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15)); ?></td>
                </tr>
<?php
  }
?>
                <tr>
                  <td class="main mainLabel"><?php echo ENTRY_EMAIL; ?></td>
                  <td class="main"><input type="checkbox" id="send_welcome" value="1" name="send_welcome" <?php echo (isset($_POST['send_welcome'])) ? 'checked="checked"' : ''; ?>/></td>
                </tr>
              </table></td>
            </tr>
		  
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr>
              <td align="right" class="main"><?php echo zen_image_submit('button_insert.gif', IMAGE_UPDATE, 'name="insert"'); ?><a href="<?php echo zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('action')), 'NONSSL'); ?>"><?php echo zen_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a></td>
            </tr>
	  	</table></form></td></tr>

      </table>
	</td>
  </tr>
</table>
<?php
require(DIR_WS_INCLUDES . 'footer.php');
?>
<br />
</body>
</html>
<?php
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
2 Jul 2014, 5:52 PM
#215
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Location:
Nova Scotia
Posts:
39
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

MaartenJ:

Allright, coded the update function after my diner. When a customer updates his or her information on the "my account" page, this change will be synced with your Mail Chimp list. Here's how I dit it:

In mailchimp_functions.php from this great module I added my own function at the end of the file. Note that I added a field for Firstname and Lastname. You can do that, but if you don't want to just delete everything with firstname and lastname in it:

//Mailchimp update function: update customers data to the mailchimp list.
function mailchimp_update($email_address_old, $email_address, $firstname, $lastname, $email_format) {
include_once(DIR_WS_CLASSES . "MCAPI.class.php");
$api = new MCAPI(BOX_MAILCHIMP_NEWSLETTER_API_KEY);
$merge_vars = array('FNAME'=>$firstname, 'LNAME'=>$lastname, 'EMAIL'=>$email_address);
if ($email_format == 'TEXT') {
$format = 'text';
} else {
$format = 'html';
}

$list_id = BOX_MAILCHIMP_NEWSLETTER_ID; 
$retval = $api->listUpdateMember($list_id, $email_address_old, $merge_vars, $format);
if ($api->errorCode){
    $errorMessage = "Unable to update member info with listUpdateMember()!\n" . 
       "\tCode=".$api->errorCode."\n" .
       "\tMsg=".$api->errorMessage."\n";
      $file = DIR_FS_SQL_CACHE . '/' . 'MailChimp.log';
      if ($fp = @fopen($file, 'a')) {
        fwrite($fp, $errorMessage);
        fclose($fp);
      }
}

}

> 
> In htdocs/includes/templates/YOURTEMPLATE/templates/tpl_account_edit_default.php you must make an invisible field to be able to pass the old email address (email_address_old) to the mailchimp_update() function. I've placed this line below the entry for the e-mail address, but you can paste in anywhere as long as it is within the form:
> 
> ```php
<?php echo zen_draw_hidden_field('email_address_old', $account->fields['customers_email_address'], 'id="email-address-old"') ?>

At last you must make a call to the function. When the form is submitted it will use /includes/modules/pages/account_edit/header_php.php to make all the magic happen. Paste the following around line 154 above the line:
$zco_notifier->notify('NOTIFY_HEADER_ACCOUNT_EDIT_UPDATES_COMPLETE');

mailchimp_update($email_address_old, $email_address, $firstname, $lastname, $email_format);

> 
> That's all! Now your mailchimp list will be updated as soon as your customer edits his or her information! Next thing to do is to make a sync for the "Subscribe or unsubscribe from newsletters." page.

I would like to do this can anyone see if there is anything wrong with the code above as my customers can sign up using create account or side box it works perfect. If that person unsubscribes from my account link it works fine but if they click the check-box from my account to signup again it does not resign them up.
13 Jul 2014, 5:39 PM
#216
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

shopville:

hello,
i'm using the add customer mod to add customer from admin, can we trigger mailchimp when adding a customer from admin? I assume this

if ((int)$newsletter == 1) {
mailchimp_add($email_address, $email_format);
}

> is suppose to go in somewhere in the add_customers.php file
> 
> here is the contents of my add_customers.php:
> ```php
<?php
/**
 * @copyright copyright 2003-2010 zen cart development team
 * @copyright portions copyright 2003 oscommerce
 * @license http://www.zen-cart.com/license/2_0.txt gnu public license v2.0
 *
 * add_customers module modified by garden 2012-07-20
 * www.inzencart.cz czech forum for zencart
 * modified for zen cart 1.5.0, lat9 2012-08-31
 */
require('includes/application_top.php');

require(dir_ws_classes . 'currencies.php');
$currencies = new currencies();

$action = (isset($_post['action'])) ? $_post['action'] : False;
$error = false;
$processed = false;
$cinfo = array();
$theformats = array('yyyy/mm/dd', 'mm/dd/yyyy', 'yyyy-mm-dd', 'mm-dd-yyyy', 'yyyy/dd/mm', 'dd/mm/yyyy', 'yyyy-dd-mm', 'dd-mm-yyyy');

require_once('add_customers_backend.php');

// ---- determine what to do next ... Single add vs. Country change vs. Multiple/file add
if (zen_not_null($action)) {
  switch ($action) {
    case 'add_single':
      $array = validate_customer($_post, 'date_format_s');
      $errors = $array['errors'];
      $cinfo = $array['cinfo'];

      if (count($errors) < 1) {
        $customername = insert_customer($_post);
        $feedback = sprintf( message_customer_ok, $customername);
      }
	  break;
	  
	case 'add_multiple':
      $array = check_file_upload();
      $errors = $array['errors'];
      $feedback = $array['feedback'];
	  break;
	  
	case 'resend_email':
      If (!isset($_post['resend_id'])) {
	    $errors[] = error_no_customer_selected;
		
      } else {	  
        $sql = "select customers_gender, customers_firstname, customers_lastname, customers_email_address from " . Table_customers . " where customers_id = '" . (int)$_post['resend_id'] . "'";
        $custinfo = $db->execute($sql);
		if ($custinfo->recordcount() == 0) {
		  $errors[] = error_no_customer_selected;
		  
		} else {
		  $thepassword = false;
		  if (isset($_post['reset_pw']) && $_post['reset_pw'] == 1) {
		    $thepassword = zen_create_random_value(entry_password_min_length);
            $sql = "update " . Table_customers . "
                    set customers_password = '" . Zen_encrypt_password($thepassword) . "'
                    where customers_id = '" . (int)$_post['resend_id'] . "'";
            $db->execute($sql);
		  }
          sendwelcomeemail ($custinfo->fields['customers_gender'], $custinfo->fields['customers_firstname'], $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], $thepassword);
		  
		  $feedback[] = customer_email_resent;
		}
      }
	  break;
	  
	default:
	  Break;
  }
}
?>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<html <?php echo html_params; ?>>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php echo charset; ?>">
<title><?php echo title; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<link rel="stylesheet" type="text/css" href="includes/stylesheet_acfa.css">
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverjs">

<script type="text/javascript" src="includes/menu.js"></script>
<script type="text/javascript" src="includes/general.js"></script>
<script type="text/javascript">

function init()
{
  cssjsmenu(\'navbar\');
  if (document.getelementbyid)
  {
    var kill = document.getelementbyid(\'hoverjs\');
    kill.disabled = true;
  }
}

</script>

</head>

<body onload="init()">
<?php
require(dir_ws_includes . 'header.php');

$infodivcontents = '';
if (count($errors) > 0) {
  $infodivcontents = '<div class="errordiv"><p class="errorbold">' . Error_customer_error_1 . (($action == 'insert_multiple' && zen_not_null($_files['bulk_upload']['name'])) ? (' (' . $_files['bulk_upload']['name'] . ')') : '') . ':' . '</p><ul>';

  foreach ($errors as $line_no=>$error) {
    if (is_array($error)) {
      $infodivcontents .= '<div class="error">' . Sprintf(error_on_line, ($line_no+1)) . '</div><ul>';

      foreach ($error as $err) {
        $infodivcontents .= '<li class="error">' . $err. '</li>';
      }
      $infodivcontents .= '</ul>';
    } else {
      $infodivcontents .= '<li class="error">' . $error . '</li>';
    }
  }
  
  $infodivcontents .= '</ul></div>';
}

if (count($feedback)) {
  $infodivcontents .= '<div class="okdiv"><p class="okbold">' . ((count($errors) && $_post['insert_mode'] == 'file') ? Message_lines_ok_not_inserted : Message_customers_ok) . '</p><ul>';
 
  foreach ($feedback as $line_no=>$feedback_msg) {
    $infodivcontents .= '<li class="ok">' . (($feedback_msg != '' && !is_array($feedback_msg)) ? $feedback_msg : Sprintf(line_msg, $line_no+1, $feedback_msg['customers_firstname'], $feedback_msg['customers_lastname'])) . '</li>';
  }
  
  $infodivcontents .= '</ul></div>';
}

$insert_mode = (isset($_post['insert_mode'])) ? $_post['insert_mode'] : 'file';
$newsletter_array = array( array('id' => '1', 'text' => entry_newsletter_yes), array('id' => '0', 'text' => entry_newsletter_no) );

if (isset($_post['date_format_m'])) {
  $selecteddateformat_m = (int)$_post['date_format_m'];
} else {
  $currentdateformat_m = str_replace('%m', 'mm', str_replace('%d', 'dd', str_replace('%y', 'yyyy', date_format_short)));
  $selecteddateformat_m = array_search($currentdateformat_m, $theformats);
}
if (isset($_post['date_format_s'])) {
  $selecteddateformat_s = (int)$_post['date_format_s'];
} else {
  $currentdateformat_s = str_replace('%m', 'mm', str_replace('%d', 'dd', str_replace('%y', 'yyyy', date_format_short)));
  $selecteddateformat_s = array_search($currentdateformat_s, $theformats);
}

for ($i=0, $n=sizeof($theformats), $dateformats=array(); $i<$n; $i++) {
  $dateformats[$i]['id'] = $i;
  $dateformats[$i]['text'] = $theformats[$i];
}

$resendid = (isset($_post['resend_id'])) ? $_post['resend_id'] : 0;
?>
  <h1><?php echo heading_title; ?></h1>
  <table border="0" width="100%" cellspacing="2" cellpadding="2">
	<tr>
      <td width="100%" valign="top">
        <table border="0" width="100%" cellspacing="0" cellpadding="2">
          <tr>
		    <td id="multiple"><table border="0" cellspacing="2" cellpadding="2">
			  <tr>
                <td id="csv_in">
	    		  <div class="headinglabel"><?php echo customers_bulk_upload; ?></div>
			  <?php if ($action == 'add_multiple') echo $infodivcontents; ?>
              <?php echo zen_draw_form('customers', filename_add_customers, '', 'post', 'enctype="multipart/form-data"') . Zen_hide_session_id(). Zen_draw_hidden_field( 'action', 'add_multiple'); ?>
                    <div class="formarea"><table border="0" cellspacing="2" cellpadding="2">
                      <tr>
                        <td><div class="back mainlabel"><?php echo customers_file_import; ?></div><input type="file" name="bulk_upload" /></td>
                      </tr>
                      <tr>
                        <td>
                          <div class="back mainlabel"><?php echo customers_insert_mode; ?></div>
                          <div class="back">
                            <input type="radio" name="insert_mode" value="part" <?php echo ($insert_mode == 'part') ? 'checked="checked"' : ''; ?>/><?php echo customers_insert_mode_valid; ?><br />
                            <input type="radio" name="insert_mode" value="file" <?php echo ($insert_mode == 'file') ? 'checked="checked"' : ''; ?>/><?php echo customers_insert_mode_file; ?>
                          </div>
                        </td>
                      </tr>
                      <tr>
	                    <td><div class="back mainlabel"><?php echo date_format_choose_multi; ?></div><?php echo zen_draw_pull_down_menu('date_format_m', $dateformats, $selecteddateformat_m); ?></td>
	                  </tr>
                      <tr>
                        <td>
                          <div style="width:350px; text-align: Right;">
                            <a href="<?php echo http_server . Dir_ws_catalog; ?>add_customers_formatting_csv.html" target="_blank"><?php echo formatting_the_csv; ?></a>##<input type="submit" name="add_customers_in_bulk" value="upload" />
                          </div>
                        </td>
                      </tr>
                    </table></div>
                  </form>
                </td>
              </tr>
			  
			  <tr>
			    <td>
	    		  <div class="headinglabel"><?php echo resend_welcome_email; ?></div>
			  <?php if ($action == 'resend_email') echo $infodivcontents; ?>
              <?php echo zen_draw_form('resend', filename_add_customers, '', 'post', 'enctype="multipart/form-data"') . Zen_hide_session_id() . Zen_draw_hidden_field ('action', 'resend_email'); ?>
                    <div class="formarea"><table border="0" cellspacing="2" cellpadding="2">
                      <tr>
                        <td><div class="back mainlabel"><?php echo text_choose_customer; ?></div><div class="main"><?php echo zen_draw_pull_down_menu('resend_id', create_customer_drop_down(), $resendid); ?></div></td>
	                  </tr>
                      <tr class="clearboth">
                        <td><div class="back mainlabel"><?php echo text_reset_password; ?></div><div class="main"><input type="checkbox" id="reset_pw" value="1" name="reset_pw" <?php echo (isset($_post['reset_pw'])) ? 'checked="checked"' : ''; ?>/></div></td>
                      </tr>
                      <tr>
                        <td>
                          <div style="width:350px; text-align: Right;">
                            <input type="submit" name="resend" value="<?php echo button_resend; ?>" />
                          </div>
                        </td>
                      </tr>
                    </table></div>
                  </form>
				</td>
			  </tr>
            </table></td>
			
            <td id="single"><div class="headinglabel"><?php echo customers_single_entry; ?></div><?php if ($action == 'add_single' && zen_not_null($_post['insert_x']) && zen_not_null($_post['insert_y'])) echo $infodivcontents; ?><?php echo zen_draw_form('customers_1', filename_add_customers, '', 'post') . Zen_hide_session_id() . Zen_draw_hidden_field( 'action', 'add_single'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td class="formareatitle"><?php echo category_personal; ?></td>
              </tr>
              <tr>
                <td class="formarea"><table border="0" cellspacing="2" cellpadding="2">
<?php
  $customers_authorization_array = array( array('id' => '0', 'text' => customers_authorization_0),
                                          array('id' => '1', 'text' => customers_authorization_1),
                                          array('id' => '2', 'text' => customers_authorization_2),
                                          array('id' => '3', 'text' => customers_authorization_3)
                                        );
?>
                  <tr>
                    <td class="main mainlabel"><?php echo customers_authorization; ?></td>
                    <td class="main"><?php echo zen_draw_pull_down_menu('customers_authorization', $customers_authorization_array, $cinfo->customers_authorization); ?></td>
                  </tr>			  
<?php
  if (account_gender == 'true') {
?>
                  <tr>
                    <td class="main mainlabel" style="vertical-align:top;"><?php echo entry_gender; ?></td>
                    <td class="main">
                      <input type="radio" name="customers_gender" value="m" <?php echo ($cinfo->customers_gender == 'm') ? 'checked' : ''; ?> /><?php echo male; ?>
                      <span class="spacer"></span>
                      <input type="radio" name="customers_gender" value="f" <?php echo ($cinfo->customers_gender == 'f') ? 'checked' : ''; ?> /><?php echo female; ?>
                    </td>
                  </tr>
<?php
  }
?>
                  <tr>
                    <td class="main mainlabel"><?php echo entry_first_name; ?></td>
                    <td class="main"><input size="30" name="customers_firstname" value="<?php echo $cinfo->customers_firstname; ?>" /></td>
                  </tr>

                  <tr>
                    <td class="main mainlabel"><?php echo entry_last_name; ?></td>
                    <td class="main"><input size="30" name="customers_lastname" value="<?php echo $cinfo->customers_lastname; ?>" /></td>
                  </tr>
<?php
  if (account_dob == 'true') {
?>
                <tr>
	              <td class="back mainlabel"><?php echo date_format_choose_single; ?></td>
				  <td class="main"><?php echo zen_draw_pull_down_menu('date_format_s', $dateformats, $selecteddateformat_s); ?></td>
  	            </tr>
                <tr>
                  <td class="main mainlabel"><?php echo entry_date_of_birth; ?></td>
                  <td class="main"><input size="30" name="customers_dob" value="<?php echo $cinfo->customers_dob; ?>" /></td>
                </tr>
<?php
  }
?>
                <tr>
                  <td class="main mainlabel"><?php echo entry_email_address; ?></td>
                  <td class="main"><input size="30" name="customers_email_address" value="<?php echo $cinfo->customers_email_address; ?>" /></td>
                </tr> 

              </table></td>
            </tr>
<?php
  if (account_company == 'true') {
?>
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formareatitle"><?php echo category_company; ?></td></tr>
            <tr>
              <td class="formarea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main mainlabel"><?php echo entry_company; ?></td>
                  <td class="main"><input size="30" name="entry_company" value="<?php echo $cinfo->entry_company; ?>" /></td>
                </tr>
              </table></td>
            </tr>
<?php
  }
?>
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formareatitle"><?php echo category_address; ?></td></tr>
            <tr>
              <td class="formarea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main label"><?php echo entry_street_address; ?></td>
                  <td class="main"><input size="30" name="entry_street_address" value="<?php echo $cinfo->entry_street_address; ?>" /></td>
                </tr>           
<?php
  if (account_suburb == 'true') {
?>
                <tr>
                  <td class="main mainlabel"><?php echo entry_suburb; ?></td>
                  <td class="main"><input size="30" name="entry_suburb" value="<?php echo $cinfo->entry_suburb; ?>" /></td>
                </tr>
<?php			  
  }
?>
                <tr>
                  <td class="main mainlabel"><?php echo entry_city; ?></td>
                  <td class="main"><input size="30" name="entry_city" value="<?php echo $cinfo->entry_city; ?>" /></td>
                </tr>                                   

                <tr>
                  <td class="main mainlabel"><?php echo entry_post_code; ?></td>
                  <td class="main"><input size="30" name="entry_postcode" value="<?php echo $cinfo->entry_postcode; ?>" /></td>
                </tr>
			  
                <tr>
                  <td class="main mainlabel"><?php echo entry_country; ?></td>
                  <td class="main"><?php echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), (zen_not_null($cinfo->entry_country_id) ? $cinfo->entry_country_id : Show_create_account_default_country), 'onchange="this.form.submit();"'); ?></td>
                </tr>
<?php
  if (account_state == 'true') {
?>
                <tr>
                  <td class="main mainlabel"><?php echo entry_state; ?></td>
                  <td class="main">
<?php
    $thezones = zen_prepare_country_zones_pull_down ((zen_not_null($cinfo->entry_country_id) ? $cinfo->entry_country_id : Show_create_account_default_country));
	if (count($thezones) > 1) {
	  echo zen_draw_pull_down_menu('entry_zone_id', $thezones, $cinfo->entry_zone_id);
	  
	} else {
      $entry_state = zen_get_zone_name($cinfo->entry_country_id, $cinfo->entry_zone_id, $cinfo->entry_state);
      echo zen_draw_input_field('entry_state', zen_get_zone_name($cinfo->entry_country_id, $cinfo->entry_zone_id, $cinfo->entry_state));
	}
  }
?>
                  </td>
                </tr>
              </table></td>
            </tr>
		  
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formareatitle"><?php echo category_contact; ?></td></tr>
            <tr>
              <td class="formarea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main mainlabel"><?php echo entry_telephone_number; ?></td>
                  <td class="main"><input size="30" name="customers_telephone" value="<?php echo $cinfo->customers_telephone; ?>" /></td>
                </tr>
<?php
  if (account_fax_number == 'true') {
?>
                <tr>
                  <td class="main mainlabel"><?php echo entry_fax_number; ?></td>
                  <td class="main"><input size="30" name="customers_fax" value="<?php echo $cinfo->customers_fax; ?>" /></td>
                </tr>
<?php
  }
?>
              </table></td>
            </tr>
		  
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr><td class="formareatitle"><?php echo category_options; ?></td></tr>
            <tr>
              <td class="formarea"><table border="0" cellspacing="2" cellpadding="2">
                <tr>
                  <td class="main mainlabel"><?php echo entry_email_preference; ?></td>
                  <td class="main">
<?php
  $email_pref_text = ( (empty($cinfo) && account_email_preference != '1') || $cinfo->customers_email_format == 'text' ) ? True : False;
  $email_pref_html = !$email_pref_text;
  echo zen_draw_radio_field('customers_email_format', 'html', $email_pref_html) . '##' . Entry_email_html_display . '######' . Zen_draw_radio_field('customers_email_format', 'text', $email_pref_text) . '##' . Entry_email_text_display ;
?>
                  </td>
                </tr>
			  
                <tr>
                  <td class="main label"><?php echo entry_newsletter; ?></td>
                  <td class="main"><?php echo zen_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cinfo->customers_newsletter == '1') ? '1' : '0')); ?></td>
                </tr>
			  
                <tr>
                  <td class="main mainlabel"><?php echo entry_pricing_group; ?></td>
                  <td class="main">
<?php
  $group_array_query = $db->execute("select group_id, group_name, group_percentage from " . Table_group_pricing);
  $group_array[] = array('id'=>0, 'text'=>text_none);

  while (!$group_array_query->eof) {
    $group_array[] = array('id'=>$group_array_query->fields['group_id'], 'text'=>$group_array_query->fields['group_name'].'##'.$group_array_query->fields['group_percentage'].'%');
    $group_array_query->movenext();
  }

  echo zen_draw_pull_down_menu('customers_group_pricing', $group_array, $cinfo->customers_group_pricing);
?>
                  </td>
                </tr>
<?php
  if (customers_referral_status == 2) {
?>
                <tr>
                  <td class="main mainlabel"><?php echo customers_referral; ?></td>
                  <td class="main"><?php echo zen_draw_input_field('customers_referral', $cinfo->customers_referral, zen_set_field_length(table_customers, 'customers_referral', 15)); ?></td>
                </tr>
<?php
  }
?>
                <tr>
                  <td class="main mainlabel"><?php echo entry_email; ?></td>
                  <td class="main"><input type="checkbox" id="send_welcome" value="1" name="send_welcome" <?php echo (isset($_post['send_welcome'])) ? 'checked="checked"' : ''; ?>/></td>
                </tr>
              </table></td>
            </tr>
		  
            <tr><td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
            <tr>
              <td align="right" class="main"><?php echo zen_image_submit('button_insert.gif', image_update, 'name="insert"'); ?><a href="<?php echo zen_href_link(filename_customers, zen_get_all_get_params(array('action')), 'nonssl'); ?>"><?php echo zen_image_button('button_cancel.gif', image_cancel); ?></a></td>
            </tr>
	  	</table></form></td></tr>

      </table>
	</td>
  </tr>
</table>
<?php
require(dir_ws_includes . 'footer.php');
?>
<br />
</body>
</html>
<?php
require(dir_ws_includes . 'application_bottom.php');
?>

bump...

13 Jul 2014, 6:19 PM
#217
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Location:
Nova Scotia
Posts:
39
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Your still going to have the same problem if the customer decides to come off that mail list from their ZENcart login it will take them off but if they then decide to opt back in it will add the check box but not sign them back up to mailchimp.

14 Jul 2014, 12:21 AM
#218
tnjon avatar

tnjon

New Zenner

Join Date:
Apr 2006
Posts:
67
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Are they away to put a link in the footer to go to the sign up page of mail chimp newsletter?

14 Jul 2014, 12:29 AM
#219
hfxracing avatar

hfxracing

New Zenner

Join Date:
May 2011
Location:
Nova Scotia
Posts:
39
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

You could or they could sign up again with the side box but People don't always do what we would like them to do, so like other things you have anticipate what people might do. & they could click the check box to sign up again.

14 Jul 2014, 12:38 AM
#220
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: MailChimp Newsletter Sidebox

tnjon:

Are they away to put a link in the footer to go to the sign up page of mail chimp newsletter?

Certainly you could do this. Mailchimp gives you a hosted signup page which you can find by logging into your account and poking around. Then add this link to your includes/templates/YOUR_TEMPLATE/common/tpl_footer.php file, or make an ez page link out of it, etc.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.