Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client wants to set a specific product with a different currency and have other currencies converted from this set currency on a multi-vendor platform using Dokan. The client also inquires if it's possible to set a different main currency for each vendor.
Solution:
We informed the client that currently, WooCommerce Multilingual or WooCommerce does not support setting a specific currency for a vendor, user, or country. However, a future version of WooCommerce Multilingual (5.5) will include a feature to set prices based on the country, but it is still in the early development stage. For now, a custom plugin might be necessary. We suggested checking out the WooCommerce Product Price Based on Countries plugin, although we have not tested this ourselves. For custom development, we recommended contacting certified developers through this link. Additionally, we provided a code snippet using the

wcml_raw_price_amount

hook to convert from the WooCommerce default currency price to another currency, and pointed to the function that auto-updates product prices in other currencies:

$service = \WPML\Container\make( \WCML_Exchange_Rates::class );
$service->update_exchange_rates();

The update_exchange_rates function is defined in the *wp-content/plugins/woocommerce-multilingual/classes/multi-currency/class-wcml-exchange-rates.php* file (line 151).

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

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.

Our next available supporter will start replying to tickets in about 5.88 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Bigul 2 months ago.

Assisted by: Bigul.

Author Posts
July 11, 2024 at 3:08 pm #15936041

shaiR

Background of the issue:
My website is set with USD currency. I want to set a specific product with a different currency. If I understand correctly, the other currencies are converted from US dollars (in the database save only USD price and the other currencies are converted from USD). I want this specific product to be set to a different currency and the other currencies to be converted from the currency that I set for it.

Symptoms:
No specific issue or error message mentioned.

Questions:
Is there a way I can set a specific product with a different currency?
Can the other currencies be converted from the currency that I set for this specific product?

July 11, 2024 at 4:28 pm #15936574

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

Normally we can only set the price in the default currency and there are limitations to setting the price for a single Product in a different currency. This looks like a custom requirement.

We hope you want to create a specific product with a different currency in the default language.

So I will consult with our developers for an expert opinion and get back to you as early as possible. Please wait.

--
Thanks!

Bigul

July 14, 2024 at 10:00 am #15949904

shaiR

Thank you,

I will explain my need. Maybe it will help to find a good solution.

I develop a website with Dokan - a multi-vendor plugin, And I want each vendor to be able to create products with their own currency and the other currencies will be converted from the main currency.

If there is a way to create a specific product with a different currency, I can define that a specific vendor will have all his products with the different currency.

This is the way I thought would be best to set each vendor with a different currency. If there is another way to define a different main currency for each vendor, I would love to hear it.

July 15, 2024 at 4:28 pm #15955692

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the details. How many vendors do you have normally?

Please choose display products only when they have custom prices option in WooCommerce>>WooCommerce Multilingual>>Multicurrency and check you are getting the expected results. Refer to the following links for more details

hidden link

https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/#configuring-custom-prices-for-different-currencies

--
Thanks!

Bigul

July 17, 2024 at 8:58 am #15964859

shaiR

Thank you,

Prices are customized for the customer. that in each country a different currency will be presented.

I want customized for the vendor.
If I have 2 vendors, one from the USA and whose currency is dollars, and the other from Europe whose currency is euros, I want each of them to be able to import the products with their own currency.

I want them both to have the option to sync their website with mine. And if one vendor has a website and the prices are in dollars and the other vendor's website has the prices in euros, I want each of them to have a different main currency so that each of them can synchronize with their own currency.

That's why I asked if there is a way to define a single product with a different main currency. Because if there is a way, I can define that all the products of a certain seller will have a different currency as their main currency.

Currently I have 100 venders. I am working now to add more venders to my website.

July 17, 2024 at 4:26 pm #15967429

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the feedback. I am consulting with our team for an expert opinion on this. We will get back to you as early as possible. Please wait.

--
Thanks!

Bigul

July 18, 2024 at 12:06 pm #15972399

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

We are sorry to inform you that currently, WooCommerce Multilingual or WooCommerce doesn't support setting a specific currency for a vendor, user, or country. However, the upcoming WooCommerce Multilingual version (5.5) will include a feature to set prices based on the country, but it's still in the early development stage.

For now, you might need a custom plugin to meet your needs. You could also try some other plugins like the following (though we haven't tested them ourselves).

https://wordpress.org/plugins/woocommerce-product-price-based-on-countries/

Thank you for your kind understanding. For custom development, feel free to reach out to our certified developers. Please check the following links for more details.

https://wpml.org/contractors/

https://wpml.org/purchase/support-policy/

--
Thanks!

Bigul

July 18, 2024 at 12:12 pm #15972413

shaiR

Thank you,

I'm working with a developer on Dokan and we are trying to use the automatic currency function to get the products pricing updated by each individual store's currency (we added this field in Dokan store settings) instead of it using $woo main currency,,, do you have any advice of idea to help us find what we need?

July 18, 2024 at 12:50 pm #15972639

shaiR

Could you please point to the function that is auto updating the product prices in other currencies?

July 19, 2024 at 7:09 am #15976253

Bigul
Supporter

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the feedback. We can use wcml_raw_price_amount hook to convert from the WooCoommerce default currency price (of a Product) to another currency. Refer to the following URL for more details.

https://wpml.org/wcml-hook/wcml_raw_price_amount/

And for this Could you please point to the function that is auto updating the product prices in other currencies?, you can try like the following. But haven't tested it before. We are sorry, but as per our support policy, we have limitations on assisting with custom coding. Thank you for your understanding.

$service = \WPML\Container\make( \WCML_Exchange_Rates::class );
$service->update_exchange_rates();

The update_exchange_rates function is defined in *wp-content/plugins/woocommerce-multilingual/classes/multi-currency/class-wcml-exchange-rates.php* file (line 151).

--
Thanks!

Bigul

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.