WOOCS - WooCommerce Currency Switcher

WooCommerce Composite Products

Plugin link: https://woocommerce.com/products/composite-products/

  • in file wp-content\plugins\woocommerce-composite-products\includes\class-wc-cp-display.php add next code: $suffix=”;
  • in file wp-content\plugins\woocommerce-composite-products\assets\js\frontend\add-to-cart-composite.js add next code:
    if (woocs_current_currency != undefined && woocs_current_currency['rate'] != undefined) {
        price_data.base_price = price_data.base_price * woocs_current_currency['rate'];
        price_data.base_regular_price   = price_data.base_regular_price * woocs_current_currency['rate'];
        composite_totals.price   = composite_totals.price   * woocs_current_currency['rate'];
        composite_totals.regular_price = composite_totals.regular_price * woocs_current_currency['rate'];
    }

  • in file functions.php add next code:
    add_filter('woocs_fixed_raw_woocommerce_price', function($tmp_val, $product, $price) {
        if ($price == 0) {
            return $price;
        }
        return $tmp_val;
    }, 999, 3);