4101const skuFieldAttr =4102product.editions.length === 1 && fieldId4103? 'field="st_sku__' + fieldId + '" data-redactor-toolbar="no"'4104: '';4105str += '<div class="t-catalog__card__sku t-descr t-descr_xxs" ' + skuStyle + '>';4106// TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)4107// @ts-expect-error ST-2949_34108str += window.tCatalogDict['sku'] + ': ';4109str += '<span class="js-catalog-prod-sku js-product-sku" translate="no" ' + skuFieldAttr + '>';4110str += edition.sku;4111str += '</span>';
str += '</div>'; } if (product.descr && options.prodCard?.hasDescr) { const fieldId = edition.uid; const descrFieldAttr = product.editions.length === 1 && fieldId ? 'field="st_descr__' + fieldId + '" data-redactor-toolbar="yes"' : ''; str += '<div class="js-catalog-prod-descr t-catalog__card__descr t-typography__descr t-descr t-descr_xxs ' + alignClass + '" ' + (Object.prototype.hasOwnProperty.call(options.typo, 'descr') ? 'style="' + options.typo.descr + '"' : '') + descrFieldAttr + '>'; str += product.descr; str += '</div>'; } if (!options.price.position) { str += t_catalog_get_productCard_Price_html(product, edition, options); } return str;}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_get_productCard_Price_html(product, edition, options) { var str = ''; var modifier = ''; var formattedPriceRange = t_catalog__getFormattedPriceRange(options, product); if (Object.prototype.hasOwnProperty.call(options.price, 'position')) { if (options.price.position === 'at') { modifier = ' t-catalog__card__price-wrapper_above-title'; } else if (options.price.position === 'bt') { modifier = ' t-catalog__card__price-wrapper_below-title'; } } var hasPrice = edition.price && !!+edition.price.replace(/\s/g, ''); str += '<div class="js-catalog-price-wrapper t-catalog__card__price-wrapper' + modifier + '"'; if (!hasPrice) { str += ' style="visibility: hidden;"'; } str += ' >'; str += t_catalog_get_productCard_onePrice_html(product, edition, options, 'current'); // Don't draw old price whenever price range is shown if (!formattedPriceRange) { str += t_catalog_get_productCard_onePrice_html(product, edition, options, 'old'); } str += '</div>'; return str;}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_get_productCard_onePrice_html(product, edition, options, type) { var value = type === 'current' ? edition.price : edition.priceold; var formattedPrice = t_catalog__getFormattedPrice(options, value); var priceRangeDesign = options.price.priceRange; var formattedPriceRange = t_catalog__getFormattedPriceRange(options, product); if (formattedPriceRange && priceRangeDesign === 'range') { formattedPrice = formattedPriceRange; } var priceType = type === 'current' ? 'price' : 'priceold'; var str = ''; var priceStylingClass = type === 'current' ? 't-catalog__card__price' : 't-catalog__card__price_old'; var styleAttr; var styleStr = ''; styleStr += !value || !+value.replace(/\s/g, '') ? 'display: none;' : ''; // стили для типографики вынесены в отдельный тег <style> в tpl_catalog_setup.tpl // проверка наличия свойств в options необходима для пользователей, которые не успели переопубликовать страницы, // а значит обновления в tpl еще не применились var shouldUseInlineStyleForPrice = Object.prototype.hasOwnProperty.call(options.price, 'fontWeight') && Object.prototype.hasOwnProperty.call(options.price, 'fontSize'); if (shouldUseInlineStyleForPrice) { var color = type === 'current' ? options.price.color : options.price.colorOld; styleStr += color ? 'color:' + color + ';' : ''; styleStr += options.price.fontSize ? 'font-size:' + options.price.fontSize + ';' : ''; styleStr += options.price.fontWeight ? 'font-weight:' + options.price.fontWeight + ';' : ''; } styleAttr = styleStr !== '' ? 'style = "' + styleStr + '"' : '';