• If you’re viewing products in say Danish Kroner, and you scroll down it starts to display Euro on next page loads. This is because the plugin does not take into account the active currency of the user.

    We’re using the native Multi-Currency setup in WPML.

    We’ve faced this issue earlier on another part of our website (where we have an AJAX quick-view of a product) and below code solves it:


    /**
    * Force currency change
    */

    add_filter( 'wcml_client_currency', function($current) {
    if(isset($_POST['currency']) && $_POST['currency'])
    return $_POST['currency'];

    return $current;
    } );

    /**
    * Add AJAX request to show a single product
    */

    add_action( 'wp_ajax_quick_view_single_product', __NAMESPACE__ . '\\quick_view_single_product' );
    add_action( 'wp_ajax_nopriv_quick_view_single_product', __NAMESPACE__ . '\\quick_view_single_product' );

    function quick_view_single_product() {

    wc_get_template('modal-single-product.php');
    die();
    }

    /**
    * Ensure WCML's currency filters are listened to on specific ajax request
    */

    add_filter( 'wcml_multi_currency_ajax_actions', 'add_action_to_multi_currency_ajax', 10, 1 );

    function add_action_to_multi_currency_ajax( $ajax_actions ) {
    $ajax_actions[] = "quick_view_single_product"; // Add a AJAX action to the array.
    return $ajax_actions;
    }

    • This topic was modified 4 years, 5 months ago by mattiasf.
Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there,
    could you send me a link where i can see the issue? could you try to disable everything except WooCommerce – Infinite and the multicurrency?

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin does not work with multi-currency’ is closed to new replies.