Forum

Thread tagged as: Question, Shop

Variant Image

Hi there!
I've begun to use variants in my shop and my goal is to display variant-related images (i.e. product.html starts off showing some general images, then when the user clicks onto to the variant color "BLUE" the main product images change to the BLUE photos).

So far I've successfully set up variants as a checkbox select where the page loads without an active selection. I plan to trigger the photo changes when the user selects a check box.

I'm stuck at the point of trying to get variant images (from variant.html) to display on product.html.
I've tried all of the shop template tags, but I can't get anything to display my variant images.

I've been referencing this thread a bit: https://forum.grabaperch.com/forum/03-07-2017-product-variants-within-the-add-to-cart-with-options-button-also-with-multiple-options
Cody has the "additional images" (variant images) living with the main product as opposed to living with the variant itself on variant.html. I suppose this is a workaround but it gets messy quickly when you have a lot of images or a lot of variants.

So, is there a way to pull variant product images onto the product page?

Thanks very much!!

Olympia Kyriakides

Olympia Kyriakides 1 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

There's no a way to do that directly. You need to get the images first, and then pass them into the template.