Post by Jopke » Sat Aug 11, 2012 4:41 am

I'm not sure if this is a bug but I suspect it might me. I'm using 1.5.3.1 and I have only UPS set up for shipping. When I get to step 4 of the checkout process I get this message:

Warning: Division by zero in /home/casino/public_html/system/library/weight.php on line 38

And then the shipping method choice has no radio button which means I can't choose a shipping method.

not sure what to do...

Newbie

Posts

Joined
Tue Jun 12, 2012 1:56 pm

Post by MrTech » Sat Aug 11, 2012 6:46 am

I've had this problem in the past and the fix has always been an empty something or other.

I had a mod that when there were no products in a category - division by zero

Based on your error, my best guess is to look for the weight of a product which is empty and should not be.

~
Install Extensions OR OpenCart Fast Service! PayPal Accepted
I will professionally install and configure any free or purchased theme, module or extension.

Visit http://www.mrtech.ca if you need an OpenCart webmaster
~


User avatar
Active Member

Posts

Joined
Mon Jan 09, 2012 2:39 pm
Location - Canada, Eh!

Post by Jopke » Sat Aug 11, 2012 6:53 am

ok thanks man. I will look to see if the products have actual weights and look into clearing caches and all that. thanks.

Newbie

Posts

Joined
Tue Jun 12, 2012 1:56 pm

Post by MrTech » Sat Aug 11, 2012 9:24 am

Don't forget to report your findings here in case it can help other users.

~
Install Extensions OR OpenCart Fast Service! PayPal Accepted
I will professionally install and configure any free or purchased theme, module or extension.

Visit http://www.mrtech.ca if you need an OpenCart webmaster
~


User avatar
Active Member

Posts

Joined
Mon Jan 09, 2012 2:39 pm
Location - Canada, Eh!

Post by Johnathan » Sat Aug 11, 2012 9:55 am

This can happen if you've set a weight class for a product, and then deleted that weight class. The products then have no weight class applied, so it uses 0 for the weight_class_id.

The fix is to resave your products, or take a look in your database's "product" table and see if any of them have 0 for the weight_class_id.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Jopke » Sat Aug 11, 2012 10:35 am

OK so I was able to fix the first part of the problem with your suggestions. It did indeed have to do with weight class. In my UPS settings I had everything set up to deal with lb but some of my products had either kg or nothing listed. So it looks like if I change everything to pounds to match the UPS settings it works fine.

The 2nd part of my problem is still there though. It lists "United Parcel Service" as the shipping method during checkout but there is no way to choose it. If I just try to move on it says "Warning, Shipping Method Required"...

Newbie

Posts

Joined
Tue Jun 12, 2012 1:56 pm

Post by allenshea » Sat Aug 11, 2012 10:51 am


I know nothing about PHP and SQL, but I still try my best to understand it.


Active Member

Posts

Joined
Mon Dec 14, 2009 10:01 pm

Post by webgeeze » Tue Dec 04, 2012 5:14 pm

I know this is an older post but I experience the same problem on OC 1.5.4 and I wanted to share my fix

In my case, I have migrated data from storesprite to opencart and when doing so, the weight_class_id was set to 0. In order to fix the issue, I ran a sql command in php my admin as follows. The error dissapeared.

UPDATE `product` SET `weight_class_id` = '1' WHERE `weight_class_id` = '0'

Most will know how to do this simple task. For those who don't, simply log into PHP Myadmin (ask your host) and locate your database. Click on the products table in your database and then click the SQL button. Paste the command above and it will change the weight_class_id from 0 to 1.

*assumes you are not using a prefix on the database name and tables. If you have a prefix, change the text within the ' ' above e.g mysite_product rather than product.

Joomla & Wordpress Specialist
E-Commerce Specialist
SEO Consultant

Freephone: 0800 756 9975
Website: www.awebserver.co.uk


Newbie

Posts

Joined
Tue Oct 09, 2012 4:41 pm
Location - Northampton

Post by imsir » Wed Feb 20, 2013 3:56 am

If you use kilograms instead of grams you will get this error.

For example if product weights 1540 grams, you shouldn't write 1,54kg but 1540, and choose grams as weight class.

New member

Posts

Joined
Tue Jan 29, 2013 12:20 am
Who is online

Users browsing this forum: No registered users and 17 guests