Flex slider on shop page

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?

Hi @omid020,

Thank you for reaching out to us. You can create a product gallery slider either with Revolution Slider or any other slider and then follow this thread to show the slider on Shop page: Product slider shortcode

As you see this requires custom development since this isn’t a theme feature by default. Regretfully custom development is outside the scope of our support, the code provided above serves as a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer.

Thank you for understanding!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.