Jump to content
Sign in to follow this  
AlanQ

Weight only goes up to 9999.99

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

How do I changes these values without using phpMyAdmin, just by using MySQL commands?

 

Thank you for your Feedback.

 

Best

Zeno

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Osc has no default unit of weight. You change what is displayed in the language file of the module that is displaying the unit.

 

I see, got it. cheers Coopco -)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×