Skip to content

Instantly share code, notes, and snippets.

@pyotr
pyotr / gist:8770cc15e8760a5d6ea22be32abd1255
Last active October 24, 2016 01:59
WooCommerce Additional Variation Images: Neighborhood Theme Integration JS (Neighborhood ver: 3.4.30 and WAVI ver:1.7.3)
jQuery(document).on('wc_additional_variation_images_frontend_image_swap_callback wc_additional_variation_images_frontend_on_reset wc_additional_variation_images_frontend_ajax_default_image_swap_callback', 'body', function( e, response, gallery_images_class, main_images_class, o_gallery_images, o_main_images ) {
// remove items
jQuery( '#product-img-slider' ).remove();
// add items back
jQuery( '.product .images' ).html( '<div id="product-img-slider" class="flexslider"><ul class="slides"></ul></div>' );
// jQuery plugin based on .load() for use with innerShiv
// http://jdbartlett.github.com/innershiv for more info
// $('selector').loadShiv('example.html');
jQuery.fn.loadShiv = function (url, params, callback) {
var off, selector, self, type;
if (!this.length || typeof url !== 'string') {
return this;
}