• Hello,

    I’m using WPML with the WooCommerce Multilingual & Multicurrency plugin. I’ve added the following code to my theme to ensure the currency parameter is appended to the URL when switching currencies:

    add_filter( 'wcml_is_cache_enabled_for_switching_currency', '__return_true' );

    However, the problem is that the currency parameter only appears in the URL once when the currency is initially selected. After navigating to another page the wcmlc={currency_code} parameter disappears from the URL. I need to keep the currency parameter on all subpages and product page URLs to ensure proper site caching.


    Thank you in advance!

Viewing 1 replies (of 1 total)
  • Plugin Support Nicolas V.

    (@nicolasviallet)

    Hi Michal,

    Did you consider switching the storage strategy to cookies? This could help with caching issues since cookies are stored client-side.

    // Use Cookie instead of WCSession
    add_filter( 'wcml_user_store_strategy', function ( $strategy, $key ) {
    return 'cookie';
    }, 10, 2 );

    Ref: https://wpml.org/wcml-hook/wcml_user_store_strategy/

    If the issue persists, please open a chat on our support forum. Our team will have the tools to assist you further.

    • This reply was modified 1 year, 2 months ago by Nicolas V..
Viewing 1 replies (of 1 total)

The topic ‘Parameter wcmlc={currency_code} disappearing from URL’ is closed to new replies.