Displaying images from a WooCommerce Product Gallery

Hey all,

So, I have no idea how to display WooCommerce gallery images.

works just fine for the featured product image, but I want the other product images to show too.

Any ideas?

Hi @mburke,

The code below might help.

<Loop type=product id="<product_id>">
   <Loop type=attachment id="{Field _product_image_gallery}">
      <img src="{Field url size=large}" alt="{Field alt}" class="wp-image-{Field id}" srcset="{Field srcset size=large}" sizes="{Field sizes size=large}" />
   </Loop>
</Loop>

Likewise, it could be used like the code below if you want.

<Slider controls=true pager=true  items=5 auto=true speed=1500 drag=true responsive="[{ break: 1080, items: 3 }, { break: 350, items: 2 }]" loop=false>
   <Loop type=product id="4136">
      <Loop type=attachment id="{Field _product_image_gallery}">
         <If field=image>
            <Slide>
               <img src="{Field url size=large}" alt="{Field alt}" class="wp-image-{Field id}" srcset="{Field srcset size=large}" sizes="{Field sizes size=large}" />
            </Slide>
         </If>
      </Loop>
   </Loop>
</Slider>