• Resolved biggatings

    (@biggatings)


    Hi,

    2 years ago you had the solution below, but when I set it up it breaks my site. I have 2 currencies using YayCurrencies plugin and when I switch from the default currency (JMD) to USD the values remain the same. How can I get this to work?

    This is the solution you posted before:
    You can use the following steps to use multiple currencies at the same time (quick and dirty short term fix):
    1. install YayCurrency
    2. configure the plugin, set currency exchange rate to 1 to 1
    3. use code snippets to add the following code:

    use Yay_Currency\WooCommerceCurrency;
        
    $yay = WooCommerceCurrency::getInstance();
    
    remove_filter( 'woocommerce_product_get_price', array($yay, 'custom_raw_price'), 10, 2 );
    remove_filter( 'woocommerce_product_get_regular_price', array($yay, 'custom_raw_price'), 10, 2 );
    remove_filter( 'woocommerce_product_get_sale_price', array($yay, 'custom_raw_price'), 10, 2 );
    
    remove_filter( 'woocommerce_product_variation_get_price', array($yay, 'custom_raw_price'), 10, 2 );
    remove_filter( 'woocommerce_product_variation_get_regular_price', array($yay, 'custom_raw_price'), 10, 2 );
    remove_filter( 'woocommerce_product_variation_get_sale_price', array($yay, 'custom_raw_price'), 10, 2 );
    
    remove_filter( 'woocommerce_variation_prices_price', array($yay, 'custom_raw_price'), 10, 2 );
    remove_filter( 'woocommerce_variation_prices_regular_price', array($yay, 'custom_raw_price'), 10, 2 );
    remove_filter( 'woocommerce_variation_prices_sale_price', array($yay, 'custom_raw_price'), 10, 2 );
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.