Want a different Featured photo on product page than on collection page

5 0 2

I am wanting to have a different feature photo on a product page from the collection page. For example:  On one of my collection pages, I want all of the product featured photos to be a detail photo of the product. Once the item is clicked on and taken to the product page, I want the first image they see to be a different image of the ones I uploaded. (A full view of the product).  I am using the minimal template.

Is this possible to do? Thank you in advance! :)

1 Like
Shopify Expert
460 0 74

In the product.liquid template,

replace this line:

{% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}

with this:

{% assign featured_image = product.images[1] | default: product.featured_image %}

This will grab the second uploaded image (the one right after the featured image) to show as the main image on the product page.

19 0 2

I can not find the code in debut theme. Do you know how to do it?