Someone messaged me with the need for a “previous” and “next” link in product_info.php, which links to the previous and next product within the same category.
1. If there is only 1 product in the category: do not show next link, do not show previous link
2. If the viewer is looking at the 1st product in the category: do not show previous link
3. If the viewer is looking at the last product in the category: do not show next link
4. For previous and next links, show the product name
A. Grab the other products in the category being looked at.
B. Pass these into an array
C. Use array functions to grab the array entries either side of the current item
D. Pass those entries into jqueryui buttons and mine the products name
It ended up like this
And in action
Need something similar? Email me, and you can have this for a beer fee.