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.

Tagged: 

This topic contains 2 replies, has 3 voices.

Last updated by mattiasF-3 1 year ago.

Assigned support staff: Bruno.

Author Posts
October 8, 2018 at 3:32 pm #2796708

Lasse Jensen

Hello,

I am using multi currancy on my site. DKK, EURO and GBP.
I have manually entered all prices for all currencies. Now I want to display the product price in all currancies on my product page. That way my customers don't need to use the Currency Switcher to see the product price in EURO or GBP.

So far I have tried this:
function modify_client_currency( $currency ) {
return 'DKK';
}
add_filter( 'wcml_client_currency', 'modify_client_currency', 10, 1 );

global $woocommerce_wpml;
echo $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency( $product->get_id(), 'DKK' ).' DKK<br />';
echo '€'.$woocommerce_wpml->multi_currency->prices->get_product_price_in_currency( $product->get_id(), 'EUR' ).'<br />';
echo '£'.$woocommerce_wpml->multi_currency->prices->get_product_price_in_currency( $product->get_id(), 'GBP' );

But that doesn't work correcly. When I do this the price I have manually entered doesn't show up. But a currency price calculated using the build in exchange rate is being displayed.

So how do I display the product price in all three currancies on the product page at once?

I have been working on this issue all day. Search the forums but nothing helps.

Thank you in advance.

October 9, 2018 at 11:31 pm #2802363

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for contacting us. Please, my sincere apologies for the delay in answering.

Do you want to do this directly using the price of the product? You can do this only by customizing the currency selector, according to our documentation: https://wpml.org/documentation/related-projects/woocommerce-multilingual/designing-custom-currency-switchers-using-template-files/

I think this is one of the few ways you have to do this as a "table" price with the other currencies. As this is a custom feature, unfortunately, this is beyond the scope of our support.

We have a list of WPML and WooCommerce Multilingual hooks that can help you develop such feature, which can be seen in the links below:

- https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference
- https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

If you prefer, you can contact one of our certified partners who can develop small to large features for your site: http://wpml.org/documentation/support/wpml-contractors/

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.

October 21, 2018 at 12:05 am #2834725

mattiasF-3

For what it's worth. This support article shows how to correctly get the price for a specific currency and product.

https://wpml.org/forums/topic/get-product-price-for-each-currencies-in-the-back-end/