Pagination not working on search results

This topic has 2 replies, 2 voices, and was last updated 1 days, 12 hours ago ago by Andrew Mitchell

  • Avatar: Enmanuel_Rostran
    Enmanuel Rostran
    Participant
    December 1, 2025 at 22:07

    Hello XStore Support Team,

    I hope you’re doing well.

    I recently had an open ticket where your team (Jack Richardson) installed all the latest XStore patches on my website to fix an issue related to product visibility on search and shop pages.
    Here is the last message from the previous ticket for context:

    “Please check now. We have installed all the latest patches.”
    — Jack Richardson, 8Theme Team

    The initial issue was resolved — products now display correctly on search results and shop pages.

    However, I discovered a new problem: Pagination is not working

    When I try to navigate to page 2 (or any other page) in the product search results, nothing happens. The page stays on page 1.

    Additionally:

    When I try to manually visit a deeper page, like page 16, the layout breaks.

    The product grid loads incorrectly (images stretched, products misaligned, broken structure).

    The pagination links visually respond, but the content does not change.

    This happens only in the search results pagination.
    The issue was not noticed earlier because the previous problem prevented any results from showing.

    Content is visible for topic creator and
    support staff only.
    Files is visible for topic creator and
    support staff only.
    1 Answer
    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    December 2, 2025 at 10:56

    Hello, Enmanuel,

    Thank you for providing access. We have resolved the issue by adding the following file to your child theme:
    xstore-child/js/fix-ampersant.js
    with the corresponding code.

    jQuery(function($){
    
        function fixAmpersands(context){
            $(context).find('.page-numbers a, a.page-numbers, .woocommerce-pagination a')
                .each(function () {
                    let href = $(this).attr('href');
                    if(href){
                        href = href.replace(/#038;/g, '&').replace(/&/g, '&');
                        $(this).attr('href', href);
                    }
                });
        }
    
        fixAmpersands(document);
    
        $(document).on('elementor/popup/show elementor/popup/hide elementor/frontend/init elementor/page/init', function(){
            fixAmpersands(document);
        });
    
        $(document).on('et_ajax_request_success et_pb_ajax_page et_load_products et_filter_products', function(){
            fixAmpersands(document);
        });
    
        $(document).ajaxComplete(function(){
            fixAmpersands(document);
        });
    
        const observer = new MutationObserver(function(mutations){
            mutations.forEach(function(m){
                if(m.addedNodes.length > 0){
                    fixAmpersands(document);
                }
            });
        });
        observer.observe(document.body, { childList: true, subtree: true });
    
    });

    We have also added the following custom code to xstore-child/functions.php.
    add_action( ‘wp_enqueue_scripts’, ‘fix_ampersant_script’ );

    function fix_ampersant_script() {
        wp_register_script(
            'fix-ampersant',
            get_stylesheet_directory_uri() . '/js/fix-ampersant.js',
            array('jquery'),
            '1.0',
            true
        );
    
        wp_enqueue_script('fix-ampersant');
    }

    Please remember to clear your browser cache before checking the results.

    Best regards,
    8Theme Team

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.