Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Forked from kloon/functions.php
Last active August 29, 2015 14:09
Show Gist options
  • Save bentasm1/e2435ca31a01b678313b to your computer and use it in GitHub Desktop.
Save bentasm1/e2435ca31a01b678313b to your computer and use it in GitHub Desktop.
Add text after product price
<?php
// 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() ) );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment