Answer the question
In order to leave comments, you need to log in
How to get currency of current language in wpml + woocommerce site?
Hello. I was puzzled by one question in the internet, I do not find a solution.
There are two languages in the store English and German, and respectively two currencies $ and €.
When switching from English to German, the price of the product changes from $ to € .
I put the goods in the basket, everything is ok, then I want to load them via Ajax add. goods receiving the ID of the goods through get_cross_sell_ids().
Next do:
global $woocommerce_wpml;
$_product = wc_get_product( $product_id );
$currency_symbol = get_woocommerce_currency_symbol( $woocommerce_wpml->multi_currency->get_client_currency() );
$price = $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency( $product_id, '' );
Но $currency_symbol и $price отображают евро на немецком, если пользователь авторизован.
$_product->get_price_html() - Всегда отображает $, хотя выбран немецкий язык на сайте
Answer the question
In order to leave comments, you need to log in
Hello!
https://wpml.org/documentation/related-projects/wo...
https://ru.wordpress.org/plugins/woo-multi-currency/
https://shopitpress.com/blog/woocommerce-setup/ woo...
https://woocommerce.com/products/multi-currency/
Have you looked at these links by any chance?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question