Zen Cart Logo
Forums / All Other Contributions/Addons / Newsletter-Only Subscriptions for v1.3x

Newsletter-Only Subscriptions for v1.3x

Views: 295,983

Results 1,141 to 1,160 of 1,165
1 Jun 2015, 11:22 PM
#1141
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Newsletter-Only Subscriptions for v1.3x

Nick1973:

I installed this on 1.5.4 but don't see any links to firstly upgrade the database and secondly no link Subscription Manager under the customers menu. Is this ready for 1.5.4?
Nope, it was never updated for the Zen Cart v1.3 to v1.5 change in the admin-level interfaces. I'm guessing that the number of core files that the plugin carves up is one of the reasons that no one has picked up the plugin's "baton".

23 Nov 2015, 8:45 PM
#1142
lina0962 avatar

lina0962

Zen Follower

Join Date:
Jun 2006
Posts:
403
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

I created a define_subscribe_confirm.php under /includes/languages/english/html_includes, but when i clicked the link in the email, I was brought back to Newsletter Subscription page, not Newsletter Subscription Confirmation page I added. How to fix it?

4 Nov 2017, 9:59 PM
#1143
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
858
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

Hey All,
Any chance this module works in 1.5.5?

Thanks, John

5 Nov 2017, 1:35 AM
#1144
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,845
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

unlikely to work on 1.5.5

5 Nov 2017, 9:45 AM
#1145
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
858
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

well it took quite a bit of file merging, but it does work. Definitely not good to just upload into a 1.5.5 file set.

John

11 Dec 2017, 1:17 PM
#1146
lina0962 avatar

lina0962

Zen Follower

Join Date:
Jun 2006
Posts:
403
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

I didn't click "yes" for Display on Menu button, so I cannot see the "Subscriber Manager" under "customers". How can I fix it? I am so upset with myself.....

7 Feb 2018, 3:58 PM
#1147
tmccaff avatar

tmccaff

Zen Follower

Join Date:
Jan 2018
Posts:
157
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

I updated version waiting on approval. I added an admin page and made changes for it to work with 1.5.5.

31 Mar 2018, 4:22 AM
#1148
millsii avatar

millsii

New Zenner

Join Date:
Mar 2018
Location:
Perth, WA
Posts:
10
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

kamelion0927:

In includes/modules/your_template/create_account.php, find the code between // BEGIN newsletter_subscribe mod 1/1 and // END newsletter_subscribe mod 1/1 and try replacing it with:

// BEGIN newsletter_subscribe mod 1/1
// If a newsletter only account exists we update the info,
// but keep the subscription active, and give them a message that to
// change they should do so on their account page (after creation).
if(defined('NEWSONLY_SUBSCRIPTION_ENABLED') && (NEWSONLY_SUBSCRIPTION_ENABLED=='true')) {
$check_subscribers_query = "select count(*) as total from " . TABLE_SUBSCRIBERS . "
where email_address = '" . zen_db_input($email_address) . "' ";
$check_subscribers = $db->Execute($check_subscribers_query);
if ($check_subscribers->fields['total'] > 0) {
$sql = "UPDATE " . TABLE_SUBSCRIBERS . " SET
customers_id = '" . (int)$_SESSION['customer_id'] . "',
email_format = '" . zen_db_input($email_format) . "',
confirmed = '1'
WHERE email_address = '" . zen_db_input($email_address) . "' ";
$db->Execute($sql);
$messageStack->add_session('login', SUBSCRIBE_MERGED_NEWSONLY_ACCT);
} else {
if (!empty($newsletter)) {
$sql = "INSERT INTO " . TABLE_SUBSCRIBERS . "
(customers_id, email_address, email_format, confirmed, subscribed_date)
VALUES ('" . (int)$_SESSION['customer_id'] . "', '" . zen_db_input($email_address) . "', '" . zen_db_input($email_format) . "', '1', now())";
$db->Execute($sql);
}
}
}
// END newsletter_subscribe mod 1/1


