WOOCS - WooCommerce Currency Switcher Professional


Extra product options For WooCommerce | Custom Product Addons and Fields By ThemeHigh

Plugin link: https://wordpress.org/plugins/woo-extra-product-options/

  • In file functions.php of your current WordPress child-theme add next code:
    add_filter('thwepo_extra_cost_option_price', function ($price, $price_type, $option, $name) {
        if (class_exists('WOOCS') AND $price > 0) {
            global $WOOCS;
            $price = $WOOCS->woocs_exchange_value(floatval($price));
        }
        return $price;
    }, 99, 4);
    
    add_filter('thwepo_extra_cost_unit_price', function ($price, $name, $product_price, $price_type) {
        if (class_exists('WOOCS') AND $price > 0) {
            global $WOOCS;
            $price = $WOOCS->woocs_exchange_value(floatval($price));
        }
        return $price;
    }, 99, 4);
    
  • In file wp-content\plugins\woocommerce-extra-product-options-pro\includes\utils\class-thwepo-utils-field.php add next code:
    if (class_exists('WOOCS') AND $price > 0) {
        global $WOOCS;
        $price = $WOOCS->woocs_exchange_value(floatval($price));
    }
    

  • In file  wp-content\plugins\woocommerce-extra-product-options-pro\includes\class-thwepo-price.php add next code:
    if (class_exists('WOOCS') AND isset($result['extra_price'])) {
        global $WOOCS;
        $result['extra_price'] = $WOOCS->woocs_exchange_value(floatval($result['extra_price']));
    }
    

  • On the same file 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'];
                $new_price = $new_price / $rate;
            }
        }
    }
    

  • On the same file add next code:
    if (class_exists('WOOCS') AND $product_price > 0) {
        global $WOOCS;
        $product_price = $WOOCS->woocs_exchange_value(floatval($product_price));
    }
    

  • On the same file add next code:
    if (class_exists('WOOCS') AND $price > 0) {
        global $WOOCS;
        $price = $WOOCS->woocs_exchange_value(floatval($price));
    }