PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.8.5
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.8.5
4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / modules / swatches / assets / js / frontend.js
shopengine / modules / swatches / assets / js Last commit date
admin.js 4 years ago frontend.js 3 years ago
frontend.js
1 lines
1 !function(e){"use strict";e.fn.shopengine__extend_var_swatch_form=function(){return this.each((function(){var t=e(this);t.addClass("swatches-support").on("click",".swatch",(function(s){s.preventDefault();var a=e(this),i=a.closest(".value").find("select"),n=a.attr("data-value");if(!a.hasClass("disabled")){if(i.trigger("focusin"),!i.find('option[value="'+n+'"]').length)return a.siblings(".swatch").removeClass("selected"),i.val("").change(),void t.trigger("shopengine__no_matching_variation",[a]);a.hasClass("selected")?(i.val(""),a.removeClass("selected")):(a.addClass("selected").siblings(".selected").removeClass("selected"),i.val(n)),i.change()}})).on("click",".reset_variations",(function(){t.find(".swatch.selected").removeClass("selected"),t.find(".swatch.disabled").removeClass("disabled")})).on("woocommerce_update_variation_values",(function(){setTimeout((function(){t.find("tbody tr").each((function(){var t=e(this),s=t.find("select").find("option"),a=s.filter(":selected"),i=[];s.each((function(e,t){""!==t.value&&i.push(t.value)})),t.find(".swatch").each((function(){var t=e(this),s=t.attr("data-value");i.indexOf(s)>-1?t.removeClass("disabled"):(t.addClass("disabled"),a.length&&s===a.val()&&t.removeClass("selected"))}))}))}),100)})).on("shopengine__no_matching_variation",(function(){window.alert(wc_add_to_cart_variation_params.i18n_no_matching_variations_text)}))}))},e((function(){setTimeout((()=>{e(".variations_form").shopengine__extend_var_swatch_form()}),500)})),e(document.body).on("click",".shopengine_loop_swatches_wrap .shopengine_swatches .swatch_color.swatch_color_loop",(function(){const t=e(".product-type-variable"),s=t.find(".woocommerce-loop-product__link").find(".attachment-woocommerce_thumbnail");t.find(".shopengine_loop_swatches_wrap").length&&s.length&&(e(s).siblings(".lds-spinner").remove(),e(s).siblings(".preloader-shadow").remove(),e(s).before('<div class="lds-spinner shopengine-swatch-preloader"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'),e(s).before('<div class="preloader-shadow"></div>'));const a=e(this);let i=a.parents(".shopengine_loop_swatches_wrap").attr("data-product-id"),n=[[a.parent().attr("data-attribute_name"),a.attr("data-value")]];a.addClass("selected").siblings().removeClass("selected");let o=!1;if(a.parent().siblings(".shopengine-loop-swatches").each((function(t){e(this).children(".selected").length>0?n.push([e(this).children(".selected").parent().attr("data-attribute_name"),e(this).children(".selected").attr("data-value")]):o=!0})),!o){const t=e(a).parent(".shopengine-loop-swatches").parent(".shopengine_loop_swatches_wrap").siblings(".woocommerce-loop-product__link");let s=t.find(".shopengine-swatch-preloader"),o=t.find(".attachment-woocommerce_thumbnail"),c=t.find(".preloader-shadow"),r=o.innerHeight();e(c).css("height",`${r}`),e(s).css("top",r/2-40),e(window).resize((function(){e(c).css("height",`${r}`),e(s).css("top",r/2-40)})),e.ajax({url:frontendApiSettings.ajaxurl,type:"POST",data:{action:"shopengine_swatch_image_on_loop_products",nonce:frontendApiSettings.nonce,selectedData:n,productId:i},beforeSend:function(e){s.addClass("preloader-active"),c.addClass("overlay-active")},error:function(e){console.log("Error: ",e),s.removeClass("preloader-active"),c.removeClass("overlay-active")},success:function(t){!0===t.success&&function(t,s){let a=(s=e.parseHTML(s))[0].src,i=s[0].srcset;t.parents(".shopengine_loop_swatches_wrap").parents("li.product.type-product.has-post-thumbnail").find("img.attachment-woocommerce_thumbnail.size-woocommerce_thumbnail").attr({src:a,srcset:i}),t.parents(".shopengine_loop_swatches_wrap").parent().siblings(".shopengine-archive-products__left-image").children("a img").attr({src:a,srcset:i})}(a,t.data.variation_img_html)},complete:function(){s.removeClass("preloader-active"),c.removeClass("overlay-active")}})}}))}(jQuery);