Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default [Duplicate] "Show Newsletter Checkbox" setting bug

    When the "Show Newsletter Checkbox" setting is set to 0 the system automatically subscribes new customer to the newsletter.

    At first I thought that customers were subscribing by going to the My Account link, which in my template includes the newsletter options link (see this thread)

    However when I disabled that newsletter options link under My Account I saw that new customers were still getting subscribed to the newsletter anyhow.

    When that setting is set to 0 it should stop subscribing new customers and it should disable this page: index.php?main_page=account_newsletters


    Why is this important? To transfer subscribers from the ZC newsletter list to the custom newsletter list it would be nice if a store owner knew which customers subscribed on their own instead of automatically...

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: "Show Newsletter Checkbox" setting bug

    This is a duplicate report of the one already discussed here: http://www.zen-cart.com/forum/showthread.php?t=131942
    .

    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
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: [Duplicate] "Show Newsletter Checkbox" setting bug

    Thank you.

    If I read it correctly, that post only discusses setting 1 and 2, not setting 0. Did the bug fix also take care of the problem with setting 0?

    Thanks.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: [Duplicate] "Show Newsletter Checkbox" setting bug

    It should. What happened when you made the change?
    .

    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.

  5. #5
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: [Duplicate] "Show Newsletter Checkbox" setting bug

    I didn't change any code yet. :)

    Your code on that post:
    PHP Code:
      if (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '2') {
        
    $newsletter 0;
        if (isset(
    $_POST['newsletter'])) {
          
    $newsletter zen_db_prepare_input($_POST['newsletter']);
        }
      } 

    Does not show the status 0. I do not have programming expertise, but maybe I could modify that code and include a snippet like this?

    ACCOUNT_NEWSLETTER_STATUS == '0' ||


    For my case this is really irrelevant at this point, since I am not using the ZC default newsletter any longer. But I just thought it might be useful for future users...

  6. #6
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: [Duplicate] "Show Newsletter Checkbox" setting bug

    Dr Byte,

    I tested this out.

    In my case, this works only when you also add the '0' setting. So it was a new bug after all ;)

    This is the code that works for me:

    Code:
    if (ACCOUNT_NEWSLETTER_STATUS == '0' || ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '2') {
      $newsletter = 0;
      if (isset($_POST['newsletter'])) {
        $newsletter = zen_db_prepare_input($_POST['newsletter']);
      }


    This is the code you suggested:

    Code:
      if (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '2') {
        $newsletter = 0;
        if (isset($_POST['newsletter'])) {
          $newsletter = zen_db_prepare_input($_POST['newsletter']);
        }
      }

    It was pure luck I think, but I guess I am starting to learn something here...


  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: [Duplicate] "Show Newsletter Checkbox" setting bug

    Actually, no, what you've done is basically make the entire "if" statement moot. So, that's not the best solution, since it will cause one of the settings not to work properly.

    The code I suggested is correct, but it's also helpful to change this line earlier in the file:
    Code:
      $newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1' ? false : true);
    to:
    Code:
      $newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '0' ? false : true);
    I'll add this information to the existing bug report so that it's a more complete resolution to the existing matter.

    Thanks for testing.
    .

    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.

  8. #8
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: [Duplicate] "Show Newsletter Checkbox" setting bug

    Glad I asked...

    Thank you for the new solution. If it does not work I will post back. I will keep an eye on the counter.


  9. #9
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: [Duplicate] "Show Newsletter Checkbox" setting bug

    Actually, it works fine. I just tested it.

 

 

Similar Threads

  1. Quantity Discount box and "add to cart" button does not show up in "Category" view
    By petro in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 10 Nov 2013, 09:48 PM
  2. v150 Is this a bug in v1.50? orders_total doesn't output "text" but "value"
    By inception in forum General Questions
    Replies: 10
    Last Post: 10 Sep 2012, 05:38 AM
  3. Turn Off "Gift Certificate FAQ" & "Newsletter Unsubscribe" from Sidebox
    By DBB1 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 16 Sep 2010, 04:23 AM
  4. "Subscribe to Newsletter" ability when completing "Contact Us" form
    By dcitsolutions in forum General Questions
    Replies: 2
    Last Post: 27 Apr 2010, 01:38 AM
  5. fedex setting "always free" weights to "0" on upgrade..help please
    By wootoot1234 in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 14 Jan 2009, 01:11 AM

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