Skip to content Skip to sidebar

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 2 replies, has 2 voices.

Last updated by Mihai Apetrei 1 year, 11 months ago.

Assisted by: Mihai Apetrei.

Author Posts
September 5, 2023 at 11:38 am #14343631

christofferL-6

Hi! Is there any hook och function that WPML has that can change the current currency based on a condition (like a custom field in the user post type).

We dont want the user to be able to change currency by themselves. But they should be able to change language with WPML. But the currency should we set programmatically in functions.php.

I understand this is custom coding but can you say if this is possible? And if so, with what hook or function do you recommend me using.

Thanks!

September 6, 2023 at 11:50 am #14351933

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

I will try to check this with one of our developers but it might take a while as some of our developers are currently on vacation.

As soon as I have an update, I will get back to you.

Thank you for your patience.

I'm leaving the ticket assigned to myself for now.

Mihai Apetrei

September 6, 2023 at 6:24 pm #14354591

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

I am back.

Our developers said that you can lock a certain currency to each language without code, just using the UI.

Or you can use the "wcml_client_currency" instead:
https://wpml.org/wcml-hook/wcml_client_currency/

I hope that you will find this information helpful.

Mihai