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

Last updated by addisonW 3 months, 1 week ago.

Assigned support staff: Radu.

Author Posts
July 10, 2019 at 11:42 am #4179581

addisonW

Hello Team,

I am developing mobile APP and need to use the WooCommerce REST API(/wp-json/wc/v3/products/), and I have installed WooCommerce Multilingual (Plugin) and enabled Multi-currency.

Now, I am going to view the WooCommerce REST API(/wp-json/wc/v3/products/), I can see that the value of below

"multi-currency-prices": {
"HKD": {
"regular_price": 140.4
}

But I don't know how to get the multi-currency-prices value? (P.S. I saw the hidden link and all of the default Woocommerce value I can get except the multi-currency-prices)

Many thanks!

July 10, 2019 at 2:10 pm #4181203

Radu
Supporter

Languages: English (English )

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

Hey Addison,

Thank you for reaching out the WPML support!

Have you tried to get the products as explained here https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/#get-products ? Also, what's the main currency and the other currencies are you using? Are you adding the prices in the other currencies manually or is this done automatically? I need a few more details so I can check this on my website.

Thanks,
Radu

July 10, 2019 at 4:49 pm #4182817

addisonW

Hello Radu,

Nice to meet you.

I am using Ionic 4 to develop the mobile APP. I have two currencies, the main currency is USD, and the second one is HKD(Hong Kong dollar)

And I have not tried your method - https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/#get-products.

At this time, I can get the default WooCommerce on Level 1 value

"price": "18", <-----USD price
"regular_price": "18", <-----USD price

But I can not get below Level 3 value

"multi-currency-prices": {
"HKD": {
"regular_price": 140.4 <-----HKD price
}
},

Many thanks 🙂

July 11, 2019 at 1:52 pm #4190495

Radu
Supporter

Languages: English (English )

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

Hey Addison,

So, as I understand from your message, this part is missing from the response, am I right?

"multi-currency-prices": {
"HKD": {
"regular_price": 140.4
}

Can you tell me if you tried to use the method presented in the link I previously attached, please? I'm not familiar with Ionic and I don't know if you can use PHP or not. If I remember correctly, this is based on JavaScript so you'll need to use cURL instead. I just wanted to check this to make sure that I'm looking for the right solution.

Thanks,
Radu

July 11, 2019 at 8:25 pm #4193049

addisonW

My issue is resolved now. Thank you!