Ajax product filter does not work with Minding theme, if it's on the "shop masonry"

If you're using the theme Mindig and Ajax product filter, you have the shop set as masonry and the filter does not work you need to put this code in the functions.php of the theme:

if( function_exists( 'YITH_WCAN' ) && function_exists( 'wc_enqueue_js' ) ){
add_action( 'wp_enqueue_scripts', 'yith_wcan_mindig_masonry_fix', 20 );
if( ! function_exists( 'yith_wcan_mindig_masonry_fix' ) ){
function yith_wcan_mindig_masonry_fix(){
$js = "jQuery(document).on( 'yith-wcan-ajax-filtered', function(){

jQuery( 'ul.products.masonry' ).fadeIn(500,function(){
jQuery(this).css({'display':'block','visibility':'visible'});

});
} );";
// wp_add_inline_style( 'yith-wcan-script', $js );
wc_enqueue_js( $js );
}
}
}
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk