collection.next_product Object - Cannot get to work

Solved
Highlighted
Shopify Partner
4 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 %}

 

0 Likes
Shopify Partner
4 1 0

Success.

Shopify Partner
4 1 0

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

0 Likes