Author Topic: how do I change weight units from KG to grammes  (Read 1769 times)

Tirrawarra

  • Beginner
  • *
  • Posts: 36
how do I change weight units from KG to grammes
« 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

inthysite

  • Beginner
  • *
  • Posts: 30
Re: how do I change weight units from KG to grammes
« Reply #1 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.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3277
  • VirtueMart Version: 3.8.4
Re: how do I change weight units from KG to grammes
« Reply #2 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
Code: [Select]
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

   
Code: [Select]
'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')


regards
A

Joomla 3.9.20
php 7.3