FOX - WooCommerce Currency Switcher Professional

YITH WooCommerce Dynamic Pricing and Discounts

Plugin URLhttps://yithemes.com/themes/plugins/yith-woocommerce-dynamic-pricing-and-discounts/

This doesn’t fix bug with mini-basket and not depends of WOOCS code

//in file \plugins\yith-woocommerce-dynamic-pricing-and-discounts-premium\includes\functions.yith-wc-dynamic-pricing.php add next code
if (class_exists('WOOCS')) {
    global $WOOCS;
    if ($WOOCS->is_multiple_allowed) {
        $currrent = $WOOCS->current_currency;
        if ($currrent != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            $rate = $currencies[$currrent]['rate'];
            $discount = $discount * ($rate);
        }
    }
}

if (class_exists('WOOCS')) {
    global $WOOCS;
    if ($WOOCS->is_multiple_allowed) {
        $currrent = $WOOCS->current_currency;
        if ($currrent != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            $rate = $currencies[$currrent]['rate'];
            $rule['discount_amount'] = $rule['discount_amount'] * ($rate);
        }
    }
}


//In file \plugins\yith-woocommerce-dynamic-pricing-and-discounts-premium\includes\class-yith-wc-dynamic-pricing.php replace to code (see screen #3 below)
if (!$discount['onsale'] && ( ($product->get_sale_price() !== '' AND $product->get_sale_price() > 0) && $product->get_sale_price() !== $product->get_regular_price() ))
    

//and add next code
if (class_exists('WOOCS')) {
    global $WOOCS;
    if ($WOOCS->current_currency != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) {
        $currencies = $WOOCS->get_currencies();
        $price = $price / $currencies[$WOOCS->current_currency]['rate'];
    }
}

 


Also if still troubles try in file: wp-content\plugins\woocommerce-currency-switcher\classes\woocs.php change next code: