How to show other collection members on product page

I am a developer new to Shopify and testing with theme Dawn.

I have created a collection of designer X bedding - sheets, pillows, duvets etc

When I choose a member of the collection, that product page is displayed but no images or links to other members of the same collection.

Making it worse is the display of “you may also like” images at the bottom that are NOT members of the collection!

How do I edit the product page to show other collection member images and Not random other products

Is this a core Shopify issue or Theme specific?

Hi @billium

Hope you are doing great!

To show other collection members on your product page, you can use product.collections to return an array of the collections that the product belongs to. From there, you will probably just want to return the first collection in that array:

{% assign product_collection = product.collections.first %}
{% if product_collection %}
This product is part of my {{ product_collection.title | link_to: product_collection.url }} Collection
{% endif %}

Or you can change the first line to include the handle of your “Collections” linklist:

{% assign custom_collection_linklist = 'all-collections' %}

{% assign product_collections = product.collections | map:'handle' %}
{% for link in linklists[custom_collection_linklist].links %}
  {% if link.type == 'collection_link' and product_collections contains link.object.handle %}
    {% assign product_collection = link.object %}
    {% break %}
  {% endif %}
{% endfor %}

{% if product_collection %}
  This product is part of my {{ product_collection.title | link_to: product_collection.url }} Collection
{% endif %}

I hope this answer helps. If you feel like my answer is helpful, please mark it as a SOLUTION