• Resolved CelieHair

    (@a3360765)


    Hi

    I used code in function.php to modify the price displayed on the front end, but when using currency switching, the page always remains in US dollars. When I turn off the wp super cache plugin, the currency on the page displays the correct currency symbol. I want to know how to make the wp super cache plugin bypass the cache of the currency switching plugin?

    Hope to get help.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    How do you determine the currency? Is it saved in a cookie when the user selects it? You can force the plugin to check for that cookie by using an action to add that cookie name to the plugin configuration.

    That will cause the plugin to create as many cache files as there are currencies on your site, but that’s the simplest way of getting around this problem. (for example, someone using Euro will see a different cache page to someone using GB Sterling)

    Thread Starter CelieHair

    (@a3360765)

    /*

     * Tell WP Super Cache to cache requests with the cookie "eucookie"

    ?* separately from other visitors.

     */

    functionadd_wpsc_cookie_banner() {

        do_action( 'wpsc_add_cookie', 'eucookie');

    }

    add_action( 'init', 'add_wpsc_cookie_banner');



    Hello

    Do you mean I should add this string of code to the function.php file?

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    See where it says “eucookie”? Change that to the name of the cookie that stores the currency on your site. Looking at the web console, I think that’s “wmc_current_currency”.

    Also, change the name of the function from “add_wpsc_cookie_banner”, just in case some other plugin you install uses that name and causes an error on your site. You’ll have to change that in two places in the code.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @a3360765,

    Do you have updates about that, do you still need help? We usually close inactive threads after one week of no movement, but we want to make sure we’re all set before marking it as solved. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.