Site logo

Archived topic

Navigation arrows on Single Product Pages are not navigating through all product

10 replies · Started by Jack on May 18, 2020

Viewing posts 1–11 of 11

Hey there,

The navigation arrows on the WooCommerce single products don't navigate through the products in a logical order.

They also only navigate through 3-4 products and then show that I've reached the end (I currently have 17 products.)

An example is this product: https://fitzroyproject.com.au/product/52-charles-street/

How can I fix this?

Hi there,

how were the navigation arrows added?
Did you import the Imprint site originally ?

let me know

Hi David,

That's correct. Apart from changing the border, they're the same arrows.

Cheers

That's strange, are all products apart of the same category/do they all have categories?

Sorry for the slow reply Tom.

They are all from the same category..."Jack Magnus McDonald."

The shop page has a Gutenberg Block displaying all products. And they're ordered by "most recent"...

But that shouldn't impact the nav arrows on the single product pages?

Go to Appearance > Elements and edit the Single Product Next Previous hook

Replace these two lines:

$previous = next_post_link('%link', '←');
$next = previous_post_link('%link', '→');

with:

$previous = next_post_link('%link', '←', TRUE, ' ', 'product_cat');
$next = previous_post_link('%link', '→', TRUE, ' ', 'product_cat');

This should look the navigation to the same category.... and hopefully fix the issue...

Hi David,

I just did this but unfortunately it's still not working.

Any other ideas?

Well it has me stumped.
On all my tests it works fine when using Simple products without any taxonomies.
Minute we add anything that complicates the product or involves a taxonomy then it all goes ape...

I am not sure we can fix this....

Bugger. Thanks for your help.

Cheers

Sorry about that - thanks for pointing out the issue - ill update the site and this topic if we find a reliable solution

This archived topic is closed to new replies.