Zen Cart Logo
Forums / Bug Reports / [Done v1.3.9] Newsletter Sign up Check Box Bug

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

Locked

Views: 2,193

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
12 Jul 2009, 7:34 PM
#1
stonecoldmagic avatar

stonecoldmagic

New Zenner

Join Date:
Jul 2009
Location:
Salt Lake City
Posts:
5
Plugin Contributions:
0

[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:

https://www.stonecoldmagic.com

13 Jul 2009, 4:43 AM
#2
drbyte avatar

drbyte

Sensei

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

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

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

13 Jul 2009, 7:44 AM
#3
stonecoldmagic avatar

stonecoldmagic

New Zenner

Join Date:
Jul 2009
Location:
Salt Lake City
Posts:
5
Plugin Contributions:
0

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

DrByte:

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

Excellent. Dumb question, but is 2.0 available yet?

13 Jul 2009, 7:51 AM
#4
drbyte avatar

drbyte

Sensei

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

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

StoneColdMagic:

Excellent. Dumb question, but is 2.0 available yet?
Not yet. Subscribe yourself to the "Zen Cart Release Announcements" part of the forum to be notified immediately by email of any new releases or important updates. That's where the 2.0 beta release announcement will be posted when it's ready.

13 Jul 2009, 7:57 AM
#5
stonecoldmagic avatar

stonecoldmagic

New Zenner

Join Date:
Jul 2009
Location:
Salt Lake City
Posts:
5
Plugin Contributions:
0

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

DrByte:

Not yet. Subscribe yourself to the "Zen Cart Release Announcements" part of the forum to be notified immediately by email of any new releases or important updates. That's where the 2.0 beta release announcement will be posted when it's ready.

Thanks for taking the time to answer my questions. One last one, and I'll leave you alone. :blush:

Do you know if the change was straight forward enough that I could change it myself (with a little help from a pro), or is it too complicated?

Thanks.

13 Jul 2009, 8:22 AM
#6
drbyte avatar

drbyte

Sensei

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

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

In v2.0, the whole section was rewritten and features changed somewhat ... so ... fixing it in v1.3.x will require carefully studying the code and figuring out what's breaking it, and then fixing it.

14 Jul 2009, 2:17 AM
#7
drbyte avatar

drbyte

Sensei

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

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

/includes/modules/create_account.php
Around line 28 you'll need to change this:

  $newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1' ? false : true);

to:```
$newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1'[B] || ACCOUNT_NEWSLETTER_STATUS == '0'[/B] ? false : true);


And then around line 70 or so you'll see a block of code that looks like this:```
    if (isset($_POST['newsletter'])) {
      $newsletter = zen_db_prepare_input($_POST['newsletter']);
    }
```Change that to look like this:```
[B]  if (ACCOUNT_NEWSLETTER_STATUS == '1' || ACCOUNT_NEWSLETTER_STATUS == '2') {
    $newsletter = 0;[/B]
    if (isset($_POST['newsletter'])) {
      $newsletter = zen_db_prepare_input($_POST['newsletter']);
    }
[B]  }[/B]

This will be included in the upcoming v1.3.9 release. The v2.0 fix is actually very different due to a feature change.