I was having the same issue in getting the "1062 Duplicate entry" error when a newsletter subscriber then tried to create an account. This has resolved the issue for me. It does shorten the section of code a fair amount, so hopefully no side effects.

Should this fix by @kamelion0927 be updated in the plugin release?
7 Apr 2018, 12:34 AM
#1149
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Newsletter-Only Subscriptions for v1.3x

millsii:

I was having the same issue in getting the "1062 Duplicate entry" error when a newsletter subscriber then tried to create an account. This has resolved the issue for me. It does shorten the section of code a fair amount, so hopefully no side effects.

Should this fix by @kamelion0927 be updated in the plugin release?

I've been using this mod for some time, but during one of my upgrades the create account side wasn't working to catch existing subscriptions. I tried adding your code and no luck on that ether. Going back to what I needed it to do, I came up with this change.

// BEGIN newsletter_subscribe mod 1/1 
// If a newsletter only account exists we update the info, 
// If not and the new user selected subscribe we add them to the list
 
   if(defined('NEWSONLY_SUBSCRIPTION_ENABLED') && (NEWSONLY_SUBSCRIPTION_ENABLED=='true')) { 
    
      $check_subscribers_sql = "select email_address from " . TABLE_SUBSCRIBERS . " where email_address = :email:";       
      $check_subscribers_query = $db->bindVars($check_subscribers_sql, ':email:', $email_address, 'string');       
      $check_subscribers = $db->Execute($check_subscribers_query); 
 
      if ($check_subscribers->fields['email_address'] != '') {
        // update Subscriber with new customer ID 
        $sql = "UPDATE " . TABLE_SUBSCRIBERS . " 
                 SET customers_id = :customer_id: 
                 WHERE email_address = :email_address:"; 
         $sql = $db->bindVars($sql, ':customer_id:', (int)$_SESSION['customer_id'], 'integer'); 
         $sql = $db->bindVars($sql, ':email_address:', $email_address, 'string'); 
        $db->Execute($sql); 
        // update the new customer with an active subscription
        $news_query = "UPDATE " . TABLE_CUSTOMERS . " 
                 SET customers_newsletter = 1 
                 WHERE customers_id = :customer_id:"; 
         $news_query = $db->bindVars($news_query, ':customer_id:', (int)$_SESSION['customer_id'], 'integer'); 
        $db->Execute($news_query);
         
      } else {
        if ($newsletter == 1) {
          // new customer subscription we need to add them to our subscription database too
          $sql = "INSERT INTO " . TABLE_SUBSCRIBERS . " (customers_id, email_address, email_format, confirmed, subscribed_date)
                  VALUES ('" . (int)$_SESSION['customer_id'] . "', '" . zen_db_input($email_address) . "', '" . zen_db_input($email_format) . "', '1', now())";
          $db->Execute($sql);
        }
      }  
    }
/* END newsletter_subscribe mod 1/1 */

I removed count for matching email address, should only be one and I'm not in a loop. Removed the empty test, it's never empty and I need to know if its a 1. Tested in ZC 1.5.5f and working.

17 Aug 2018, 2:48 PM
#1150
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Newsletter-Only Subscriptions for v1.3x

Does anybody know how I can use Google Recaptcha with this please?

Contribution found here:

https://www.zen-cart.com/downloads.php?do=file&id=1455

23 Oct 2018, 9:20 PM
#1151
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

Nick1973:

Does anybody know how I can use Google Recaptcha with this please?

Contribution found here:

https://www.zen-cart.com/downloads.php?do=file&id=1455

Yes i'd like to do that also as we are being spammed constantly without it.

12 Jun 2019, 12:07 PM
#1152
swguy avatar

swguy

Administrator

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

Re: Newsletter-Only Subscriptions for v1.3x

Updated for 1.5.6.

