Hi,
I need to have product gallery slider on shop page; I added this code to functions.php :
//* Add gallery thumbnails to woocommerce shop page
add_action('woocommerce_shop_loop_item_title','wps_add_extra_product_thumbs', 5);
function wps_add_extra_product_thumbs() {
global $product;
$attachment_ids = $product->get_gallery_attachment_ids();
echo '<div class="product-thumbs">';
echo '<a href="' . get_the_permalink() . '">';
foreach( array_slice( $attachment_ids, 0,3 ) as $attachment_id ) {
$thumbnail_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail' )[0];
echo '<img class="thumb" src="' . $thumbnail_url . '">';
}
echo '</a>';
echo '</div>';
}
And then added this code to JS area in Theme Options to call woocommerce flexslider :
jQuery(window).load(function() {
jQuery('.product-thumbs').flexslider({
animation: "slide"
});
});
But the slider doesn’t work in action and I can’t find any related error in browser console; Is it a jQuery conflict?