What’s New in Multi-Currency for Gravity Forms 1.18.0

Multi-Currency for Gravity Forms 1.18.0 adds support for the Gravity Forms Stripe Add-On 7.0, stops Number fields from being converted when they aren't prices, and fixes zero prices and checkout failures in some setups.

• No comments

Multi-Currency for Gravity Forms 1.18.0 is out. This release adds support for the latest Stripe Add-On and fixes several problems that could make totals wrong or block checkout.

Here's what's new.

Support for the Gravity Forms Stripe Add-On 7.0

The Gravity Forms Stripe Add-On 7.0 changed how it sets up Stripe on the page. With 1.18.0, Multi-Currency for Gravity Forms works with it.

When a customer switches currency, Stripe now uses the same currency as the form. That applies to the card fields and to the payment Stripe creates. If you don't use a currency switcher, Stripe uses the form's base currency. Customers no longer get a currency mismatch error at checkout.

Using Stripe Add-On 5.x or 6.x? Those versions still work, so you can update the Stripe Add-On whenever suits you.

Number fields stay as they are when the currency changes

Many forms use Number fields for things that aren't prices: width and height, quantities, counts, or values that feed a calculation. Before this release, those fields could be converted when the customer switched currency. A 100 cm width could become 1.2 after a switch to US dollars, and calculations built on it came out wrong.

Switching back and forth made it worse. Each switch converted the already-converted value again, so small exchange-rate differences added up.

From 1.18.0, Number fields keep their values when the currency changes. Calculation totals still show in the selected currency, but the inputs behind them aren't changed.

Bug fixes

  • Prices passed in the URL: if you fill a product's price from the page URL (a dynamically populated price), the price was sometimes replaced with zero. It now keeps the value from the URL.
  • Checkout in the base currency: checking out in the form's own currency could fail when exchange rates couldn't be loaded. No conversion is needed in that case, so checkout now goes through.

For developers

There's a new JavaScript filter, mcg_is_convertible_number_field. It decides whether a Number field gets converted when the currency changes. By default, a Number field is only converted when the plugin has marked it as a price. Return true to convert a field or false to leave it alone:

gform.addFilter( 'mcg_is_convertible_number_field', function ( isConvertible, $input, formId ) {
	// Convert the "Deposit" Number field (field ID 5) on form 2.
	if ( 2 == formId && 'input_2_5' === $input.attr( 'id' ) ) {
		return true;
	}
	return isConvertible;
} );

Under the hood

The bundled Freemius SDK, which handles licensing and updates, is updated to version 2.13.5.

How to update

Go to Dashboard → Updates in WordPress and update Multi-Currency for Gravity Forms. You can also download the latest version from your account.

If you use Stripe, test a payment in each of your currencies after updating. This is especially worth doing if you're moving to the Stripe Add-On 7.0 at the same time.

Leave a Reply

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