Change Product Image Depending on Collection

greebrickbtq
Visitor
1 0 0

I've looked at related threads and can't figure this out for my own site based on those.

I'd like a different image to display first depending on which collection is being viewed.

For example, I have shirts that fall in the regular and curvy collections. In 'tops' I want the first image to display in the collection (default), in 'curvy tops' I want the second image to display first.

I'm using the Prestige theme.

Reply 1 (1)

theuntakenname
Shopify Partner
17 0 0

this looks useful

https://community.shopify.com/c/technical-q-a/change-product-image-based-on-collection/m-p/570499#M1...

 

if you are using variants, this looks nicer

https://sections.design/blogs/shopify/different-product-images-on-collections

 

i am trying to solve a similar issue, i want to show a different featured product image, depending on its collection, however my choice of featured image is in a variable position in the gallery, not always second position. 

 

i think i'm going to make hundreds of 'if ' statements in the theme code, and for each custom collection i will specify the replacement image URL for every product

 

not very elegant, i wonder if there is a better way?