Каталог файловtilda-catalog-1.2.js
4201 var priceFieldAttr =4202 product.editions.length === 1 && edition.uid4203 ? 'field="li_' + priceType + '__' + edition.uid + '" data-redactor-toolbar="no"'4204 : '';4205 4206 var currency = options.currencyTxt4207 ? '<div class="t-catalog__card__price-currency" translate="no">' + options.currencyTxt + '</div>'4208 : '';4209 var jsProdClass =4210 type === 'current' ? 'js-product-price js-catalog-prod-price-val' : 'js-catalog-prod-price-old-val';4211 if (formattedPriceRange) {
История файла и сравнение версий
jsProdClass += ' js-catalog-prod-price-range-val';
4215 var isListStyle = options.prodCard.listStyle === 'list'; 4219 ' t-catalog__card__price-item t-name t-name_' + 4220 (isListStyle ? 'md' : 'xs') + 4224 if (formattedPriceRange && priceRangeDesign === 'from') { 4226 '<div class="t-catalog__card__price-from t-catalog__card__price-value" translate="no" ' + 4229 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) 4230 // @ts-expect-error ST-2949_3 4231 window.tCatalogDict['from'] + 4234 var minPrice = t_catalog__getFormattedMinPrice(options, product); 4235 if (minPrice !== null) { 4236 formattedPrice = minPrice; 4239 str += options.currencySide !== 'r' && currency ? currency : ''; 4243 ' t-catalog__card__price-value" translate="no" ' + 4248 str += options.currencySide === 'r' && currency ? currency : ''; 4250 if (product.unit && product.portion > 0) { 4252 '<div class="t-catalog__prod__price-portion"><span class="t-catalog__prod__price-portion-slash">/</span>'; 4253 if (product.portion !== '1') { 4254 str += +product.portion + ' '; 4256 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) 4257 // @ts-expect-error ST-2949_3 4258 str += window.tCatalogDict[product.unit] + '</div>'; 4265// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 4266// @ts-expect-error ST-2949_2 4267function t_catalog_get_productCard_btn_html(product, options, isRelevantsShow, rec) { 4268 const firstTemplate = document.getElementById(`button_cardfirst_${options.recid}`); 4269 const secondTemplate = document.getElementById(`button_cardsecond_${options.recid}`); 4271 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 4272 // @ts-expect-error ST-2949_1 4273 if ((!firstTemplate || !firstTemplate.content) && (!secondTemplate || !secondTemplate.content)) { 4274 return t_catalog_get_productCard_btn_html_legacy(product, options, isRelevantsShow, rec); 4277 const isListStyle = options.prodCard.listStyle === 'list'; 4278 let firstButtonMarkup = ''; 4279 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 4280 // @ts-expect-error ST-2949_1 4281 if (firstTemplate && firstTemplate.content) { 4282 const link = t_catalog_get_productCard_link(options.prodCard.btnLink1, product, isRelevantsShow, rec); 4283 const linkTarget = t_catalog_get_productCard_targetAttr(options.prodCard.btnLink1, product); 4284 // @ts-expect-error ST-2949_1 4285 const buttonTemplate = firstTemplate.content.cloneNode(true).firstElementChild; 4286 buttonTemplate.setAttribute('href', link.replaceAll('&', '&')); 4287 if (linkTarget) buttonTemplate.setAttribute('target', '_blank'); 4288 const firstButtonHtml = t_catalog__prepareCardButton({ 4289 button: buttonTemplate, 4293 productTitle: product && product.title, 4295 if (firstButtonHtml && isListStyle) { 4296 firstButtonMarkup = ` 4297 <div class="t-catalog__card__btn-row t-catalog__card__btn-first_wrapper">