How to use Indian currency in Gravity Forms?

So you are having the problem of using Indian currency in your Gravity forms, uh? About one year back I was also facing the same problem, but then doing lot of Googling and number of tweaks I came to a definite solution.

When I was searching, to my surprise, I came to know this anti-Indian statement from the Gravity forms website itself. About 20% of the clientele for the gravity forms is from India. Still they don’t do the required modifications in their forms?

And the result is as such that I am now using the Indian Currency in all the Gravity Forms on my site. Further, I tweaks more as such that I also replaced the default (₹) sign by the simple (Rs.) sign. I did this because I found that many of the Indian people, particularly the students from the age group of 12 to 20 get confused with this default sign of Indian currency.

Well its a different story. So now lets see how to do the trick of using Indian currency in your Gravity forms.

How to do it?

  • Its a simple matter of minutes and you just have to do some php work. DON’T BE AFRAID. ITS REALLY SIMPLE.
  • First go to your FTP account and then to – root/wp-content/themes/ folder and locate the file functions.php.
  • Open the file and put the following code in that file, anywhere in it.
add_filter("gform_currencies", "update_currency");

function update_currency($currencies) {
 $currencies['INR'] = array(
 "name" => __("INR", "gravityforms"),
 "symbol_left" => "₹",
 "symbol_right" => '',
 "symbol_padding" => " ",
 "thousand_separator" => ',',
 "decimal_separator" => '.',
 "decimals" => 2);

 return $currencies;
}
  • Save the file.
  • Now return to your WordPress dashboard and go to Forms » settings of your Gravity Forms.
  • Then save the settings and then return to “Forms”. Open any of your saved forms. If not, create a new form.
  • If you have already saved some forms that contains the Price tag for any product, etc. then open one of such form and refresh the page.
  • You will see the ₹ symbol before your price tag for your product.
  • However, as I did, if you want to replace the ₹ sign with Rs. sign, then edit the following line in your functions.php file, as shown.
"symbol_left" => "Rs.",

That’s all, friends.

One thought on “How to use Indian currency in Gravity Forms?

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.