Are you looking to improve the user experience on your WooCommerce store by displaying clearer price information during the checkout process? This post will provide you with a way to add a current active currency suffix to product prices specifically on the cart and checkout.
add_filter('woocommerce_price_format', 'ts_add_currency_suffix', 10, 2); function ts_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; }
Output
On the WooCommerce cart page, it displays the currency suffix i.e. USD along with price as shown below.
It also shows the currency suffix with the product price on the WooCommerce checkout page as shown below.
Similarly, you can also add prefix or suffix to product prices in WooCommerce single product page by modifying the default product items.
Worked well, thank you
Hi Josh,
You’re welcome!!
Not work in 9.0.2
Hi Eonomaz,
The code has been tested in the updated WooCommerce version (9.1.1) and it is working fine. Could you please confirm if you’ve followed all the troubleshooting steps mentioned in the previous reply?
If you’ve already done so, could you provide more details about any additional customizations that you have implemented in your site. Also, please confirm whether you are checking the output on the classic cart & checkout (shortcodes) page or on the checkout blocks page. This will help us pinpoint the exact cause and to assist you better.
not worked
Hi Barkha,
The code has been tested in the updated WooCommerce version (9.0.0) and it is working fine. Please try checking it again after deactivating all other plugins except WooCommerce and switching to a default WordPress theme to avoid any plugin/theme conflicts. If the issue persists, please get back to us with the additional customization details you have implemented on your site, so that we can assist you better.