Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Woocommerce pagination links are 404 from page 2+
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Woocommerce pagination links are 404 from page 2+
- This topic has 9 replies, 4 voices, and was last updated 9 years by Swift Ideas – Ed.
-
Posted in: Neighborhood
-
October 2, 2014 at 3:26 am #116534
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 linkSolution: The show products links should remove the page parameter from the URL rather than just appending “?show_products=x” to the current URL.
-Aaron
October 2, 2014 at 8:55 am #116620Hi
I thought this was fixed in the 1.92 update, will forward this to the developer
– Kyle
October 21, 2014 at 6:14 am #121753Hi Kyle,
I haven’t heard back on this, but it’s definitely not fixed as of 1.93. Any update?
October 21, 2014 at 8:21 am #121775Hi,
The developer of theme will assist you shortly.
Thanks
MohammadOctober 21, 2014 at 2:15 pm #121986How 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
October 22, 2014 at 7:29 am #122198Updated 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).
October 22, 2014 at 7:30 am #122199(attaching file again to pass forum security)
Attachments:
You must be logged in to view attached files.October 22, 2014 at 6:17 pm #122437In 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
October 23, 2014 at 3:12 am #122487This reply has been marked as private.October 23, 2014 at 4:14 am #122490Thanks 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
-
Posted in: Neighborhood
You must be logged in to reply to this topic.