Skip to main content

Posts

Showing posts from June, 2020

Change WooCommerce unit from Price to Kilogram

How to  Change WooCommerce unit Price to Kilogram Just Simply follow these steps below: Step 1: ​First is go to your Dashboard -> Appearance -> Editor -> Theme Function Step 2: Scroll down to the bottom of the code section and insert the following code: add_filter( 'woocommerce_get_price_html', 'wb_change_product_html' ); // Change and return $price_html variable using the $price and weight amount function wb_change_product_html( $price ) { $price_html = '<span class="amount">' . $price . ' per kg </span>'; // change weight measurement here return $price_html; } add_filter( 'woocommerce_cart_item_price', 'wb_change_product_price_cart' ); // Change the cart prices with $price variable and weight amount function wb_change_product_price_cart( $price ) { $price = $price . ' per kg'; // change weight measurement here return $price; } add_filter( 'woocommerce_checkout_c