WOOCS - Sélecteur de devise WooCommerce

YITH WooCommerce Prix et remises dynamiques

URL du plug-in : https://yithemes.com/themes/plugins/yith-woocommerce-dynamic-pricing-and-discounts/

Cela ne corrige pas le bogue avec le mini-panier et ne dépend pas du code WOOCS

//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'];
    }
}