-
-
Save kirandash/314b83a531c8a620e01cf6f27a6ad83d to your computer and use it in GitHub Desktop.
WooCommerce - add text after price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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