mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
18 lines
398 B
Text
18 lines
398 B
Text
add_filter( 'woocommerce_price_format', 'add_currency_suffix', 10, 2 );
|
|
|
|
function add_currency_suffix( $price, $currency_symbol ) {
|
|
|
|
// Only add the suffix on cart and checkout pages
|
|
if ( is_cart() || is_checkout() ) {
|
|
|
|
// Get the current currency code
|
|
$currency = get_woocommerce_currency();
|
|
|
|
// Add the suffix to the price
|
|
$price .= ' ' . $currency;
|
|
|
|
}
|
|
|
|
return $price;
|
|
|
|
}
|