Forums / Currencies & Sales Taxes, VAT, GST, etc. / Problem with tax calculation on Tax Exempt goods

Problem with tax calculation on Tax Exempt goods

Locked

Views: 1,969

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
24 Mar 2009, 12:06 PM
#1
vickula avatar

vickula

New Zenner

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

Problem with tax calculation on Tax Exempt goods

I'm having a problem when redeeming discount coupons at the checkout.
Most of my goods are Tax Exempt (ie food) and I get this error
"Warning: Division by zero in /home/dalesbut/public_html/store/includes/modules/order_total/ot_coupon.php on line 364" when trying to redeem a coupon.
After I tested redeeming a coupon against taxable goods there is no problem. So I know the problem is with the php code as it throwing up an error because the calculation is trying to divide something by zero.

Is there any way of getting around this?

Help much appreciated.

Vicky

24 Mar 2009, 4:11 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Problem with tax calculation on Tax Exempt goods

Try changing the line:

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

to read:

            $ratioTax = (isset($order->info['tax']) && $order->info['tax'] != 0) ? $adjustedTax/$order->info['tax'] : 0;

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:18 PM
#3
vickula avatar

vickula

New Zenner

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

Re: Problem with tax calculation on Tax Exempt goods

:clap: Thank you very much - That sorted it

25 Mar 2009, 2:49 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Problem with tax calculation on Tax Exempt goods

Thanks for the update that this worked for you on the division by zero error on the Discount Coupons ot_coupons ... :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!