Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Posts
    16
    Plugin Contributions
    0

    help question Warning/Debug when redeeming voucher at Checkout

    I'm using ZC 1.3.8a and I have been testing the checkout process using a discount coupon.
    When I enter a Redemption Code at checkout the discount is applied but I get this error at the top of the page:
    "Warning: Division by zero in /home/dalesbut/public_html/store/includes/modules/order_total/ot_coupon.php on line 364"
    I can go on to confirm the order and the payment methods from here so i don't know why this is showing.
    Any ideas?

  2. #2
    Join Date
    Sep 2008
    Posts
    16
    Plugin Contributions
    0

    Default Re: Warning/Debug when redeeming voucher at Checkout

    Quote Originally Posted by vickula View Post
    "Warning: Division by zero in /home/dalesbut/public_html/store/includes/modules/order_total/ot_coupon.php on line 364"
    After a bit more testing it seems that this error only applies when purchasing Tax Exempt goods as the php code is trying to deduct the discount from the tax and as the tax is 0 it throws up an error.

    As I am only selling Tax exempt goods (ie food) is my best bet to comment the code out in the php file?

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

    Default Re: Warning/Debug when redeeming voucher at Checkout

    As with your other post, change line:
    Code:
                $ratioTax = $adjustedTax/$order->info['tax'];
    to read as:
    Code:
                $ratioTax = (isset($order->info['tax']) && $order->info['tax'] != 0) ? $adjustedTax/$order->info['tax'] : 0;
    see if that resolves the issues you are having on division by zero on the Discount Coupons when using Taxable and non-taxable products ...
    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!

  4. #4
    Join Date
    Sep 2008
    Posts
    16
    Plugin Contributions
    0

    Default Re: Warning/Debug when redeeming voucher at Checkout

    Quote Originally Posted by Ajeh View Post
    As with your other post, change line:
    Code:
                $ratioTax = $adjustedTax/$order->info['tax'];
    to read as:
    Code:
                $ratioTax = (isset($order->info['tax']) && $order->info['tax'] != 0) ? $adjustedTax/$order->info['tax'] : 0;
    see if that resolves the issues you are having on division by zero on the Discount Coupons when using Taxable and non-taxable products ...
    Thank you very much - That sorted it

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

    Default Re: Warning/Debug when redeeming voucher at Checkout

    Thanks for the update that this was able to correct the issues you were having on the division by 0 error ...
    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. Replies: 10
    Last Post: 6 Sep 2014, 02:55 AM
  2. v151 "Warning: An error occurred" and no debug logs
    By emiLy in forum General Questions
    Replies: 13
    Last Post: 2 Apr 2014, 07:37 PM
  3. Replies: 8
    Last Post: 19 Sep 2012, 03:37 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