woocommerce get image galleries by product id

Solutions on MaxInterview for woocommerce get image galleries by product id by the best coders in the world

showing results for - "woocommerce get image galleries by product id"
Sasha
16 Jan 2017
1<?php
2    $product_id = '14';
3    $product = new WC_product($product_id);
4    $attachment_ids = $product->get_gallery_image_ids();
5
6    foreach( $attachment_ids as $attachment_id ) 
7        {
8          // Display the image URL
9          echo $Original_image_url = wp_get_attachment_url( $attachment_id );
10
11          // Display Image instead of URL
12          echo wp_get_attachment_image($attachment_id, 'full');
13
14        }
15?>
16