Black Friday Sale is live. Use coupon code IDEABF2024 to get 30% off.

Code snippet to add Argentinian Peso to GravityForms Currency

This code snippet allows you to add the Argentinian Peso (ARS) to the list of currencies available in GravityForms. Follow these simple steps to integrate it into your WordPress website.

Prerequisites

  • WordPress installed and activated.
  • GravityForms plugin installed and activated.

Procedure

  1. Access Code Editor: Open your WordPress theme’s functions.php file or a custom plugin editor.
  2. Insert Code Snippet: Copy and paste the following code snippet into the file:
function add_agrentina_peso_currency_to_gravity_forms( $currencies ) {
    $currencies['ARS'] = array(
        'name'               => __( 'Argentine Peso', 'gravityforms' ),
        'symbol_left'        => '$',
        'symbol_right'       => '',
        'symbol_padding'     => ' ',
        'thousand_separator' => '.',
        'decimal_separator'  => ',',
        'decimals'           => 2,
        'code'               => 'ARS',
    );
    return $currencies;
}

add_filter( 'gform_currencies', 'add_agrentina_peso_currency_to_gravity_forms' );

3. Save Changes: Save the file to apply the changes.

4. Verify: Go to the GravityForms settings in your WordPress dashboard. Under form settings, you should now find “Argentine Peso (ARS)” as a currency option.

Argentinian Peso should also work fine with our Multi-Currency addon for Gravity Forms.


Comments

Leave a Reply

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