Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MinaPansuriya/a62aeec304634dd916fbef1b1be21614 to your computer and use it in GitHub Desktop.
Save MinaPansuriya/a62aeec304634dd916fbef1b1be21614 to your computer and use it in GitHub Desktop.
/**
* @Title: WooCommerce Add Product Price Unit on Shop and Single Product Page
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_filter( 'woocommerce_get_price_html', 'pbs_woo_add_product_unit_after_prie' );
add_filter( 'woocommerce_cart_item_price', 'pbs_woo_add_product_unit_after_prie' );
function pbs_woo_add_product_unit_after_prie( $price ) {
$price .= ' per litre';
return $price;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment