Hello,
The first line of code at first seemed to get the Previous/Next buttons working better by advancing the page from one product to the next without having to view every variant, except it broke the product category tree structure/directory. So when I click on the Spanish gallery and open the first photograph, then click next, I get the next photograph only it's a China (different category) based photograph - strangely, it says that this China based photograph is in the Spain gallery - it is not, I double checked in the products section in the backend. Naturally, I would like to see the next product in the same category listing.
I think the initial problem of it getting stuck on one product or only going between one or two products is stemming from the fact that each product has variants, namely the photograph size and print type. So the previous and next will scroll through all of the same photographs variants before proceeding to the next photograph. I don't think many people would want to look at every single variant of a product before seeing the next; rather, I would like the ability to move through each product in a particular category as if I'm window shopping.
I've left the 1st code change that you recommended intact so you can see how it works. Here's a screencast of the Spain gallery photos so you can compare my results:
screencast.com/t/TvsZ83issq/
I also tried the second code change and it's didn't seem to do anything. I wasn't totally clear of whether I applied that properly (sorry, I don't write PHP only CSS and HTML), so I reverted back to the original.
Thanks for all,
Dawn