WOOCS - Sélecteur de devise WooCommerce

Points de récompense SUMO - Système de récompense WooCommerce

Lien du plugin: https://codecanyon.net/item/sumo-reward-points-woocommerce-reward-system/7791451

  • dans le fichier wp-content\plugins\rewardsystem\includes\class-fp-common-functions.php ajouter du code :
    if (class_exists('WOOCS') AND $Type != 'price') {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $currrent = $WOOCS->current_currency;
            if ($currrent != $WOOCS->default_currency) {
                $currencies = $WOOCS->get_currencies();
                $rate = $currencies[$currrent]['rate'];
    
                $Value = round($Value / $rate, 2);
            }
        }
    }
    
    $ConvertedValue = ($Type == 'price') ? (((float) $Value / $PointValue) * $RedeemPercent) : (((float) $Value * $PointValue) / $RedeemPercent); //Ex:10 * 2 = 20
    
    if (class_exists('WOOCS') AND $Type == 'price') {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $currrent = $WOOCS->current_currency;
            if ($currrent != $WOOCS->default_currency) {
                $currencies = $WOOCS->get_currencies();
                $rate = $currencies[$currrent]['rate'];
                $ConvertedValue = $ConvertedValue * $rate;
            }
        }
    }
  • ET ajoutez le 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'];
                $regularprice = $regularprice / $rate;
            }
        }
    }

  • Dans le fichier wp-content\plugins\rewardsystem\includes\frontend\tab\modules\class-rs-fpredeeming-frontend.php ajouter du 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'];
                $Applied_points = $Applied_points / $rate;
            }
        }
    }