• Resolved chrishd06

    (@chrishd06)


    Good day !

    I am trying to NOT cache my product category (as it is GeoIP based displayed) in the exclude tab but every time I save the setting, in the “Do Not Cache Categories” it disappears from the box, basically it doesn’t save the settings.
    Can you help?

    Thanks,

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    May I know what was the string you put in there ?

    if you put a simple string like “aaa” , does it save ?

    does any other option save or not ?

    Best regards,

    Thread Starter chrishd06

    (@chrishd06)

    No, I dosent save it but maybe it’s because there are two things –
    They are Woocomerce product category and then you have normal categories as well.

    You can see in image below:
    https://pasteboard.co/JFWhYPS.png

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    oh yes , I see , sorry I overlooked the first post.

    Will look into it

    if your category name is show in URL , you can use do not cache URI setting as workaround

    Best regards,

    Thread Starter chrishd06

    (@chrishd06)

    yes, that’s what I did ??

    But then in the header menu, if you have “product categories” then it will be cache.
    and footer as well.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    yeah , confirmed this as a bug , will further investigate

    as quick workaround , add this into your theme’s functions.php

    add_action( 'woocommerce_before_main_content', 'lscwp_nocache' );
    function lscwp_nocache() {
    if( is_product_category( 'category_name' ) ) { 
    do_action( 'litespeed_control_set_nocache', 'custom nocache' );
    }
    }

    replace category_name to the ones you don’t want to cache

    
    add_action( 'woocommerce_before_main_content', 'lscwp_nocache' );
    function lscwp_nocache() {
    if( is_product_category( array( 12,34 ) ) ) {
    do_action( 'litespeed_control_set_nocache', 'custom nocache' );
    }
    }

    use this to exclude certain few cat , where 12 and 34 are category ID

    add_action( 'woocommerce_before_main_content', 'lscwp_nocache' );
    function lscwp_nocache() {
    if ( is_product_category() ) {
    do_action( 'litespeed_control_set_nocache', 'custom nocache' );
    }
    }
    

    use this to exclude all product category page.

    Best regards,

    • This reply was modified 4 years, 2 months ago by qtwrk.
    Thread Starter chrishd06

    (@chrishd06)

    great ?? thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Exclude category dosent save the settings’ is closed to new replies.