Skip to content

Instantly share code, notes, and snippets.

@vinacode
Created July 4, 2014 04:43
Show Gist options
  • Save vinacode/fbc94da546e076e74e0f to your computer and use it in GitHub Desktop.
Save vinacode/fbc94da546e076e74e0f to your computer and use it in GitHub Desktop.
WooCommerce add weight unit after price filter
<?php
/**================WooCommerce weight unit after price===================**/
add_filter( 'woocommerce_price_html', 'woocommerce_custom_sales_price', 10, 2 );
add_filter( 'woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2 );
function woocommerce_custom_sales_price( $price, $product ) {
return sprintf( __( '%s/kg', 'woocommerce' ), $price );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment