A user seeks to add Previous/Next navigation buttons on product pages, allowing customers to browse between products within a collection without returning to the collection page. They’re using the Vision theme and comfortable with CSS implementation.
Solution Provided:
A working solution involves two main steps:
Update snippets/card-product.liquid by modifying all product URLs to include | within: collection
Add navigation button code to sections/main-product.liquid that displays Previous/Next links when products exist in a collection
Key Refinements:
Layout fix: Initial implementation had positioning issues when viewing the first product (Next button appeared on left instead of right). This was resolved with additional CSS code.
Customization: Icon color can be changed using CSS targeting .next-prev-icons svg path
Theme compatibility: While the solution reportedly works across all themes, implementation varies for premium/non-free themes (Honey, Canyon) where theme structure differs and may require custom adjustments.
Status: The core solution is confirmed working by multiple users. Questions remain open for specific premium theme implementations, with offers to provide customized code if theme files are shared.
Summarized with AI on October 31.
AI used: claude-sonnet-4-5-20250929.
I am wondering how to put Previous / Next navigation buttons on product page to get to next/previous product so my customer can click to the next product without having to go back to the collection? Ideally above the image and under the breadcrumb (or on the breadcrumb line)
I am aware it will only work for products pages that are being viewed within a collection URL. Which I think I have!
I have the Vision Theme
I am good with inputting a CSS code. Any help would be very much appreciated!
For accessing the next or previous product, different logics can be used. Some utilize identification-based methods, while others opt for similar collections to determine the next or previous product ID. Which approach do you prefer?
Also, which theme are you currently working on? Knowing this will make it easier for me to provide a suitable response.
update all ‘href="{{ card_product.url }}’ to ‘href=“{{ card_product.url | within: collection }}”’. NOTE: added “| within: collection”
Go to sections/main-product.liquid
Add code below to top of file
{% if collection.previous_product or collection.next_product %}
{% if collection and collection.previous_product %}
Prev
{% endif %}
{% if collection and collection.next_product %}
Next
{% endif %}
{% endif %}
It works but needs a slight tweak. The problem is, if it is the first product in the collection, Next is on the left side but it should be on the right side with Prev on the left side and greyed out/hidden. If you go to next product, Next is on the right side and Prev is on the left side (as it should be). The last product in the collection is fine since Prev is on the left. How to keep Next on the right side when it is the first product in the collection?
This is not free theme. I am not sure theme’s structure. So could you please share code of sections/main-product.liquid file. I help to add code for you.