Hi Builders, need some help
I have been browsing the Bricks forums for a solution to a problem and it feels like I’m close. I want to display the WooCommerce “Product Gallery” images inside a Nestable Slider element. The code provided by clickfusion63
WooCommerce Product Gallery tag missing? - #2 by clickfusion63
has been working for the Image Gallery element, but wont work with the Nestable Slider.
I’m using the Nestable slider with one slide. That slide is using the Query loop with “Type: Posts” and “Post Type: Media”. Then the slide has one image with {echo:woo_product_images}. When the Query is on it says: Dynamic data is empty. When it’s off it displays the first image multiple times.
When used in a Image Gallery element all the images are displayed correctly.
Current code:
function woo_product_images() {
global $product;
return $product->get_gallery_attachment_ids();
}
Have also tried:
function woo_product_images() {
global $product;
$attachment_ids = $product->get_gallery_attachment_ids();
array_unshift($attachment_ids, $product->get_image_id());
return $attachment_ids;
}
Anyone know what I’m doing wrong?
Thank you for your help! And thank you clickfusion63 for pointing me in a good direction.