• Resolved starpainttech

    (@starpainttech)


    Please check this in mobile view or on smartphone – the filters are at the bottom of the shop page, which is ok, because there is not enough realestate for a sidebar on the side

    problem is our filters are for product categories

    1. when you click a category for example pulverpistole
    2. the filter applies but the screen remains at the filter section
    3. this leads the end user to believe there are no products
    4. unless he sees he / she must scroll to top of page

    can you tell me what setting i need to trigger back to the top of the page after the filter is applied ?

    thank you

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Facundo Arano

    (@aranofacundo)

    Hi there,

    I hope you’re doing well. To scroll to top when the filters are applied you could try using the following PHP code in the functions.php file of your current theme:

    if ( ! function_exists( 'yith_wcan_custom_scroll_on_apply_filter' ) ) {
    function yith_wcan_custom_scroll_on_apply_filter() {
    $js = "
    jQuery( ( $ ) => {
    $( document ).on( 'yith-wcan-ajax-filtered', function (){
    $( window ).scrollTop( $( '#main-content' ).offset().top );
    });
    } );
    ";
    wp_add_inline_script( 'yith-wcan-shortcodes', $js );
    }
    add_action( 'wp_enqueue_scripts', 'yith_wcan_custom_scroll_on_apply_filter', 99 );
    }

    Let us know if this helped you.

    Thread Starter starpainttech

    (@starpainttech)

    Perfect – thank you very much. I see others in the past wanted this solution, I hope it helps them.

    Plugin Support Alessio Torrisi

    (@alessio91)

    Hello there,

    we were happy assist you with this solution.

    If our support and product satisfy you, feel free to leave a review here, your feedback will be much appreciated ??

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