
steinolaf@dlr-as.com(@steinolaf-dlr-as-com)
1 Post
Customers
Quote from steinolaf@dlr-as.com on July 21, 2020, 23:51
I use a plugin to create a product feed for a price comparision site in Poland. Our store use EUR as default, while the Polish site requires us to use PLN in the feed. The plugin does not offer any way to manipulate the price, but I managed to create the feed in PLN by edition the coding of the feed plugin:
public function get_value( $source ) {
return number_format( round( 4.4539098739624 * wpdesk_get_price_including_tax( $source ), 2 ), 2, '.', '' );
The value 4.4539098739624 is the exchange rate PLN/EUR.
The problem with this coding is that I have to manually update the currency rate every day or week. How do I get the exchange rate as a "function/coding format"? Must be something like woocs_rate_PLN or something similar?
I know this is not a support issue about the plugin, but as a developer of the plugin I guess this is something that is easy to help me with?
I use a plugin to create a product feed for a price comparision site in Poland. Our store use EUR as default, while the Polish site requires us to use PLN in the feed. The plugin does not offer any way to manipulate the price, but I managed to create the feed in PLN by edition the coding of the feed plugin:
public function get_value( $source ) {
return number_format( round( 4.4539098739624 * wpdesk_get_price_including_tax( $source ), 2 ), 2, '.', '' );
The value 4.4539098739624 is the exchange rate PLN/EUR.
The problem with this coding is that I have to manually update the currency rate every day or week. How do I get the exchange rate as a"function/coding format"? Must be something like woocs_rate_PLN or something similar?
I know this is not a support issue about the plugin, but as a developer of the plugin I guess this is something that is easy to help me with?

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on July 22, 2020, 11:42
Hello
Try to use this code
$price = wpdesk_get_price_including_tax( $source );
if (class_exists('WOOCS')) {
global $WOOCS;
$currrent = 'PLN'
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$price = $price*$rate;
}
}
Hello
Try to use this code
$price = wpdesk_get_price_including_tax( $source );
if (class_exists('WOOCS')) {
global $WOOCS;
$currrent = 'PLN'
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$price = $price*$rate;
}
}