Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Weight only goes up to 9999.99


AlanQ

Recommended Posts

By using Search, I've found one other post about this, and they got no reply.

Hopefully I'll be more lucky :)

 

Several posts recommend doing all weights in grams instead of kilograms.

So that is what I did -- it saves having any decimal values.

 

I've now added some products that are 20kg each = 20000g

 

However, when I look back at the product in admin, the weight is shown as 9999.99

Also, for these items, the shipping module doesn't get the pricing right.

 

Is there a way to increase the upper limit?

Or should I completely re-do my catalog in kg? :(

 

Thanks

Alan

Link to comment
Share on other sites

Just increase the size of the database field. As far as I recall, there's nothing in the code expecting smaller lengths. If there is a code restriction, it should be trivial to remove or fix.

 

In phpMyAdmin, you'll see the field products_weight in the products table with a length of something like

 

decimal(5,2)

 

The first number is the entire length of the field, the second number is the number of digits after the decimal point. So for decimal(5,2), the highest number stored would be 999.99.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Thanks kgt

 

That at least keeps the weights as I set them.

 

But now I've got a further problem which may be related.

If I can impose upon you a bit further...

 

For small weights the shipping module calculates shipping prices correctly.

But for bigger items (around 10kg, ie weight=10000) it gets it wrong:

 

For one big item it's OK.

But for two, instead of adding the weights and then calculating the price, it calculates the price for one and then doubles it.

 

If I combine one big item and some small items, it then comes up with a figure that isn't even in the table!

 

Any ideas?

 

Thanks again

Al

Link to comment
Share on other sites

kgt you're brilliant!

 

You've solved my problem simply by asking questions and being my sounding board.

Your question sent me off to compile all the info you might need to help me.

And by doing that, I found the problem :)

 

In Configuration > Shipping/Packaging I had the 'Maximum Package Weight you will ship' set to 20000.

 

So osC was simply doing exactly what it had been told to do.

 

I, so far, haven't managed to re-create this bit

If I combine one big item and some small items, it then comes up with a figure that isn't even in the table!

Which is a good sign but still intriguing. Maybe I was just tired.

 

Cheers

Al

Link to comment
Share on other sites

  • 1 year later...

Ok, I found the solutions thanks to this contribution:

 

http://addons.oscommerce.com/info/2706

 

1. Log into your MySQL with

mysql -u name_of_db -p

 

2. enter PW

 

3. run this command:

 

ALTER TABLE `products` CHANGE `products_weight` `products_weight` DECIMAL(7,2) DEFAULT '0.000' NOT NULL;

 

Thank you Matthias C Hormann

 

Best

Zeno

Link to comment
Share on other sites

Hi Alan,

 

on that subject, I have Oscommerce with default weight in LBS, can you tell me where you changed the Unit to be in Gramms or KG? I can't find it in the configuration ..

 

cheers,

 

kgt you're brilliant!

 

You've solved my problem simply by asking questions and being my sounding board.

Your question sent me off to compile all the info you might need to help me.

And by doing that, I found the problem :)

 

In Configuration > Shipping/Packaging I had the 'Maximum Package Weight you will ship' set to 20000.

 

So osC was simply doing exactly what it had been told to do.

 

I, so far, haven't managed to re-create this bit

 

Which is a good sign but still intriguing. Maybe I was just tired.

 

Cheers

Al

Link to comment
Share on other sites

Hi Alan,

 

on that subject, I have Oscommerce with default weight in LBS, can you tell me where you changed the Unit to be in Gramms or KG? I can't find it in the configuration ..

 

cheers,

Osc has no default unit of weight. You change what is displayed in the language file of the module that is displaying the unit.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...