VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Tirrawarra on June 07, 2013, 11:08:40 AM

Title: how do I change weight units from KG to grammes
Post by: Tirrawarra on June 07, 2013, 11:08:40 AM
Hi,

Ive imported a VM1.1 site to VM 2 and all the products error at shipping - that they are now too heavy.
a product that was 500g is now 500kg

how do I change the default weight UNIT from  KG to g (or grammes) 

eg: what file do I edit?

thanks in advance

Steve
Title: Re: how do I change weight units from KG to grammes
Post by: inthysite on June 07, 2013, 17:58:20 PM
Same issue here.  I had the default weight unit set to lbs, but when I imported over 200 products they now show up as kg.  I used CSV Improved if that makes any difference.  I need to somehow change the weight unit on each product back to lbs and I really don't want to do that manually.
Title: Re: how do I change weight units from KG to grammes
Post by: AH on June 07, 2013, 18:51:49 PM
for new products go to admin configuration

shopfront tab

Default Weight Unit

and possibly Default LWH Unit if you need to

As for the weight unit on existing products, that is stored on the product table in field

product_weight_uom

change it en-mass using phpmyadmin

sql code

update [i]NNN[/i]_virtuemart_products set product_weight_uom = "G"

or

update [i]NNN[/i]_virtuemart_products set product_weight_uom = "LB"



Weight unit codes jsut in case you want them from shopfunctions.php

   'KG' => JText::_ ('COM_VIRTUEMART_UNIT_NAME_KG')
, 'G'   => JText::_ ('COM_VIRTUEMART_UNIT_NAME_G')
, 'MG'   => JText::_ ('COM_VIRTUEMART_UNIT_NAME_MG')
, 'LB'   => JText::_ ('COM_VIRTUEMART_UNIT_NAME_LB')
, 'OZ'   => JText::_ ('COM_VIRTUEMART_UNIT_NAME_ONCE')