How to change the unit for product weight in Magento?

How to change the unit for product weight in Magento?

July 22, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to change the unit for product weight in Magento?

Changing Product Weight Units in Magento

When working with Magento, you may find yourself needing to adjust the default unit for product weights. By default, Magento uses grams as the standard measurement for product weight. However, if your business requires a different unit such as ounces or pounds, changing this setting is straightforward.

Understanding the Default Product Weight Unit in Magento

Magento 2 comes with a predefined set of units that can be used to measure product weights. The default options include grams (g), kilograms (kg), and ounces (oz). These are hardcoded into the system and cannot be removed or modified directly.

The weight unit is defined in the core config.xml file located at app/code/core/Mage/Catalog/etc/config.xml. You’ll find the relevant section under the catalog/weight_unit node:

<weight_unit>
    <value label=" Gram">
        <value label=" Kilogram">
            <value label=" Ounce">

Each unit is represented by a value and a corresponding label that appears in the admin interface.

Changing the Product Weight Unit

To change the default weight unit for your store, you need to override this configuration using a custom module. Here’s a step-by-step guide:

  1. Create a new module. In your app/code directory, create a new folder with your namespace and module name (e.g., Company/WeightUnit).

  2. Inside the etc directory of your new module, create a file named config.xml.

  3. Open this file in your favorite text editor or IDE and add the following code:

<?xml version="1.0"?>
<config>
    <modules>
        <Company_WeightUnit>
            <version>1.0.0</version>
        </Company_WeightUnit>
    </modules>
    <global>
        <helpers>
            <weightunit>
                <class>Company_WeightUnit_Helper_Data</class>
            </weightunit>
        </helpers>
        <translations>
            <translate>
                <files>
                    <file type="csv">app/locale/en_US/weight.csv</file>
                </files>
            </translate>
        </translations>
    </global>
</config>

This code defines your new module and sets up the necessary files for translation.

  1. In the etc directory of your module, create a folder named en_US and inside it, create a file called weight.csv.

  2. Open weight.csv in a text editor and add your custom unit:

"Pound","Pounds"

This will add “Pounds” as a new option for product weights.

  1. In the Helper/Data.php file (located in app/code/Company/WeightUnit/etc), you can define any additional setup or configuration needed for your module.

  2. Finally, run the following commands to install and enable your new module:

php bin/magento setup:upgrade
php bin/magento cache:flush

Conclusion

Changing the default product weight unit in Magento involves creating a custom module to override the core configuration file. By following this guide, you can easily add new units or modify existing ones without touching the core files.

Remember that changing these settings requires a basic understanding of XML and the Magento architecture. If you’re not comfortable making direct changes to the codebase, consider working with an experienced developer or Magento support provider like Laravel Company.

Always test your changes in a staging environment before deploying them to your live store to avoid any potential disruptions in your customer experience.

Magento 2 Catalog Extensions Admin

Our network