WooCommerce single product edit flexslider settings (ok)

https://wpbeaches.com/add-navigation-arrows-in-woocommerce-product-gallery-slider/

MAY 22, 2019 - 3 COMMENTS

You can add Navigation Arrows in WooCommerce Product Gallery by adding a filter and then some CSS. WooCommerce uses a slider called Flexslider and it has a few more configurable options.

In functions.php add

add_filter( 'woocommerce_single_product_carousel_options', 'sf_update_woo_flexslider_options' );
/** 
 * Filer WooCommerce Flexslider options - Add Navigation Arrows
 */
function sf_update_woo_flexslider_options( $options ) {

    $options['directionNav'] = true;

    return $options;
}

Then style in some CSS

ul.flex-direction-nav {
    position: absolute;
    top: 30%;
    z-index: 99999;
    width: 100%;
    left: 0;
    margin: 0;
    padding: 0px;
    list-style: none;}

li.flex-nav-prev {float: left;}
li.flex-nav-next {float: right;}
a.flex-next {visibility:hidden;}
a.flex-prev {visibility:hidden;}

a.flex-next::after {
	visibility:visible;content: '\f054';
	font-family: 'Font Awesome 5 Free';
	margin-right: 10px;
	font-size: 20px;   
	font-weight: bold;
}
a.flex-prev::before {
    visibility:visible;
    content: '\f053';
	font-family: 'Font Awesome 5 Free';   
	margin-left: 10px;
	font-size: 20px;
	font-weight: bold;
}
ul.flex-direction-nav li a {
	color: #ccc;
}
ul.flex-direction-nav li a:hover {
	text-decoration: none;
}

The flexslider has some more options you can manipulate…

'flexslider'  => apply_filters( 'woocommerce_single_product_carousel_options', array(
    'rtl'            => is_rtl(),
    'animation'      => 'slide',
    'smoothHeight'   => true,
    'directionNav'   => false,
    'controlNav'     => 'thumbnails',
    'slideshow'      => false,
    'animationSpeed' => 500,
    'animationLoop'  => false, // Breaks photoswipe pagination if true.
    'allowOneSlide'  => false,
)),

Last updated