• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
SnippetPress

SnippetPress

The Home of WordPress Snippets

Vultr Web Hosting
  • Cheat Sheets
  • Reviews
  • Snippets
  • Tutorials

WooCommerce – Change a Currency Symbol

June 23, 2020 by SnippetPress Leave a Comment

To change a currency symbol in WooCommerce, all you need is a code snippet. In the following example we’re going to change the symbol for Canadian Dollars from “$” to “CA$”:

add_filter('woocommerce_currency_symbol', 'snippetpress_change_woo_currency_symbol', 10, 2);

function snippetpress_change_woo_currency_symbol( $symbol, $currency ) {
    switch( $currency ) {
		case 'CAD': $symbol = 'CA$'; break;
    }
    return $symbol;
}

As you can see, this will change the symbol for Canadian Dollars.

To modify the snippet, replace CAD with the three letter code for your currency, and CA$ with what you want to use for your currency symbol. A full list of currency codes in WooCommerce can be found in our post on WooCommerce Currency Codes List.

Where to add the snippet?

The snippet should be placed at the bottom of the functions.php file of your child theme. Make sure you know what you’re doing when editing this file. Alternatively, you can use a plugin such as Code Snippets to add the custom code to your WordPress site. If you need further guidance on how to add the code, check out our post on How to Add WordPress Snippets.

Filed Under: Snippets, Snippets, WooCommerce

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

E-mail Newsletter

More to See

WooCommerce – Prevent Product Being Added To Cart If A Specific Product Is Already In Cart

July 15, 2020 By SnippetPress

WooCommerce – Display an “Add $X To Get Free Shipping” Notice

July 13, 2020 By SnippetPress

Footer

Recent

  • Change The WordPress Page Title Separator Without A Plugin
  • WooCommerce – Prevent Product Being Added To Cart If A Specific Product Is Already In Cart
  • WooCommerce – Display an “Add $X To Get Free Shipping” Notice
  • WooCommerce – Integrate Google Merchant Center Customer Reviews
  • WooCommerce – Disable Out of Stock Variations

Search

Copyright © 2023 ·SnippetPress