Created
March 20, 2017 10:48
-
-
Save DavidCramer/1a110a67ec5adeb18301f9fe92ee9a7f to your computer and use it in GitHub Desktop.
initilize the quickview for woocommerce-lightbox on facetwp-loaded event.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add the below code to your child themes functions.php file. | |
add_filter( 'facetwp_assets', function( $assets ) { | |
?> | |
<script> | |
(function($) { | |
$(document).on('facetwp-loaded', function() { | |
$('.product').magnificPopup({ | |
type:'inline', | |
midClick: true, | |
gallery:{ | |
enabled:true | |
}, | |
delegate: 'a.wpb_wl_preview', | |
removalDelay: 500, //delay removal by X to allow out-animation | |
callbacks: { | |
beforeOpen: function() { | |
this.st.mainClass = this.st.el.attr('data-effect'); | |
} | |
}, | |
closeOnContentClick: false, | |
}); | |
}); | |
})(jQuery); | |
</script> | |
<?php | |
return $assets; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this snippet just saved me! thanks so much man!