Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

change weight from lb(s) to grams. How do i do that?


Recommended Posts

Hi I have searched everywhere in the admin tool and on the forum but still could not figure out how to change the weights units from lb(s) to grams. Can anyone please point me in the right direction?

Link to comment
Share on other sites

Where are you seeing this text? I don't see any weight identifier on any pages that have to do with products under MS1. It just says weight.

Link to comment
Share on other sites

What he meant by "text" is that the weight that you enter is a text field. So at this point it's pound b/c you call them pounds.


If you like to convert it to grams, all you have to do is to run a query :


update products

set products_weight = products_weight * 450;


I am not sure about 450 though. I think 1lb = 450 grams.



This should convert your lbs to grams...


ultrAslan - ultrAslan - ultrAslan

Link to comment
Share on other sites

I thought that the point was that you could use any weight as long as you were consistent when you entered weights in your catalog info. ie. if all your weights were entered in grams then the output would be in grams and all you had to do was changed the lb(s) string which I think is in english.php to grams and hey presto, you're done!


I'd better check that my weight calcs are metric and not imperial!




with ten thousand dollars we'll all be millionaires

Link to comment
Share on other sites

It can be hard to find -catalogincludeslanguagesenglishmodulesshippingzones.php





Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

Does anyone know how to completely change this line that you get on checkout_confirmation.php?


"Zone Rates (Shipping to GB : 0 lb(s)): ?5.00"


I see where you can change the words

"Zone Rates", "Shipping to" and "lb(s)" - in catalog/includes/language/[language]/modules/shipping/zones.php


and get


(Shipping to GB : 0 ): ?5.00


But all I want to say is


Shipping: ?5.00

(or Levering: ?5.00 in the Danish site)


How do I get rid of the brackets and the "to GB : 0" bit??


If anyone knows *PLEASE* help - I have been dissecting all the php files and database tables for 2 days and I can't find it.


thanks from Louise

Link to comment
Share on other sites

You can change it in:








define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Shipping to');


define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'No shipping available to the selected country');

define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');


Link to comment
Share on other sites

OOps! - my speed reading is getting the better of me, you already know that - sorry! :oops:


Weeel ...This bit of code in checkout_confirmation.php seems to be responsible for displaying the section containing the shipping total:





    echo $order_total_modules->output();




and $order_total_modules seems to be constructed (at least in part...) in checkout_process.php ...


Might be an idea to search on ' (' (with a leading space) ....?


Haven't got any further than that yet, and it's just a guess ... I'm learning as I go too ... but I might need this change as well since I'm also in the UK, so I'll keep on looking too.



Link to comment
Share on other sites

Thanks for the tips!


I couldn't find anything in checkout_process.php,

Managed to find in includes/modules/shipping/zones.php the following code:


$shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;


which if you edit to




will give you (Shipping to): ?5.00


i.e. it gets rid of the GB : 0lb(s), but not the brackets or the 'to'

These must get added somewhere other than includes/modules/shipping/zones.php but I can't see where!


The best solution I can come up with is instead of the above - (leave includes/modules/shipping/zones.php unchanged)


In checkout_confirmation.php find the line:


echo $order_total_modules->output();


comment this out, and replace with:


$ot_string = $order_total_modules->output();

//find first ':'

$colonpos = strpos($ot_string, ":");

//find following '('

$brackpos = strpos($ot_string, "(" , $colonpos);

//delete the '('

$ot_string = substr_replace($ot_string, '', $brackpos, 1);

// find following ':'

$colonpos2 = strpos($ot_string, ":", $brackpos);

//delete 7 preceeding characters (including the ':') and 5 following characters from string

$ot_string = substr_replace($ot_string, '', ($colonpos2-7), 7);

$ot_string = substr_replace($ot_string, '', ($colonpos2-7), 5);

echo $ot_string;


It's a very crude hack I know and if someone has a better answer please post it!!

I think the above will only work if you have the order_total shipping module installed with sort order 2.



Link to comment
Share on other sites


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

  • Create New...