5 Jun 2020, 2:06 AM
#1153
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

zen cart version:1.55f
newsletter_subscribe_3.0.2

Can't send mail
Attachment 19031

Attachment 19029

I try to close
Configuration -> My Store -> Enable Newsletter-only subscriptions? -> false
it's work
Attachment 19030

:blink:May I ask where the plugin is not set correctly?

8 Sep 2020, 11:11 PM
#1154
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Newsletter-Only Subscriptions for v1.3x

I sent in an update for ZC1.5.7 and it's posted. I just found that the header add-in didn't get coded correctly in my default install on the version I sent in. Fixed and sent into GitHub, will wait and see what else I missed before sending in another update.

6 Feb 2021, 11:47 PM
#1155
wulf359 avatar

wulf359

New Zenner

Join Date:
Feb 2008
Posts:
44
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

davewest:

I sent in an update for ZC1.5.7 and it's posted. I just found that the header add-in didn't get coded correctly in my default install on the version I sent in. Fixed and sent into GitHub, will wait and see what else I missed before sending in another update.

This site has begun pulling this error after upgrading to 1.5.7b:

[06-Feb-2021 17:40:05 America/Chicago] Request URI: /zc_admin/index.php?cmd=subscription_manager&action=purgeunconfirmed, IP address: 74.175.45.91
--> PHP Fatal error: Uncaught Error: Call to undefined function zen_admin_demo() in /home3//public_html/zc_admin/subscription_manager.php:134
Stack trace:
#0 /home3/
/public_html/zc_admin/index.php(11): require()
#1 {main}
thrown in /home3/*****/public_html/zc_admin/subscription_manager.php on line 134.

Any help would be appreciated

7 Feb 2021, 4:47 AM
#1156
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Newsletter-Only Subscriptions for v1.3x

Wulf359:

This site has begun pulling this error after upgrading to 1.5.7b:

ZC1.5.7b, in version 3.1 of this mod (zen_admin_demo) was replaced, but after looking, it was one area that was untouched and needed some more work. You may still be using an older version of the admin page.. I would pull a copy off GitHub and compare. I just pushed up the change as follows..

        case 'purgeunconfirmed':
           
           $expireTest = $db->Execute('SELECT COUNT(*) AS total FROM ' . TABLE_SUBSCRIBERS . ' WHERE confirmed != 1 and (customers_id IS NULL or customers_id = 0) and DATE_SUB(CURDATE(),INTERVAL 30 DAY) > subscribed_date ');
          if($expireTest->fields['total'] > 0) {
            $db->Execute('delete from ' . TABLE_SUBSCRIBERS . ' where confirmed != 1 and (customers_id IS NULL or customers_id = 0) and DATE_SUB(CURDATE(),INTERVAL 30 DAY) > subscribed_date ');
            $messageStack->add(TEXT_INFO_SUBSCRIPTIONS_PURGED, 'success');
          } else {
            $messageStack->add(TEXT_ERROR_SUBSCRIPTIONS_PURGED, 'info');
          }
          
          $action = '';
         break;

Well send an update shortly..

7 Feb 2021, 4:55 AM
#1157
wulf359 avatar

wulf359

New Zenner

Join Date:
Feb 2008
Posts:
44
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

davewest:

ZC1.5.7b, in version 3.1 of this mod (zen_admin_demo) was replaced, but after looking, it was one area that was untouched and needed some more work. You may still be using an older version of the admin page.. I would pull a copy off GitHub and compare. I just pushed up the change as follows..

    case 'purgeunconfirmed':
       
       $expireTest = $db->Execute('SELECT COUNT(*) AS total FROM ' . TABLE_SUBSCRIBERS . ' WHERE confirmed != 1 and (customers_id IS NULL or customers_id = 0) and DATE_SUB(CURDATE(),INTERVAL 30 DAY) > subscribed_date ');
      if($expireTest->fields['total'] > 0) {
        $db->Execute('delete from ' . TABLE_SUBSCRIBERS . ' where confirmed != 1 and (customers_id IS NULL or customers_id = 0) and DATE_SUB(CURDATE(),INTERVAL 30 DAY) > subscribed_date ');
        $messageStack->add(TEXT_INFO_SUBSCRIPTIONS_PURGED, 'success');
      } else {
        $messageStack->add(TEXT_ERROR_SUBSCRIPTIONS_PURGED, 'info');
      }
      
      $action = '';
     break;
