Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing Weight uni from G to KG


makeholer

Recommended Posts

Hello,

I just added the command to my database:

ALTER TABLE `products` CHANGE `products_weight` `products_weight` DECIMAL( 5, 0 ) NOT NULL

And now my website shows the weight in Grams, but i need it back in Kg, what is the command to "undo" this one?

 

Thx.

Link to comment
Share on other sites

  • 1 month later...

"DECIMAL( 5, 0 )" means 5 places overall in the weight entry; so 99999 (no decimals).

I'm using intuition here, but it seems that it defaults to the assumption that the entry becomes grams if there are no decimals, because few sites will be shipping items that weigh 10,000 Kg.

 

ALTER TABLE 'products' CHANGE 'products_weight' 'products_weight' DECIMAL(5,2) NOT NULL

 

Should restore the DB to the default. If you changed it to (7, 4) then you would be able to enter 7 places overall, with 4 decimals, I.E. 999.9999 Kg

 

If I'm wrong in this, I'd appreciate a more experienced voice's input.

 

I found this post while trying to figure out how to get my site to handle weight resolution in pounds greater than 1/100th. When I saw your post, a light went on for me. At first, I tried changing from 5,2 (default) to 5,4...but that limited my entry to 9.9999. So, swapping 5 for 7 added two places to my whole-number entries. Now I can accurately enter weight for items up to 999.0 lb, yet I can also accommodate very small items that weigh as little as .0001 lb. I'm also assuming that the entry is the same whether using lb or kg...simply a matter of telling the store which unit you're using in Admin UI under: configuration > Shipping/Packaging.

Link to comment
Share on other sites

The weight is not shown in kg, grams or lbs because of the field size, it is down to what you enter for the wt.

 

The unit of wt, to reflect what you entered can be set in the language files.

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...