How can we improve WooCommerce?

Price per kg, or liter or unit - according to European Laws

In many countries the law requires to show the price on items like powder in kg, with any liquid in liters and pills or tablets in units. If you want to sell products like protein powder, whereby the package is 750g, you have to show the customer the price per 1kg. This is not a "nice add-on", this is law all over the European market. It is very tricky to add a field, because these fields can not calculate and if the price changes, there is a lot of work involved to keep track. The authorities in Europe are looking into this subject and there is a high risk of getting heavy fines if the online shops do not comply.

I don't know if this should be in the core system or as an add-on, however it is just a very simple operation and only a few fields have to be added and WooCommerce complies to European Trade Laws.

48 votes
Sign in
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Rudolf Strutz shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Sign in with: facebook google
Signed in as (Sign out)
  • Fsanya commented  ·   ·  Flag as inappropriate

    I managed to find a solution, however I'm afraid it is limited only to my shop. I gave my weight in grams and I display the unit price as HUF/kg (huf is my currency)

    So I publish my solution, hope that others will find it useful. It only works at single products. HUF should be replaced to your actual currency. (the maths could be modified as well if you want to display your unit price in other format)

    The code goes to functions.php

    add_action( 'woocommerce_single_product_summary', 'single_price_per_kg');
    function single_price_per_kg () {
    global $product;
    $unit_price = round($product->get_price() / $product->get_weight() * 1000);
    if( $unit_price != 0) {
    echo '<p class=unit_price>Unit price: ' . $unit_price . ' HUF/kg</p>';

  • Ricardo commented  ·   ·  Flag as inappropriate

    Besides this been part of European Law this is also good for customer transparency. So it is always a plus to have!

WooCommerce: Category - Extension Ideas

Feedback and Knowledge Base