Каталог файловtilda-catalog-1.1.js
7101 Array.prototype.forEach.call(document.querySelectorAll('.js-store-product'), function (product) {7102 product.setAttribute('data-product-lid', edition.uid);7103 product.setAttribute('data-product-uid', edition.uid);7104 product.setAttribute('data-product-url', window.location);7105 product.setAttribute('data-product-img', edition.img);7106 });7107 7108 setTimeout(function () {7109 t_store_product_updateEdition_moveSlider(recid, el_product, edition);7110 }, 200);7111
История файла и сравнение версий
// If edition was passed as URL param, update hidden select only
7113 Array.prototype.forEach.call(product.editionOptions, function (curOption) { 7114 var value = edition[curOption.name]; 7115 var el_select = t_store_product_getEditionSelectEl(el_product, curOption); 7117 var variant = el_select.querySelector('.js-product-edition-option-variants'); 7118 if (variant && variant.value !== value) { 7119 variant.value = (value || '').replace(/>/g, '>').replace(/</g, '<'); 7120 /* A timeout of 1 second for custom select */ 7121 setTimeout(function () { 7122 t_store_triggerEvent(variant, 'change'); 7129 var storePriceWrapper = el_product.querySelector('.js-store-price-wrapper'); 7132 var storeProdPriceVal; 7134 if (storePriceWrapper) { 7135 storeCardPrice = storePriceWrapper.querySelector('.t-store__card__price'); 7136 storeProdPrice = storePriceWrapper.querySelector('.js-store-prod-price'); 7137 storeProdPriceVal = storePriceWrapper.querySelector('.js-store-prod-price-val'); 7138 productPrice = storePriceWrapper.querySelector('.js-product-price'); 7142 if (edition.price && parseFloat(edition.price) !== 0) { 7143 var formattedPrice = t_store__getFormattedPrice(options, edition.price); 7144 var formattedPriceRange = t_store__getFormattedPriceRange(options, product); 7145 if (options.price) { 7146 var priceRangeDesign = options.price.priceRange; 7147 if (formattedPriceRange && priceRangeDesign === 'range') { 7148 formattedPrice = formattedPriceRange; 7151 if (formattedPriceRange && priceRangeDesign === 'from') { 7152 var minPrice = t_store__getFormattedMinPrice(options, product); 7153 if (minPrice !== null) { 7154 formattedPrice = minPrice; 7158 if (storeProdPriceVal) { 7159 storeProdPriceVal.textContent = formattedPrice; 7161 if (storeCardPrice) { 7162 storeCardPrice.style.display = ''; 7164 if (storeProdPrice) { 7165 storeProdPrice.style.display = ''; 7167 if (storePriceWrapper) { 7168 storePriceWrapper.style.visibility = ''; 7171 var cleanPrice = t_store__cleanPrice(edition.price); 7173 productPrice.setAttribute('data-product-price-def', cleanPrice); 7174 productPrice.setAttribute('data-product-price-def-str', cleanPrice); 7177 Array.prototype.forEach.call(el_product.querySelectorAll('.t-store__prod__price-portion'), function (portion) { 7178 t_store__removeElement(portion); 7180 if (product.unit && product.portion > 0) { 7182 '<div class="t-store__prod__price-portion"><span class="t-store__prod__price-portion-slash">/</span>'; 7183 if (product.portion !== '1') { 7184 str += +product.portion + ' '; 7186 str += window.tStoreDict[product.unit] + '</div>'; 7188 var arrayPriceClasses = [ 7190 '.t-store__card__price-currency + .js-product-price', 7191 '.t-store__card__price-currency + .js-store-prod-price-old-val', 7192 '.js-product-price + .t-store__card__price-currency', 7193 '.js-store-prod-price-old-val + .t-store__card__price-currency', 7195 '.t-store__prod-popup__price-currency + .js-product-price', 7196 '.js-product-price + .t-store__prod-popup__price-currency', 7197 '.t-store__prod-popup__price-currency + .js-store-prod-price-old-val', 7198 '.js-store-prod-price-old-val + .t-store__prod-popup__price-currency', 7200 '.js-product-price-currency + .js-product-price',