This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Riffaz 4 weeks ago.

Assigned support staff: Riffaz.

Author Posts
September 15, 2019 at 10:29 pm #4575467

davidV-73

Hi,

my apologies, the title should read 'Multi-currency based on GeoIP for single language'

The primary and pressing issue that I got WPML for is to be able to enter separate Stripe accounts details for USD and Canadian dollar. Assuming the primary currency details is taken from Woo Stripe plugin (since WPML Woo payment gateway won't work without it; please confirm), I have entered the second currency Stripe account details in WPML Woo.

I want to know what else am I supposed to do to make it work for primary language (English) so that the customers in US are led to Stripe US account, and the customers from Canada are led to Stripe Canada account? I am hoping GeoIP will sort this out.

Please assist to complete tasks to achieve what was described in above.

On another note, is it possible to utilize Google Translate within WPML for the languages?

Thank you,
Amir

September 16, 2019 at 4:11 am #4576251

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

Please note, WPML does not use Geo location for any purpose and it is not possible to add this feature in near future but based on user browser language and WCML you may get nearly like this.

this feature is not supported by default by WooCommerce Multilingual and would require custom code workaround. I'm afraid that these kind of customizations are out of our support scope but I'd suggest you to take a look at WooCommerce Multilingual hooks guide (https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/) and try to build your own script to change the currency based on the user geo-location. I'd suggest you to take a look at 'wcml_client_currency' hook to try to change the current currency. Of course you'll need to make use of some other libraries to geo-locate the client IP before deciding the new currency.

add_filter('wcml_client_currency', 'wcml_custom_currency');
function wcml_custom_currency($currency){
    // 1- Geo-locate the client IP 
    // 2- Assign a new currency to the client based on its location
    // 3- Return this new currency
    return $currency; 
}

If you need further help with this, I'd suggest you to contact our certified contractors (https://wpml.org/documentation/support/wpml-contractors/) and explain them your request. I'm sure they'll be able to help you in a better way.

Refer this thread where some users discuss this: https://wpml.org/forums/topic/automatic-change-of-currency-geo-location/

This also may help you with alternative: https://wpml.org/forums/topic/auto-detect-currency/

Regards,
Riffaz.