Forums / Setting Up Categories, Products, Attributes / Changing Weight from Pounds to Kilos

Changing Weight from Pounds to Kilos

Locked

Views: 33,811

Results 1 to 20 of 54
This thread is locked. New replies are disabled.
12 May 2006, 6:37 AM
#1
tekfix avatar

tekfix

New Zenner

Join Date:
May 2006
Posts:
18
Plugin Contributions:
0

Changing Weight from Pounds to Kilos

Hi
I am just wondering how to change from pounds to grams/kilograms because im am located in Australia?

Tekfix Computing Solutions
http://www.tekfix.com.au/

12 May 2006, 6:56 AM
#2
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Changing Weight from Pounds to Kilos

Have you tried the Search facility?

The way to check is to go to admin>tools>developers toolkit and type in "lb" at the bottom left field and then select all catalog/admin files. Then edit the files and stick them in your override directories.

And yes, one day, this probably will be switchable in admin!

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

12 May 2006, 8:34 AM
#3
tekfix avatar

tekfix

New Zenner

Join Date:
May 2006
Posts:
18
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

Hi thanks Ryk,
I have changed it to KGs,
to change it u need to modify these files:

**/admin/includes/languages/english.php **
Line #570 : define('TEXT_PRODUCT_WEIGHT_UNIT','lbs');

**/includes/languages/english.php **
Line #376 : define('TEXT_PRODUCT_WEIGHT_UNIT','lbs');
Line #379 : define('TEXT_SHIPPING_WEIGHT','lbs');

/**includes/languages/english/modules/shipping/zones.php **
Line #25 : define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'lb(s)');

Thanks for the Help

Tekfix Computing Solutions
http://www.tekfix.com.au/

12 May 2006, 8:54 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Changing Weight from Pounds to Kilos

tekfix:

to change it u need to modify these files ...
Spot on. Apart from in the USPS shipping module (which implicitly assumes lbs) weight is just a label for display, though if you use a different scale you may also want to check the "maximum package weight you will ship" variable in the Admin > configuration > shipping/packaging menu (especially if you swicth to grams!)

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

22 Nov 2006, 8:18 PM
#5
skinessence avatar

skinessence

New Zenner

Join Date:
Nov 2006
Posts:
9
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

Thank you so much for that, has made my life so much easier :)

vegan nut free eco friendly skin care
skinessence australia

12 Jun 2007, 8:34 AM
#6
mackcomm_net avatar

mackcomm_net

New Zenner

Join Date:
Jan 2006
Location:
Broken Hill - NSW
Posts:
2
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

tekfix:

Hi thanks Ryk,
I have changed it to KGs,
to change it u need to modify these files:

**/admin/includes/languages/english.php **
Line #570 : define('TEXT_PRODUCT_WEIGHT_UNIT','lbs');

**/includes/languages/english.php **
Line #376 : define('TEXT_PRODUCT_WEIGHT_UNIT','lbs');
Line #379 : define('TEXT_SHIPPING_WEIGHT','lbs');

