{"id":6595,"date":"2021-07-19T10:30:59","date_gmt":"2021-07-19T10:30:59","guid":{"rendered":"https:\/\/www.ardorsys.com\/blog\/?p=6595"},"modified":"2021-07-28T10:28:04","modified_gmt":"2021-07-28T10:28:04","slug":"woocommerce-how-to-change-currency-symbol","status":"publish","type":"post","link":"https:\/\/www.ardorsys.com\/blog\/woocommerce-how-to-change-currency-symbol\/","title":{"rendered":"Woocommerce: How to Change Currency Symbol?"},"content":{"rendered":"<p>Are you guys looking for currency change in <a href=\"https:\/\/www.ardorsys.com\/wordpress-development-services\/\">Woocommerce<\/a>?<\/p>\n<p>In this tutorial, we will discuss two ways of changing currency symbol by editing the plugins or by code snippet.<\/p>\n<h2>#1 Editing Woocommerce plugin php file:<\/h2>\n<p>The file that holds the code is:<\/p>\n<pre><code>File: wc-core-functions.php\r\nLocation: \/[your-theme-folder]\/wp-content\/plugins\/woocommerce\/includes<\/code><\/pre>\n<p>In the mentioned file, you will see below function:<\/p>\n<pre class=\"wp-block-code\" lang=\"php\"><code>$symbols = apply_filters(\r\n    'woocommerce_currency_symbols',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'USD' =&gt; '$',\r\n...<\/code><\/pre>\n<p>In this example, we will change the USD as currency symbol to USD.<\/p>\n<pre class=\"wp-block-code\"><code>$symbols\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0= apply_filters(\r\n\u00a0\u00a0\u00a0\u00a0'woocommerce_currency_symbols',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0array(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'USD' =&gt; 'USD',<\/code><\/pre>\n<p>That\u2019s it! You are done.<\/p>\n<h2>#2 Woocommerce: Change currency programmatically using code snippet<\/h2>\n<p>If you don\u2019t want to edit the Woocommerce plugins, you can use code snippet plugins or write one of any codes in functions.php file of your theme:<\/p>\n<pre class=\"wp-block-code\"><code>add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);\r\nfunction change_existing_currency_symbol( $currency_symbol, $currency ) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0switch( $currency ) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0case 'USD': $currency_symbol = 'USD'; break;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0return $currency_symbol;\r\n}\r\n<\/code><\/pre>\n<p>or<\/p>\n<pre><code>add_filter( 'woocommerce_currency_symbol', 'change_currency_symbol', 10, 2 );\r\n\r\nfunction change_currency_symbol( $symbols, $currency ) {\r\nif ( 'USD' === $currency ) {\r\nreturn 'USD';\r\n}\r\n\r\nif ( 'EUR' === $currency ) {\r\nreturn 'Euro';\r\n}\r\n\r\nif ( 'AED' === $currency ) {\r\nreturn 'AED';\r\n}\r\n\r\nreturn $symbols;\r\n}<\/code><\/pre>\n<p>You can change all currency symbols if you are developing a multi-language website.<\/p>\n<p>The advantage of this\u00a0 2nd method is that when you update your Woocommerce plugin, your changes on currency symbol will still be there. You can <a href=\"https:\/\/www.ardorsys.com\/hire-wordpress-developer\/\">hire WordPress developer<\/a> too if you are new to WordPress and don&#8217;t know about where to find files and how to edit.<\/p>\n","protected":false},"excerpt":{"rendered":"Are you guys looking for currency change in Woocommerce? We will discuss two ways of changing currency symbol by editing the plugins or by code snippet.\n","protected":false},"author":1,"featured_media":6598,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66,44,107],"tags":[43,148,147,45,46,73],"class_list":{"0":"post-6595","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-hire-developer","8":"category-web-development","9":"category-wordpress-developer","10":"tag-hire-wordpress-developer","11":"tag-multi-language","12":"tag-woocommerce","13":"tag-wordpress","14":"tag-wordpress-developer","15":"tag-wordpress-development-company"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/posts\/6595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/comments?post=6595"}],"version-history":[{"count":0,"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/posts\/6595\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/media\/6598"}],"wp:attachment":[{"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/media?parent=6595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/categories?post=6595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ardorsys.com\/blog\/wp-json\/wp\/v2\/tags?post=6595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}