• Resolved manhua777

    (@manhua777)


    Hi,

    I wonder if you can make it compatible with WOOCS – WooCommerce Currency Switcher please? Right now the currencies are not converting..

    Regards
    Manhua

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marin Matosevic

    (@marinmatosevic)

    Hi Manhua,

    update the plugin to the latest version (2.2.0), and add this block of code to the functions.php file in your theme.

    
    add_filter('fsl_free_shipping_instance_key', function ($key) {
        $currency = get_woocommerce_currency();
    
        if (defined('WOOCS_VERSION')) {
            $key = 'woocs_fixed_min_shipping_' . $currency;
        }
    
        return $key;
    });
    

    Best regards

    Thread Starter manhua777

    (@manhua777)

    Hi Marin,

    Thank you for your reply. Is it possible to let it convert automatically from USD instead of setting a fixed min order amount in that currency?

    Regards
    Manhua

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    Try with this block of code

    add_filter('fsl_min_amount', function ($amount) {
    
    	global $WOOCS;
    
    	if (!$WOOCS) return $amount;
    
    	$currencies = $WOOCS->get_currencies();
    	$conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
    
    	$amount = $amount * $conversion_rate;
    
    	return $amount;
    });
    Thread Starter manhua777

    (@manhua777)

    Hi Marin,

    The code is working. Thank you so much!

    Regards
    Manhua

    Plugin Author Marin Matosevic

    (@marinmatosevic)

    I’m glad I was able to help.

    If you like a plugin, feel free to leave a review ??

    Best regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Currency not converting’ is closed to new replies.