Skip to content

Instantly share code, notes, and snippets.

@kirandash
Forked from jameskoster/functions.php
Last active September 6, 2016 08:01
Show Gist options
  • Save kirandash/314b83a531c8a620e01cf6f27a6ad83d to your computer and use it in GitHub Desktop.
Save kirandash/314b83a531c8a620e01cf6f27a6ad83d to your computer and use it in GitHub Desktop.
WooCommerce - add text after price
functions.php
/**
* WooCommerce - add symbol after price
*/
add_filter( 'woocommerce_get_price_html', 'kd_custom_price_message' );
add_filter( 'woocommerce_cart_item_price', 'kd_custom_price_message' );
add_filter( 'woocommerce_cart_item_subtotal', 'kd_custom_price_message' ); // added
add_filter( 'woocommerce_cart_subtotal', 'kd_custom_price_message' ); // added
add_filter( 'woocommerce_cart_total', 'kd_custom_price_message' ); // added
function kd_custom_price_message( $price ) {
$afterPriceSymbol = '.-';
return $price . $afterPriceSymbol;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment