Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

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

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

    Code:
    Discount Coupon: 4HINSTR100
    as I would expect.

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

    Code:
          $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?

    Thanks,
    Jeff

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Possible ot_coupon.php problem

    If you click the link it puts in a window exactly what the customer could see for that Discount Coupon when checking out ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Possible ot_coupon.php problem

    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:

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

  4. #4
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: 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!

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: 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 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: 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 Code:
    SELECT FROM orders_total WHERE title LIKE '%<a href="javascript:couponpopupWindow%'
    will locate any records that need to be cleaned up ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: 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?

    Quote Originally Posted by Ajeh View Post
    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 Code:
    SELECT FROM orders_total WHERE title LIKE '%<a href="javascript:couponpopupWindow%'
    will locate any records that need to be cleaned up ...

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v154 [Done v1.6.0] Error in ot_coupon.php
    By swguy in forum Bug Reports
    Replies: 1
    Last Post: 3 Mar 2015, 01:18 PM
  2. Replies: 2
    Last Post: 28 Jul 2011, 02:26 PM
  3. Replies: 18
    Last Post: 23 Sep 2010, 07:50 AM
  4. Configure.php delete reinstall causes problems
    By stefanl in forum Upgrading from 1.3.x to 1.3.9
    Replies: 28
    Last Post: 8 Jun 2010, 02:01 PM
  5. PHP and Javascript embedded within
    By Donn in forum General Questions
    Replies: 3
    Last Post: 6 Feb 2009, 01:20 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