For my Woocommerce project, I'm looking for a solution to edit the image slider on the single product page. Woocommerce adds slider, zoom and lightbox functionality to the product gallery. This works fine for me, but I want to change the options for the slider-part.

Woocommerce uses flexslider for this; http://flexslider.woothemes.com/ , but because flexslider is already initiated by WooCommerce itself, I can't change the options afterwards. There is als no option to kill an active flexslider and reinitiate it by myself.

I thought I could fix this by removing the classname selector (.woocommerce-product-gallery__image), so the slider won't work automatically, but this kills also the functions for zoom and lightbox.

Is there any other solution to do changes on the flexslider options of the product gallery? And to be more specific; I'm trying to make a thumbnail slider like this: http://flexslider.woothemes.com/thumbnail-slider.html

  • same problem here
    – xmoex
    Apr 5 '18 at 15:03

After a little digging through the source I found there is a filter called woocommerce_single_product_carousel_options that can be used to modify the flex slider options

for example:

function my_product_carousel_options($options) {
  $options['animation'] = 'fade';
  return $options;
add_filter("woocommerce_single_product_carousel_options", "my_product_carousel_options", 10);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.