Каталог файловtilda-catalog-1.1.js
3201 }3202 }3203 var hasPrice = edition.price && !!+edition.price.replace(/\s/g, '');3204 str += '<div class="js-store-price-wrapper t-store__card__price-wrapper' + modifier + '"';3205 if (!hasPrice) {3206 str += ' style="visibility: hidden;"';3207 }3208 str += ' >';3209 str += t_store_get_productCard_onePrice_html(product, edition, options, 'current');3210 // Don't draw old price whenever price range is shown3211 if (!formattedPriceRange) {3212
История файла и сравнение версий
str += t_store_get_productCard_onePrice_html(product, edition, options, 'old');
3218function t_store_get_productCard_onePrice_html(product, edition, options, type) { 3219 var value = type === 'current' ? edition.price : edition.priceold; 3220 var formattedPrice = t_store__getFormattedPrice(options, value); 3221 var priceRangeDesign = options.price.priceRange; 3222 var formattedPriceRange = t_store__getFormattedPriceRange(options, product); 3223 if (formattedPriceRange && priceRangeDesign === 'range') { 3224 formattedPrice = formattedPriceRange; 3227 var priceType = type === 'current' ? 'price' : 'priceold'; 3230 var priceStylingClass = type === 'current' ? 't-store__card__price' : 't-store__card__price_old'; 3234 styleStr += !value || !+value.replace(/\s/g, '') ? 'display: none;' : ''; 3236 // стили для типографики вынесены в отдельный тег <style> в tpl_catalog_setup.tpl 3237 // проверка наличия свойств в options необходима для пользователей, которые не успели переопубликовать страницы, 3238 // а значит обновления в tpl еще не применились 3239 var shouldUseInlineStyleForPrice = 3240 Object.prototype.hasOwnProperty.call(options.price, 'fontWeight') && 3241 Object.prototype.hasOwnProperty.call(options.price, 'fontSize'); 3243 if (shouldUseInlineStyleForPrice) { 3244 var color = type === 'current' ? options.price.color : options.price.colorOld; 3246 styleStr += color ? 'color:' + color + ';' : ''; 3247 styleStr += options.price.fontSize ? 'font-size:' + options.price.fontSize + ';' : ''; 3248 styleStr += options.price.fontWeight ? 'font-weight:' + options.price.fontWeight + ';' : ''; 3251 styleAttr = styleStr !== '' ? 'style = "' + styleStr + '"' : ''; 3252 var priceFieldAttr = 3253 product.editions.length === 1 && edition.uid 3254 ? 'field="st_' + priceType + '__' + edition.uid + '" data-redactor-toolbar="no"' 3257 var currency = options.currencyTxt 3258 ? '<div class="t-store__card__price-currency" translate="no">' + options.currencyTxt + '</div>' 3260 var jsProdClass = type === 'current' ? 'js-product-price js-store-prod-price-val' : 'js-store-prod-price-old-val'; 3261 if (formattedPriceRange) { 3262 jsProdClass += ' js-store-prod-price-range-val'; 3265 var isT1025 = options.prodCard.blockId === '1025'; 3269 ' t-store__card__price-item t-name t-name_' + 3270 (isT1025 ? 'md' : 'xs') + 3274 if (formattedPriceRange && priceRangeDesign === 'from') { 3276 '<div class="t-store__card__price-from t-store__card__price-value" translate="no" ' + 3279 window.tStoreDict['from'] + 3282 var minPrice = t_store__getFormattedMinPrice(options, product); 3283 if (minPrice !== null) { 3284 formattedPrice = minPrice; 3287 str += options.currencySide !== 'r' && currency ? currency : ''; 3291 ' t-store__card__price-value" translate="no" ' + 3296 str += options.currencySide === 'r' && currency ? currency : ''; 3298 if (product.unit && product.portion > 0) { 3299 str += '<div class="t-store__prod__price-portion"><span class="t-store__prod__price-portion-slash">/</span>'; 3300 if (product.portion !== '1') {