collection.next_product Object - Cannot get to work

Solved
NolanDubyu
Shopify Partner
8 1 0

I've tried 30 different samples of the code below and every example I see says "use it in product.liquid", well that doesn't work.. I've got a collection with two products in it. 

 

 

This is the code I'm trying to use - in product.liquid section. 

 
  {% if collection %}
  {% if collection.previous_product %}
    {{ 'Previous Product' | link_to: collection.previous_product }} |
  {% endif %}
  {% if collection.next_product %}
    {{ 'Next Product' | link_to: collection.next_product }}
  {% endif %}
{% endif %}

 

Accepted Solution (1)

Accepted Solutions
NolanDubyu
Shopify Partner
8 1 0

This is an accepted solution.

I figured it out!

 

It will only appear if you browse from /collections. So your product URL would look something like this: myshopify.com/collections/test-collection/products/22-alloy-steel

View solution in original post

Replies 4 (4)
NolanDubyu
Shopify Partner
8 1 0

This is an accepted solution.

I figured it out!

 

It will only appear if you browse from /collections. So your product URL would look something like this: myshopify.com/collections/test-collection/products/22-alloy-steel

View solution in original post

Sanjay_Khunt
Shopify Expert
2 0 0

I have checked this but still not working. Is there any new options to solve this ?