> Well send an update shortly..

Thanks, we noticed this error when trying to delete one person under the Customers> Subscription Manager> page, for some odd reason it just kept pulling that error. Thanks for looking into this.
31 Mar 2021, 8:11 PM
#1158
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,798
Plugin Contributions:
22

Re: Newsletter-Only Subscriptions for v1.3x

I believe the edits in includes/modules/pages/account_edit/header_php.php shouldn't be there and should be removed from the plugin. If a customer wants to edit his/her account and change name or even email format, this plugin prevents it because that email address already exists in the database - well, of course it exists, it's an existing account...

Somebody please correct me if I'm wrong or if I'm missing something, but I believe this plugin shouldn't affect the mentioned file.

EDIT: actually, the second edit should remain, it's just the first part (change 1/2) that shouldn't be there...

5 Jul 2021, 5:11 PM
#1159
fuzztrip avatar

fuzztrip

New Zenner

Join Date:
Jul 2020
Location:
USA
Posts:
88
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

157c
fuzztrip.com

Hi, I'm trying to install this on version 157c. I get blank category and product pages. This is the error message I get.

[05-Jul-2021 16:48:26 UTC] Request URI: /lp-c-1/mos-generator-diaul-split-vinyl-lp-white-p-143.html, IP address: 173.76.37.155
#1 require() called at [/includes/modules/sideboxes/responsive0clone/subscribe_header.php:20]
#2 include(/includes/modules/sideboxes/responsive0clone/subscribe_header.php) called at [/includes/modules/column_left.php:24]
#3 require(/includes/modules/column_left.php) called at [/includes/templates/responsive0clone/common/tpl_main_page.php:151]
#4 require(/includes/templates/responsive0clone/common/tpl_main_page.php) called at [/index.php:94]
--> PHP Warning: require(includes/templates/template_default/templates/tpl_subscribe_header.php): failed to open stream: No such file or directory in /includes/modules/sideboxes/responsive0clone/subscribe_header.php on line 20.

This is subscribe_header.php

<?php
/**
 * subscribe_header - this is a subscribe field that appears in the navigation header
 * This uses the same base template as the subscribe sidebox.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 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: subscribe_header.php,v 1.1 2006/06/16 01:46:15 Owner Exp $
 */

   if(defined('NEWSONLY_SUBSCRIPTION_ENABLED') &&
      (NEWSONLY_SUBSCRIPTION_ENABLED=='on')) {
    $show_subscribe_header= true;
  }

  if ($show_subscribe_header == true) {
    $subscribe_text = HEADER_SUBSCRIBE_LABEL;
    require($template->get_template_dir('tpl_subscribe_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_subscribe_header.php');

    $title = '';
    $title_link = false;
    require($template->get_template_dir('tpl_box_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_box_header.php');
  }
?>

Line 20

require($template->get_template_dir('tpl_subscribe_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_subscribe_header.php');

Thanks!

3 Oct 2021, 7:53 PM
#1160
noppie avatar

noppie

Zen Follower

Join Date:
Mar 2004
Posts:
210
Plugin Contributions:
0

Re: Newsletter-Only Subscriptions for v1.3x

i have been trying to install this.. I get that ##########__WARNING: An Error occurred, please refresh the page and try again.If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

i went through all the files and removed the blank spaces.. and reloaded and still cannot get this to install through the zcplugin manager.
Help
what more info do you need.