PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Add custom currency

  1. Roman_E
    Member

    Is it possible to change the currency sign from € to €/qm? Or add a custom currency to the list in settings?

    Posted 13 years ago on Thursday October 27, 2011 | Permalink
  2. This should help. :)

    http://www.gravityhelp.com/documentation/page/Gform_currencies

    Posted 13 years ago on Thursday October 27, 2011 | Permalink
  3. I was also wondering about this. We are a South African based business with the majority of our clients being South African and our currency is the South African Rand (ZAR). A while back I made the manual change in the currency.php file as David suggested above, however when you update to the latest version of Gravity Forms this file gets replaced.

    Is there not a better way to do this, or at least have all currencies committed to the core files by the Gravity Forms developers?

    Posted 13 years ago on Monday November 21, 2011 | Permalink
  4. You shouldn't make the change in the currency.php file.

    You should never edit the core Gravity Forms files. These files get overwritten when Gravity Forms releases an update.

    All hooks and filters should be used by placing custom code in either your theme's functions.php file, or by creating a custom plugin of your own that you then activate.

    So the issue isn't the hooks/filter usage, the issue is you are placing them in the wrong location. The typical location for custom code is going to be your theme's functions.php file. If you want your custom code to also be "theme proof" then you need to create your own little plugin and install and activate it.

    The currency built into Gravity Forms was specifically designed to work with the PayPal Add-On and the South African Rand is not supported by the PayPal standard API which is why it was not included. All other currencies can be added via the hooks/filters that are provided. In the future we will expand on this and allow you to change this from within Gravity Forms.

    Posted 13 years ago on Monday November 21, 2011 | Permalink
  5. I am also from South Africa and am interested in ZAR or Rand.

    Is it not possible to have; lets say, a Divider of currencies supported by PayPal and the ones that are not?

    eg of the drop down list.
    $ USD
    £ GBP
    -- not supported by PayPal --
    R ZAR

    Posted 11 years ago on Thursday April 4, 2013 | Permalink
  6. For fellow South Africans who want to add the Rand

    You can modify the currencies.php in gravity froms by adding this code: (not suggested)

    "ZAR" => array("name" => __("Rand", "gravityforms"), "symbol_left" => 'R', "symbol_right" => "", "symbol_padding" =>  "", "thousand_separator" => ',', "decimal_separator" => '', "decimals" => 0)

    or add the following code to your functions.php theme file (suggested):

    <?php

    add_filter("gform_currencies", "update_currency");
    function update_currency($currencies) {
        $currencies['ZAR'] = array(
            "name" => __("Rand", "gravityforms"),
            "symbol_left" => '',
            "symbol_right" => "R",
            "symbol_padding" => " ",
            "thousand_separator" => ',',
            "decimal_separator" => '',
            "decimals" => 0);
    
        return $currencies;
    }

    ?>

    I think that should be right... if i'm wrong correct me please.

    Posted 11 years ago on Thursday April 4, 2013 | Permalink

This topic has been resolved and has been closed to new replies.