Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Location
    Salt Lake City
    Posts
    3
    Plugin Contributions
    0

    Default [Done v1.3.9] Newsletter Sign up Check Box Bug

    Version:
    Zen Cart 1.3.8a
    Database Patch Level: 1.3.8

    Site updates: None

    Addons: SEO URLs

    I've been using Zen Cart for about 4 or 5 months now.

    I've recently discovered something that I cannot find a solution for anywhere online, and I've looked for a few weeks now.

    I'm hoping someone can help. Here's the problem. It's regarding the "sign up for newsletter" check box:

    If I set the default display to show the box as checked (Admin >> Configuration >> Show Newsletter Checkbox >> 2), when the user creates an account, unchecking it still inserts a value of 1 (TRUE) in the customers.customers_newsletter field.

    However, if I set the default display to show the box as unchecked (Admin >> Configuration >> Show Newsletter Checkbox >> 1), then it works as it should (checking is inserts a 1 and leaving it unchecked inserts a 0).

    I'm a mid-level php programmer, and I've dug through the files and cannot figure it out. Any help would be much appreciated.

    Thanks. The site is:

    www.stonecoldmagic.com
    Jeff Stone
    Stone Cold Magic

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Newsletter Sign up Check Box Bug

    Confirmed as a bug in v1.3.8.
    Fixed in v2.0 and 1.3.9
    .

    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.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Newsletter Sign up Check Box Bug

    /includes/modules/create_account.php
    Around line 28 you'll need to change this:
    Code:
      $newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1' ? false : true);
    to:
    Code:
      $newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '0' ? false : true);
    And then around line 70 or so you'll see a block of code that looks like this:
    Code:
        if (isset($_POST['newsletter'])) {
          $newsletter = zen_db_prepare_input($_POST['newsletter']);
        }
    Change that to look like this:
    Code:
      if (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '2') {
        $newsletter = 0;
        if (isset($_POST['newsletter'])) {
          $newsletter = zen_db_prepare_input($_POST['newsletter']);
        }
      }
    This will be included in the upcoming v1.3.9 release. The v2.0 fix is actually very different due to a feature change.
    Last edited by DrByte; 6 Oct 2009 at 08:17 PM. Reason: Added missing condition for line 28
    .

    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.

 

 

Similar Threads

  1. v150 Newsletter Sign Up Box in Footer
    By uncharted in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Jul 2012, 04:08 PM
  2. Adding Floating Newsletter sign-up box upon website entry
    By kidzcomfort in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Mar 2009, 11:32 PM
  3. Replies: 78
    Last Post: 3 Dec 2006, 08:15 AM
  4. Newsletter Sign Up Box
    By wcjmproducer in forum General Questions
    Replies: 4
    Last Post: 27 Jun 2006, 05:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR