FOX - Currency Switcher for WooCommerce

Product Bundles — par SomewhereWarm

Plugin link : https://woocommerce.com/products/product-bundles/
  • dans le fichier \wp-content\plugins\woocommerce-product-bundles\includes\class-wc-pb-product-prices.php ajoutez le code :
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->current_currency != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            if ($WOOCS->is_multiple_allowed) {
                $discounted_price = $discounted_price / $currencies[$WOOCS->current_currency]['rate'];
            }
        }
    }
    Product Bundles - by SomewhereWarmProduct Bundles - by SomewhereWarmProduct Bundles - by SomewhereWarmProduct Bundles - by SomewhereWarmProduct Bundles - by SomewhereWarm
  • dans le fichier \wp-content\plugins\woocommerce-product-bundles\includes\class-wc-pb-display.php ajoutez le code :
    $is_multiple = 1;
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if (!$WOOCS->is_multiple_allowed) {
            $is_multiple = 0;
            $suffix = "";
        }
    }
  • et cette ligne de code : 'woocs_is_multiple'=> $is_multiple
  • dans le fichier \wp-content\plugins\woocommerce-product-bundles\assets\js\add-to-cart-bundle.js ajoutez le code :
    /*woocs*/
    if (woocs_current_currency != undefined && woocs_current_currency['rate'] != undefined && wc_bundle_params.woocs_is_multiple==0) {
        price = wc_pb_number_round(price * woocs_current_currency['rate']);
    }
  • dans le fichier \wp-content\plugins\woocommerce-product-bundles\templates\single-product\bundled-item-optional.php ajoutez le code :
    if (class_exists('WOOCS')) {
        global $WOOCS;
        $_price = $bundled_item->product->get_price();
        if ($WOOCS->current_currency != $WOOCS->default_currency) {
            $currencies = $WOOCS->get_currencies();
            if ($WOOCS->is_multiple_allowed) {
                $price_html = $WOOCS->wc_price($_price / $currencies[$WOOCS->current_currency]['rate'], false);
            }
        }
    }

Ancienne adaptation : /product-bundles-woocommerce/