Quote from Pablo Borysenco on February 15, 2022, 10:52
Hello Nazrul
Sure! There are several ways
But first I want to give a few explanations:
- In the plugin, you can set the base currency, this currency in which all prices are stored. In fact, this is "from currency"
- if you use the standard methods of getting the price, the price will be converted using hooks
To convert price(any value):
1 read this - https://currency-switcher.com/hook/woocs_convert_price (the price must be transmitted in the base currency) This will convert to current currency. To set current currency - https://currency-switcher.com/function/woocs-set_currency
2 You can use functions:
global $WOOCS;
$WOOCS->set_currency('EUR');
$eur_price = $WOOCS->woocs_exchange_value($value) ;
3 Or standard functionality:
global $WOOCS;
$WOOCS->set_currency('EUR');
$eur_price = $product->get_price();
More info - https://currency-switcher.com/codex
Examples of adaptations - https://currency-switcher.com/codex#code
If you have any more questions write to me. You can also send specific pieces of code, I will try to help with the solution
Hello Nazrul
Sure! There are several ways
But first I want to give a few explanations:
- In the plugin, you can set the base currency, this currency in which all prices are stored. In fact, this is"from currency"
- if you use the standard methods of getting the price, the price will be converted using hooks
To convert price(any value):
1 read this - https://currency-switcher.com/hook/woocs_convert_price (the price must be transmitted in the base currency) This will convert to current currency. To set current currency - https://currency-switcher.com/function/woocs-set_currency
2 You can use functions:
global $WOOCS;
$WOOCS->set_currency('EUR');
$eur_price = $WOOCS->woocs_exchange_value($value) ;
3 Or standard functionality:
global $WOOCS;
$WOOCS->set_currency('EUR');
$eur_price = $product->get_price();
More info - https://currency-switcher.com/codex
Examples of adaptations - https://currency-switcher.com/codex#code
If you have any more questions write to me. You can also send specific pieces of code, I will try to help with the solution