WOOCS - WooCommerce Currency Switcher Professional


WC Fields Factory

Plugin URL: https://wordpress.org/plugins/wc-fields-factory/

From Version 4.1.3 no code required, compatible


For versions before 4.1.3

  • In file functions.php add next code:
    add_filter('wcff_negotiate_price_after_calculation', function($price) {
        if (class_exists('WOOCS')) {
            global $WOOCS;
            if ($WOOCS->is_multiple_allowed) {
                $currencies = $WOOCS->get_currencies();
                $conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
                $price = $price / $conversion_rate;
            }
        }
    
        return $price;
    });

     

  • In file wp-content\plugins\wc-fields-factory\includes\wcff-negotiator.php add next code:
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $prule ['amount'] = $WOOCS->woocs_exchange_value(floatval($prule ['amount']));
        }
    }