Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

UNIT of the weight


ivangarnett

Recommended Posts

whatever you want as long as you use the same site-wide

 

personally I use grams but if the weight gets too large I use :

 

if ($weight >= 1000) {

$unit = 'kg';

$weight = $weight / 1000;

} else {

$unit = DEFAULT_UNIT;

}

 

echo $weight . ' ' . $unit;

Treasurer MFC

Link to comment
Share on other sites

personally I use grams but if the weight gets too large I use :

 

if ($weight >= 1000) {

  $unit = 'kg';

  $weight = $weight / 1000;

} else {

  $unit = DEFAULT_UNIT;

}

 

echo $weight . ' ' . $unit;

thanks a lot

that means the OScommerce using 'Grams",right?

however,many shipping modules are using "lbs" ,then how to change"lbs" to "gram"?

Do you have the PHP code for this changing? :'(

Link to comment
Share on other sites

thanks a lot

that means the OScommerce using 'Grams",right?

however,many shipping  modules are using "lbs" ,then how to change"lbs" to "gram"?

Do you have the PHP code for this changing? :'(

 

no no, it means that MY osc uses grams because I say that my units in the DB are grams because I enter grams for the weight when inserting products and I calculate everything in grams and my shipping table rate definitions are in grams.

 

You may say they are pounds or kg's or whatever.

 

the modules that have lbs in them usually have that in the language files.

So in the language file of table rate simply change the text "lbs" to your unit.

Treasurer MFC

Link to comment
Share on other sites

no no, it means that MY osc uses grams because I say that my units in the DB are grams because I enter grams for the weight when inserting products and I calculate everything in grams and my shipping table rate definitions are in grams.

 

You may say they are pounds or kg's or whatever.

 

the modules that have lbs in them usually have that in the language files.

So in the language file of table rate simply change the text "lbs" to your unit.

 

 

example of the language file of shipping module zones.php :

 

define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'Gram');

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...