Home Forums WoodMart support forum Pagination Issue when logged in

Pagination Issue when logged in

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #253584

    kingy
    Participant

    Hi,

    No matter which Products pagination setting I use, if I’m logged in (as admin), the pagination options such as infinite scroll, go to page 2, or click to load more are not shown on the front end. All products are displayed on a single shop/category page instead!

    If I check when not logged in for example in Incognito or another web browser, then they show and all is well.

    I tried copying the link from another browser for page 2 of the shop: https://site.com/shop/page/2/ into my main browser whilst logged in and the page shows as a 404, but works when in incognito/another browser when not logged in.

    It seems the woocommerce-pagination div in product-footer div is not loading whilst logged in?

    If I log out and clear the cache, then it works, but then if I log back in and update a product, the problem comes back.

    Any idea what the issue is?

    #253603

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we could check it?

    Thank you in advance

    #253653

    kingy
    Participant

    All deactivated. Details attached.

    You’ll be able to see the issue by simply editing a product and clicking update, and then looking at the shop or category page(s) that contain products, as any pagination will be missing and all products will be displayed on the page even though max has been set to 12.

    If you click the “show: 12” grid menu on the page then it works, but as soon as you update a product it seems to default to another number or something (like -1?) I assume, as pagination doesn’t shown then.

    #253658

    Artem Temos
    Keymaster

    Please, send us your FTP access as well.

    #253659

    kingy
    Participant

    Okay

    #253673

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function woodmart_products_per_page_action() {
    		if ( isset( $_REQUEST['per_page'] ) && 1 != $_REQUEST['per_page'] && ! isset( $_REQUEST['_locale'] ) ) {
    			setcookie( 'shop_per_page', intval( $_REQUEST['per_page'] ), 0, COOKIEPATH, COOKIE_DOMAIN, false, false );
    		}
    	}
    #253677

    kingy
    Participant

    Thanks a lot, that fixed it! I assumed it was a cookie issue, too.

    Is this something that will be resolved in the next theme update, so I can then remove the snippet?

    #253868

    Artem Temos
    Keymaster

    Yes, we will definitely fix this in our next theme update so you won’t need to keep the code.

    Regards

Viewing 8 posts - 1 through 8 (of 8 total)