Forums / Bug Reports / [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

[Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

Locked
Results 1 to 8 of 8
This thread is locked. New replies are disabled.
07 Jul 2006, 21:15
#1
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

[Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

We just went live with our newly upgraded ZC 1.302 store a few minutes ago and have had about 5 orders. The last of which the customer used a coupon during checkout and when I look at that record in the orders_total table the title text field says:

Discount Coupon: <a href="javascript:couponpopupWindow('http://www.isegames.com/ise-popup_coupon_help/cID-31/index.html?zenid=v13r0d6mungedxxc4nj5h8t62')">4HINSTR100</a> :


rather than just:

Discount Coupon: 4HINSTR100


as I would expect.

Looking at ot_coupon.php, the offending line 48 says:

      $this->output[] = array('title' => $this->title . ': ' . '<a href="javascript:couponpopupWindow(\'' . zen_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $_SESSION['cc_id']) . '\')">' . $this->coupon_code . '</a> :',
                              'text' => '-' . $currencies->format($od_amount['total']),
                              'value' => $od_amount['total']);


and appears to be responsible for this problem. Can someone explain the purpose of this code? :wacko:

Thanks,
Jeff
07 Jul 2006, 21:41
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

If you click the link it puts in a window exactly what the customer could see for that Discount Coupon when checking out ...
07 Jul 2006, 21:53
#3
jeffd avatar

jeffd

Totally Zenned

Join Date:
Sep 2004
Posts:
605
Plugin Contributions:
1

Re: [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

Yes, but you don't want to write all that to the order_totals table record, otherwise you will break order editors like edit orders and super orders and make it very difficult to run queries on that table to produce reports, etc!


I have fixed my copy by changing this line back to:

$this->output[] = array('title' => $this->title . ': ' . $this->coupon_code . '</a> :',


Jeff
17 Jan 2007, 15:26
#4
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

I want to thank you for posting this. I have been on this for quite a long time with no answer in sight. Thank you!
20 Jan 2007, 05:11
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

We will be looking into this further to work for both conditions ...

Just have to put on my coding cap ... :smartass:
14 Feb 2007, 04:32
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

This has been updated for the next release to not put the javascript into the database but to call it in the 2 orders classes ...

It will not remove it from the existing orders that have this added but it will no longer add it ...

To clean up an existing database via phpMyAdmin a search on the orders_total table for:
[PHP]SELECT * FROM orders_total WHERE title LIKE '%<a href="javascript:couponpopupWindow%';[/PHP]

will locate any records that need to be cleaned up ...
22 Nov 2007, 02:29
#7
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

Ajeh, with cart 1.3.7.... where would configure the coupon javascript to be turned off and not included on the order total table?

Ajeh:

This has been updated for the next release to not put the javascript into the database but to call it in the 2 orders classes ...

It will not remove it from the existing orders that have this added but it will no longer add it ...

To clean up an existing database via phpMyAdmin a search on the orders_total table for:
[PHP]SELECT * FROM orders_total WHERE title LIKE '%<a href="javascript:couponpopupWindow%';[/PHP]

will locate any records that need to be cleaned up ...
24 Nov 2007, 04:39
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.8] embedded ot_coupon.php popup javascript causes problems

This required modifying the ot_coupon.php file ... but I would have to go through and figure out the changes again to tell you how to do this before the release of Zen Cart v1.3.8 ... which we hope to have out very very soon ...

Otherwise, just running the select will find where this exists in the table for cleaning up ...