show product gallery in shop/archive page
-
Hello
is there a way to show product gallery in shop/archive page or even custom loop and be compatible with the variation clicks, so when clicking on variation it loads its own gallery , not just one image ,
meaning , making it work kind of like the single product page
i’ve managed to get the main gallery , but when click on variation of course it doesn’t change , here is the code
<?php // Get product image gallery $gallery = $product->get_gallery_image_ids(); // Check if there are images in the gallery if (!empty($gallery)) { echo '<div class="product-gallery-slider">'; foreach ($gallery as $image_id) { echo '<img src="' . wp_get_attachment_image_url($image_id, 'large') . '" alt="' . get_the_title() . '">'; } echo '</div>'; } ?>
Thanks in advance ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘show product gallery in shop/archive page’ is closed to new replies.