FOX - Currency Switcher for WooCommerce

Product Bundles (by WooCommerce) — Prend en compte le paiement multi-devises

URL du plugin : https://woocommerce.com/products/product-bundles/ Nouvelle adaptation : /product-bundles-by-somewherewarm/
 
  • 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'];
            }
        }
    }
  • 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 ajoutez cette ligne http://c2n.me/3Q92BCO.png '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);
            }
        }
    }

Product Bundles (by WooCommerce)Product Bundles (by WooCommerce)Product Bundles (by WooCommerce)Product Bundles (by WooCommerce)Product Bundles (by WooCommerce)Product Bundles (by WooCommerce)Product Bundles (by WooCommerce)