Download WooCommerce Unit Of Measure
This plugin is available from wordpress.org, download.
Overview
WooCommerce Unit Of Measure allows you to add a unit of measure (UOM), or any text you require after the price in WooCommerce. You can add as many different labels after the price as you like with the input field on the product page, just under the price field. You can even use popular product import tools by adding the custom column, meta:_woo_uom_input, to do a unit of measure after the price in bulk.
Screenshots
Screenshots to follow.
Renzo says:
Hi Bradley, I just installed the unit of measure plugin and I don’t find the field under the price in my variation products. It appears in simple product and external/affiliate product not in the others. I ‘m just building my site
Brad Davis says:
Hi Renzo,
Currently the plugin doesn’t work with each variation, however I am working on that feature at the moment so stay tuned.
Cheers
B
ramoo says:
can we use this plug in to change the unit from kg to quintal or ton
brad says:
hi ramoo,
the plugin allows you to add/change text after the price, it will not calculate anything between the different units of measure. Think it as a label.
cheers
brad
Catalin says:
Hi there, when do you thing it will be ready?
Bradley Davis says:
Hi Catalin,
Are you looking for the version that works per variation?
Cheers
Brad
Andre says:
Hi. excellent plugins. How to make the field data appear before the price in WooCommerce? Thanks.
Brad says:
Hi Andre,
It just so happens I have another plugin that will help you with this. It is mainly used for adding RRP or similar to before the price but you can put any text in there that helps, take a look – https://bradley-davis.com/wordpress-plugins/woocommerce-rrp/
pleiades says:
Hi Brad, can this plugin be used to manage inventory? or its just a label for products?
Examples is the deliveries comes in with cases, this contains 24 bottles, I would like to select the unit case for receiving the item because it would prevent mistake and use bottles or case for selling it.
Thank you!
brad says:
Hi pleiades,
The main aim for the plugin is for a label on the frontend, however I would be interested to see how it can be extended for backend/inventory management (or I could make a another if they dont align). If I have any questions on how you might use it I might email you directly.
Sidenote: interesting email username, do you have a 22b sti?
Cheers
brad
pleiades says:
Thanks Brad for the reply, the multiple uom is for inventory management, email me any time!
I don’t have one 🙁 I do wish i have one though, You like subaru too?
Debbie Kane says:
Most of the products are /kg, but there are some /unit.
So I changed the unit to /unit, but now it says /unit per KG
How do I remove the per KG after
Debbie Kane says:
Is there any update to this. I sent it in a few days ago.
Bradley D says:
Hi Debbie,
Do you know how the “per KG” was added originally?
For example on this page (http://bearbrookgamemeats.com/shop-online/free-range-chicken-eggs/) the “per KG” is added outside of the plugin code.
Cheers
Brad
Debbie Kane says:
You are right…I did add a filter to display /kg but forgot about it.
I have removed it, so the ‘per jar’ is now accurate.
However, how do I get the /kg to apply by default except for when I set the inventory to be something else.
I appreciate your help
Bradley D says:
Hi Debbie,
Great to hear we got one issue sorted out. So you want the ability to have a global setting and then override per product or variation? I did think of this option when I originally built the plugin but the the feedback was it wouldn’t be needed or used. Let me revisit the plugin over the next few day and i’ll get a solution for you.
Cheers
Brad
Ryan says:
I would like to use the UOM feature but am not having any success with it. The plugin is active and I can input a UOM for an item but the UOM is not showing up on the product table or next to the item in the store or in the cart after the price where I think I would see it. Does this plugin work with WordPress 4.9.2 Storefront theme? Any guidance would be appreciated. Thanks.
Bradley says:
Hi Ryan,
Are you able to provide a link to an example product with the issue? Also you mentioned a product table, is this a plugin that lists all the variations in a table instead of the select drop-downs that WooCommerce use?
Cheers
Brad
Debbie Kane says:
I’ve posted a message, but it’s not showing up.
Debbie Kane says:
I’ve added this php to the functions.php for /kg for all products.
Is there any way to add a condition to allow for the units as per your plugin?
// Add R xx.xx per KG
add_action( 'woocommerce_price_html', 'wc_custom_price', 10, 2 );
function wc_custom_price( $price, $product ) {
return sprintf( __( '%s per KG', 'woocommerce' ), woocommerce_price( $product->get_price() ) );
}
Debbie Kane says:
Sorry, it is this I used.
// Adds “per kg” after each product price throughout the shop
function sv_change_product_price_display( $price ) {
$price .= ‘ per KG’;
return $price;
}
add_filter( ‘woocommerce_get_price_html’, ‘sv_change_product_price_display’ );
add_filter( ‘woocommerce_cart_item_price’, ‘sv_change_product_price_display’ );
Craig says:
Hi Bradley,
I was wondering if the UOM field is designed to strip html tags? If so is there some way around it? I want to use a span to have two different sized texts after the price (eg: ea span ex GST span). It was working and now suddenly not and outputting the html tags. Just checking here first before the theme.
cheers,
Craig
Bradley D says:
Hi Craig,
Thanks for using UOM.
The last release of the plugin would be what is now causing the display of html that is being entered in the input field. The update made the plugin translatable for multi-language sites and html that is entered is now rendered as a string, not in it’s natural html state which actually makes it a more secure plugin.
Let me see if I can get a fix out to keep both sides happy.
Cheers
Brad
Jure says:
Hi
Your plugin is great. Just what I need.
Is there any news in using separated units per variation ?
Best
Jure
Bradley D says:
Hi Jure,
It is on the way as part of the paid version.
Cheers
fairuz says:
Helo Sir Bradley.
Need to ask you. How to display our product measurement at customer cart pages?
Bradley D says:
Hi Fairuz,
This functionality is in the paid for version that I am planning on releasing.
Cheers
Brad