Tuesday, December 9, 2014

Changing weight from grams to kg and vise versa in magento from backend.

I decided to change unit of weight from kg to grams, but when start doing I realize doing so will take lot of time as I have more than 500 products in my store.
Well I than research on weight attribute that I have in attributes that can seen from attributes from your admin panel of magento.
  1. First you must know the attribute_id of weight, in my case it was 101. You can check it by login to your admin, go to attribute and provide "weight" in Attribute code text field and click enter. On mouse over you will see attribute_id/101. So 101 is your attribute id.

     
  2. I have my website hosted on godaddy.com, open phpMyAdmin and in appropriate database run following query

UPDATE `mage_catalog_product_entity_decimal` SET value = value * 1000 where attribute = 101;

This is to change kg to grams, if you want to change grams to kg you should do something like value / 1000.

Your are highly recommended to backup your database before doing so.

Cheers

2 comments:

  1. In Magento 1.9.2:

    UPDATE `catalog_product_entity_decimal` SET value = value / 1000 where attribute_id = 80;

    ReplyDelete
  2. This really is similarly a great content material we very truly loved looking at. This is not constantly that we have possible to sort out a problem. 1-Testosterone powder

    ReplyDelete