
Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on September 21, 2023, 13:58
Hello Daniele
Please try in file - \wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - comment/delete this line - https://share.pluginus.net/image/i20230921145624.png and add this code - https://share.pluginus.net/image/i20230921145659.png
add_action( 'woocommerce_new_order_item', function($item_id, $item, $order_id){
if (wp_doing_ajax() && isset($_POST['action']) && 'woocommerce_add_coupon_discount' == $_POST['action']) {
$currencies = $this->get_currencies();
$order = wc_get_order($order_id);
$_order_currency = $order->get_currency();
if (isset($currencies[$_order_currency])) {
$this->set_currency($_order_currency);
}
$this->set_currency('EUR');
}
}, 10,3 );
and do a test
if you have no experience in programming you can provide me with FTP access - https://share.pluginus.net/image/i20230222134241.png -> https://share.pluginus.net/image/i20230222134615.png - I'll change the code
Hello Daniele
Please try in file - \wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php - comment/delete this line - https://share.pluginus.net/image/i20230921145624.png and add this code - https://share.pluginus.net/image/i20230921145659.png
add_action( 'woocommerce_new_order_item', function($item_id, $item, $order_id){
if (wp_doing_ajax() && isset($_POST['action']) && 'woocommerce_add_coupon_discount' == $_POST['action']) {
$currencies = $this->get_currencies();
$order = wc_get_order($order_id);
$_order_currency = $order->get_currency();
if (isset($currencies[$_order_currency])) {
$this->set_currency($_order_currency);
}
$this->set_currency('EUR');
}
}, 10,3 );
and do a test
if you have no experience in programming you can provide me with FTP access - https://share.pluginus.net/image/i20230222134241.png -> https://share.pluginus.net/image/i20230222134615.png - I'll change the code