Shopify plugin – fetch image of variant

Hello! Within the auto-populated structure field on the product page, is it possible to also fetch the variant’s image URL?

There’s the useful auto-populated images field listing all the product’s images however, there’s no way to find out which image belongs to which variant (I guess).

Maybe @tristantbg can help :smiley:


(Screenshot of the structure field:)

I found out that you can’t really fetch a src attribute from the Shopify API response. However you can fetch the ID of the image used for the variant.

1 Like

Hi @Tobias_L ,

This seems like a nice upgrade. Do you have the code to make these variant/images relations ? Don’t hesitate to make a pull request on the Kirby Shopify repo !