Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Warning/Debug when redeeming voucher at Checkout

Warning/Debug when redeeming voucher at Checkout

Locked

Started by vickula on 24 Mar 2009, 11:13 AM · Views: 2,043

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
24 Mar 2009, 11:13 AM
#1
vickula avatar

vickula

New Zenner

Join Date:
Sep 2008
Posts:
16
Plugin Contributions:
0

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?

24 Mar 2009, 11:46 AM
#2
vickula avatar

vickula

New Zenner

Join Date:
Sep 2008
Posts:
16
Plugin Contributions:
0

Re: Warning/Debug when redeeming voucher at Checkout

vickula:

"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?

24 Mar 2009, 4:25 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Warning/Debug when redeeming voucher at Checkout

As with your other post, change line:

            $ratioTax = $adjustedTax/$order->info['tax'];

to read as:

            $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!

24 Mar 2009, 10:17 PM
#4
vickula avatar

vickula

New Zenner

Join Date:
Sep 2008
Posts:
16
Plugin Contributions:
0

Re: Warning/Debug when redeeming voucher at Checkout

Ajeh:

As with your other post, change line:

        $ratioTax = $adjustedTax/$order->info['tax'];
> 
> to read as:
> ```
            $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 ...

:clap: Thank you very much - That sorted it

25 Mar 2009, 2:46 PM
#5
ajeh avatar

ajeh

Oba-san

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

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 ... :smile:

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!