/**includes/languages/english/modules/shipping/zones.php **
Line #25 : define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'lb(s)');

Thanks for the Help

May i ask to what version of Zen Cart does this apply to as the line numbers dont add up to my Version 1.3.7

Paul

20 Jul 2007, 12:38 AM
#7
subliminal avatar

subliminal

New Zenner

Join Date:
Jul 2007
Posts:
1
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

It does not matter what the line numbers are, just look for the same code.

Im stunned that ZenCart only include lbs. The US is NOT the only country in the world!
Considering the ease of use over other carts, you would think it would be just common sense to put an option in the config settings where you can select KGs. So so so logical to do this! Grhhhh.....

20 Jul 2007, 8:27 AM
#8
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Changing Weight from Pounds to Kilos

Actually Zen Cart is way ahead of most carts on this point. Instead of simplistically building a switch into the Admin to offer the standard lbs, kg and g, it allows you to use any weight units you like. So if you wanted to offer units in tonnes or milligrams or carats or Zogian rogulles, you can.

And moreover, if you want to describe your everyday kilograms as kg in one language but kilo to a visitor in a different language - you can do that too.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

1 Aug 2007, 3:41 PM
#9
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

if you change those three files that works great. Tho, only 2 seem to be in custom folders. will they not be overwritten when we upgrade?

27 Oct 2007, 11:41 AM
#10
david_buckley avatar

david_buckley

New Zenner

Join Date:
Mar 2007
Posts:
48
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

ZC 1.3.7 :)

/admin/includes/languages/english.php
Line #569 : define('TEXT_PRODUCT_WEIGHT_UNIT','lbs');

/includes/languages/english.php

Line #392 : define('TEXT_PRODUCT_WEIGHT_UNIT','lbs');

Line #395 : define('TEXT_SHIPPING_WEIGHT','lbs');

/includes/languages/english/modules/shipping/zones.php

Line #25 : define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'lb(s)');

Well this is what I found in my cart anyway.

I have installed ZC 1.3.7 with the following additional modules.

IH2.0
MySQL database backup
stock with attributes 4.5
AustPost Improved.

Hope this helps someone else.

DAVE

:)

27 Oct 2007, 4:21 PM
#11
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Changing Weight from Pounds to Kilos

When making the changes outlined by Dave above, remember to edit copies of the files which you have placed in:

/includes/languages/YOUR_TEMPLATE_NAME/english.php and /includes/languages/english/modules/shipping/YOUR_TEMPLATE_NAME/zones.php

(the admin change will need to go in the file quoted as the over-ride system does not yet extend to the Admin)

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

28 Oct 2007, 1:11 AM
#12
david_buckley avatar

david_buckley

New Zenner

Join Date:
Mar 2007
Posts:
48
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

Thanks for pointing out the bits that I forgot to mention Kuroi, and thanks be to Dr Byte for editing my post to remove the bits that I didn't really mean to paste in.

:)

Cheers all,

DAVE

5 Jan 2008, 3:18 AM
#13
invokethegoddess avatar

invokethegoddess

New Zenner

Join Date:
Dec 2007
Posts:
13
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

Great thread...works well...I was able to change mine from lbs to kgs very easily although on the shipping estimator, it still says lbs....any idea where to change that file??

14 Mar 2008, 10:41 AM
#14
foneguy avatar

foneguy

New Zenner

Join Date:
Jan 2008
Location:
Sydney, Australia
Posts:
21
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

Also, under Admin, Configuration, Shipping / Packaging, Package Tare - it still shows lb and lbs.
Not serious because the customer doesn't see it but would be nice to fix.
Anyone know where?
Thanks, Steve.

7 Apr 2008, 2:04 PM
#15
oakwoodevents avatar

oakwoodevents

New Zenner

Join Date:
Dec 2007
Location:
cambridgeshire uk
Posts:
33
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

We have a website that has a default in lbs and this is naturally used for shipping, but we buy from a supplier who advertises the product in kilo's so we do have to make a change - wish we didnt. Fingers crossed for a dual weight cart, well we can live in hope

We dont just talk about it - we do it !!!!
OAKWOOD EVENTS

8 Apr 2008, 1:39 PM
#16
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Changing Weight from Pounds to Kilos

oakwoodevents:

Fingers crossed for a dual weight cart, well we can live in hope

Please don't hold your breath while waiting. It'll probably never happen.

The fact is, zencart doesn't really weigh in lbs or kgs. It simply accepts 'numbers'. These numbers could mean anything, ounces, grams, kilo, pounds, even tonnes.

Wherever you see an 'identifer' such as "lbs", or "kgs" in relation to these 'numbers' it is important to realise that what you are seeing is nothing more than a simple text string.

With this in mind it should be easy to realise why there'll probably never a 'dual weight' option ('cos unless the developers incorporate code to cater for every possible weight conversion there will always be someone that wants a conversion that they didn't account for). IOW, by keeping it as simple as it stands, the weight can be adapted to any standard or format that the store owner requires. The moment the developers specify a particular weight format (for conversion purposes) they'll have immediately broken it for anyone that uses anything other than their specifed format(s).

If YOU were a developer, would you want to do that?

Cheers
Rod.

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

4 Aug 2008, 8:53 AM
#17
johnwey avatar

johnwey

New Zenner

Join Date:
Aug 2007
Posts:
19
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

I dunno RodG -- if it's only a text entry, there's no worries about actual weight. Wouldn't it be simple to just provide some drop-downs that change the text?

John

4 Aug 2008, 9:11 AM
#18
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Changing Weight from Pounds to Kilos

johnwey:

I dunno RodG -- if it's only a text entry, there's no worries about actual weight. Wouldn't it be simple to just provide some drop-downs that change the text?There are worries about actual weight. It's used in a number of places in the cart, in particular for shipping, but also for attribute pricing. As long as you are consistent and use the same units throughout, then it doesn't matter which units they are. If you start mixing units, then it would be a nightmare.

You're right that the ability to define the units differently would be helpful, maybe as a configuration value set in the Admin. However, the place that this would happen naturally (Admin > Configuration), does not currently support multilingual entries. So the location of this text in the language files is, at present, the best option.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

4 Aug 2008, 10:34 AM
#19
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Changing Weight from Pounds to Kilos

johnwey:

I dunno RodG -- if it's only a text entry, there's no worries about actual weight. Wouldn't it be simple to just provide some drop-downs that change the text?

John

If everyone spoke English, yes. But just as with the other textual stuff, it is easier all around to let the end user edit them via the language files if and when required.
Most users edit these files as a matter of course when setting up and customising their stores anyway, so where's the hardship in changing the default 'lbs' to 'kgs' at the same time?

It isn't like an admin is going to need need to change this after the store is operational, so adding another dropdown menu seems a bit superflious to me.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

9 Feb 2009, 4:48 AM
#20
artycles avatar

artycles

New Zenner

Join Date:
Sep 2006
Location:
Loch Victoria Australia
Posts:
45
Plugin Contributions:
0

Re: Changing Weight from Pounds to Kilos

I'm in Australia, using 1.3.8 version. I've upgraded my AustPost thanks to Rod's help. Now have changed my lbs to grams.
Here's the current problem:

I've gone through and changed all the lbs to grams (using the developers tool kit I found them all eventually) and on the Austpost module also changed from Kgs to grams that I'm using. In testing it, the items in the shopping cart add correctly to 44grams but on the checkout the postage is calculating it way to much, I'm wondering what I've missed. Any ideas?

Ooooh I'm now thinking I should have made everying kgs and worked out every thing based on a 0.0kg...
I'll try that while I'm waiting to see if there was anything else.