diff --git a/lib/zin/wg/productsbox/js/v1.js b/lib/zin/wg/productsbox/js/v1.js index 02d159f31a..a7a3051248 100644 --- a/lib/zin/wg/productsbox/js/v1.js +++ b/lib/zin/wg/productsbox/js/v1.js @@ -243,13 +243,16 @@ window.updateItems = function() productItems[allItems[i].value].i = i; } - $(".productsBox [name^='products']").each(function() + if($('.productsBox .linkProduct').length > 0) { - const $product = $(this).zui('picker'); - const productID = $(this).val(); - let currentProductItems = JSON.parse(JSON.stringify(allItems)); - if(productID != 0) currentProductItems[productItems[productID].i].disabled = false; + $(".productsBox [name^='products']").each(function() + { + const $product = $(this).zui('picker'); + const productID = $(this).val(); + let currentProductItems = JSON.parse(JSON.stringify(allItems)); + if(productID != 0) currentProductItems[productItems[productID].i].disabled = false; - $product.render({items: currentProductItems}); - }); + $product.render({items: currentProductItems}); + }); + } }