New Landing How can we help? Themeforest Theme Support Neighborhood Woocommerce pagination links are 404 from page 2+

Viewing 10 posts - 1 through 10 (of 10 total)
  • #116534
    airuck
    Member
    Post count: 36

    Hello,

    The problem: The way that category or tag pagination links are built causes links from secondary pages to often break. The “All” link will always return a 404.

    Why it’s happening
    In result-count.php, ?show_products=x is appended to the current URL:
    <a class="show-products-link" href="?show_products=24">24</a>/<a class="show-products-link" href="?show_products=48">48</a>/<a href="?show_products=<?php echo $total;?>"><?php _e("All", "swiftframework"); ?></a>

    However, if the current page is not the first page, the “All” link will cause all results to show in the first page (since the show_products number is applied to the query, and all of those products are put on the first page).

    Example:
    Take a sample url: https://hookandloom.com/rugs/taupe/page/2
    The url for the “All” pagination button is https://hookandloom.com/rugs/taupe/page/2/?show_products=42
    In this example, since all 42 products are displayed on page 1, this means page 2 is a 404 from this link

    Solution: The show products links should remove the page parameter from the URL rather than just appending “?show_products=x” to the current URL.

    -Aaron

    #116620
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    I thought this was fixed in the 1.92 update, will forward this to the developer

    – Kyle

    #121753
    airuck
    Member
    Post count: 36

    Hi Kyle,

    I haven’t heard back on this, but it’s definitely not fixed as of 1.93. Any update?

    #121775
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    The developer of theme will assist you shortly.
    Thanks
    Mohammad

    #121986
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    How did you update? The code in v1.93 is different to what you have posted, and does work 100% as far as we are aware.

    – Ed

    #122198
    airuck
    Member
    Post count: 36

    Updated via wordpress – 1.92 on the install linked above, and 1.93 on our test install, which shows the same results.

    Both versions show the same code: …/neighborhood/woocommerce/loop/result-count.php is the file in question.

    Wordpress currently shows version 1.93, and style.css shows version 1.93 in the opening comment, so the update appeares successful. I attached the file in question (from 1.93 on our test installation).

    #122199
    airuck
    Member
    Post count: 36

    (attaching file again to pass forum security)

    Attachments:
    You must be logged in to view attached files.
    #122437
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    In your code above, the “All” link doesn’t have the class, but it does in the file you’ve attached.

    The reason it’s not working is because you haven’t updated the functions.js file

    – Ed

    #122487
    airuck
    Member
    Post count: 36
    This reply has been marked as private.
    #122490
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Thanks for providing that code, I didn’t think about it that way round when I was developing the solution, and it definitely makes much more sense.

    Appreciate it. Will swap it over for the next update.

    Thanks,

    – Ed

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

You must be logged in to reply to this topic.