We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Next and Previous product of Collection

Solved

Next and Previous product of Collection

boxxi
New Member
5 0 0

Hello Community,

 

After a lot of time trying to sort this out, i am finally recurring to the community to see if someone can help me with this issue i just can't seem to overcome.

 

I've added a next and previous button to the product page so customers can navigate through products without having to leave the product page. Everything works ok with only one minor, that is a major issue. I have my products in collections, when visitors enter the collection they see the products on that collection, but if they click on a product and enter the product page, if they opt to navigate using the buttons next and previous, the next or previous product is not the product inside that category but the next product of the product list.

 

I'll leave here the links for the store and for a collection, so you are able to see what i mean:

 

https://boxxi.store/collections/quadricula-ai-art-online-lisbon-gift-shop

(This is the main page, which is also a collection with all the products)

 

Then i have other collections with specific products, for instance:

https://boxxi.store/collections/trams

 

In the first case, there's no issue with the next and previous buttons as it has all the products, but on the Trams case, it does. People enter and when navigating through products the Next or Previous one is not the one in the category.

 

Can someone help me figure out how to allow navigation amongst the collection products?

 

Thanks in advance community.

Accepted Solution (1)

EBOOST
Shopify Partner
1409 352 438

This is an accepted solution.

Hi @boxxi ,

May I suggest to update code these steps:

1. Go to Store Online-> theme -> edit code

EBOOST_1-1672356985580.png

2. Snippets/card-product.liquid

3. Find  "card_product.url" 

4. Add code "| within: collection" after that it ( need update 2 positions). Refer the screenshot below 

EBOOST_0-1721027643439.png

 

 

- Hope can help. If you find my reply helpful, please hit Like and Mark as Solution
- Need a Shopify developer? Contact email: eboost10@gmail.com
- Visit our site: https://www.eboosttech.net to view and download shopify themes and magento2 extensions free. Github.com/eboost10
- ❤❤DONATE ❤❤Coffee tips

View solution in original post

Replies 2 (2)

EBOOST
Shopify Partner
1409 352 438

This is an accepted solution.

Hi @boxxi ,

May I suggest to update code these steps:

1. Go to Store Online-> theme -> edit code

EBOOST_1-1672356985580.png

2. Snippets/card-product.liquid

3. Find  "card_product.url" 

4. Add code "| within: collection" after that it ( need update 2 positions). Refer the screenshot below 

EBOOST_0-1721027643439.png

 

 

- Hope can help. If you find my reply helpful, please hit Like and Mark as Solution
- Need a Shopify developer? Contact email: eboost10@gmail.com
- Visit our site: https://www.eboosttech.net to view and download shopify themes and magento2 extensions free. Github.com/eboost10
- ❤❤DONATE ❤❤Coffee tips
boxxi
New Member
5 0 0

Thank you so much!

 

I should have gotten to the community before i burnt millions of neurons!

 

That sealed the deal.

 

 

All the best!