Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Gift certificate sent out 30 times - bug?

Gift certificate sent out 30 times - bug?

Locked

Views: 2,171

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
27 Feb 2008, 11:27 AM
#1
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Gift certificate sent out 30 times - bug?

I have just sent a gift certificate out to a customer, which they received fine.

However The system has set up and "tried" to email about 30 other customers a gift certificate to the same value but generated different codes. Just to clarify this word "tried". It generated 30 gift certificates and the email archive shows 60 emails generated 1 to the customer and a copy to admin. However it has put the customers name in the email but not the full email address ( therefore I don't think the email has actually arrived at the customer but it has set up the certificates in the admin area for these customers)

How do I kill these and also stop this from happening again. Clearly a bug of some kind.

Thanks

MG

27 Feb 2008, 3:54 PM
#2
kim avatar

kim

Obaa-san

Join Date:
Jun 2003
Posts:
26,602
Plugin Contributions:
0

Re: Gift certificate sent out 30 times - bug?

What version of Zen Cart are you using? What add-ons do you have installed? What are your settings under Admin> Configuration> GV Coupons?

28 Feb 2008, 1:10 AM
#3
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Gift certificate sent out 30 times - bug?

Kim

Sorry I know I should have given all that.

currently 1.3.7 with various mods
Settings are:

Default Order Status For Zero Balance Orders default
Length of the redeem code 10
New Signup Discount Coupon ID#
New Signup Gift Voucher Amount
Maximum Discount Coupons Per Page 20
Maximum Discount Coupon Report Results Per Page 20

there are no other settings in config.

Payment Mods include better together, discount coupon, gift certificates, quantity discounts other mods on the admin side - super orders, quick updates, cross sell, froogle feeder, wishlists, stock export for sage, export email addresses.

Thank you in advance.

Regards

MG

2 Apr 2008, 9:00 PM
#4
i_like_ham avatar

i_like_ham

New Zenner

Join Date:
Apr 2008
Posts:
10
Plugin Contributions:
0

Re: Gift certificate sent out 30 times - bug?

I also have this problem in Zen Cart 1.3.7. Is there already a fix for this?

Thanks.

6 Apr 2008, 4:11 PM
#5
mikeyg avatar

mikeyg

Totally Zenned

Join Date:
May 2005
Posts:
515
Plugin Contributions:
0

Re: Gift certificate sent out 30 times - bug?

Kim,

Any thoughts on this one?

Looks like I am not the only one.

Thanks and Best Regards

MG

24 Apr 2008, 10:19 PM
#6
i_like_ham avatar

i_like_ham

New Zenner

Join Date:
Apr 2008
Posts:
10
Plugin Contributions:
0

Re: Gift certificate sent out 30 times - bug?

I believe I have found the problem. I use 1.3.7 and so this fix I am about to submit is for that version. Other versions that have this problem can adapt accordingly. I noticed that there were many empty emails in the gv_mail.php form (Admin->Mail Gift Certificate page).

After looking at the HTML source for the Admin->Mail Gift Certificate page I noticed those empty email values were set as selected automatically. When the form is submitted all the empty emails are used as values to insert into the cc_coupon_email_track database. When I had the problem of many gift certificates being sent, when I looked in the database, there was one emailed user and the rest of the emailed_to fields were blank. I had about forty or so gift card codes generated as a result.

I found a problem in admin/includes/functions/html_output.php with function zen_draw_pull_down_menu.

There is a for loop inside this function and in 1.3.7 the for loop reads:

for ($i=0, $n=sizeof($values); $i<$n; $i++) {
$field .= '<option value="' . zen_output_string($values[$i]['id']) . '"';
if ($default == $values[$i]['id']) {
$field .= ' SELECTED';
}

  $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>' . "\n";
}

The for loop needs to change to this instead. It checks for null values:

for ($i=0, $n=sizeof($values); $i<$n; $i++) {
if($values[$i]['id'] != '') {
$field .= '<option value="' . zen_output_string($values[$i]['id']) . '"';
if ($default != '' && $default == $values[$i]['id']) {
$field .= ' SELECTED';
}

      $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>' . "\n";
  }

}

25 Apr 2008, 2:43 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: Gift certificate sent out 30 times - bug?

That fix shouldn't be necessary in v1.3.8 since it already checks for default values using slightly different logic which also works around some globals issues.