Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
4101		const skuFieldAttr =4102			product.editions.length === 1 && fieldId4103				? 'field="st_sku__' + fieldId + '" data-redactor-toolbar="no"'4104				: '';4105		str += '<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_34108		str += window.tCatalogDict['sku'] + ': ';4109		str += '<span class="js-catalog-prod-sku js-product-sku" translate="no" ' + skuFieldAttr + '>';4110		str += edition.sku;4111		str += '</span>';
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
4112 str += '</div>';
4113 }
4114 if (product.descr && options.prodCard?.hasDescr) {
4115 const fieldId = edition.uid;
4116 const descrFieldAttr =
4117 product.editions.length === 1 && fieldId
4118 ? 'field="st_descr__' + fieldId + '" data-redactor-toolbar="yes"'
4119 : '';
4120 str +=
4121 '<div class="js-catalog-prod-descr t-catalog__card__descr t-typography__descr t-descr t-descr_xxs ' +
4122 alignClass +
4123 '" ' +
4124 (Object.prototype.hasOwnProperty.call(options.typo, 'descr') ? 'style="' + options.typo.descr + '"' : '') +
4125 descrFieldAttr +
4126 '>';
4127 str += product.descr;
4128 str += '</div>';
4129 }
4130 if (!options.price.position) {
4131 str += t_catalog_get_productCard_Price_html(product, edition, options);
4132 }
4133 return str;
4134}
4135
4136// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
4137// @ts-expect-error ST-2949_2
4138function t_catalog_get_productCard_Price_html(product, edition, options) {
4139 var str = '';
4140 var modifier = '';
4141 var formattedPriceRange = t_catalog__getFormattedPriceRange(options, product);
4142
4143 if (Object.prototype.hasOwnProperty.call(options.price, 'position')) {
4144 if (options.price.position === 'at') {
4145 modifier = ' t-catalog__card__price-wrapper_above-title';
4146 } else if (options.price.position === 'bt') {
4147 modifier = ' t-catalog__card__price-wrapper_below-title';
4148 }
4149 }
4150 var hasPrice = edition.price && !!+edition.price.replace(/\s/g, '');
4151 str += '<div class="js-catalog-price-wrapper t-catalog__card__price-wrapper' + modifier + '"';
4152 if (!hasPrice) {
4153 str += ' style="visibility: hidden;"';
4154 }
4155 str += ' >';
4156 str += t_catalog_get_productCard_onePrice_html(product, edition, options, 'current');
4157 // Don't draw old price whenever price range is shown
4158 if (!formattedPriceRange) {
4159 str += t_catalog_get_productCard_onePrice_html(product, edition, options, 'old');
4160 }
4161 str += '</div>';
4162 return str;
4163}
4164
4165// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
4166// @ts-expect-error ST-2949_2
4167function t_catalog_get_productCard_onePrice_html(product, edition, options, type) {
4168 var value = type === 'current' ? edition.price : edition.priceold;
4169 var formattedPrice = t_catalog__getFormattedPrice(options, value);
4170 var priceRangeDesign = options.price.priceRange;
4171 var formattedPriceRange = t_catalog__getFormattedPriceRange(options, product);
4172 if (formattedPriceRange && priceRangeDesign === 'range') {
4173 formattedPrice = formattedPriceRange;
4174 }
4175
4176 var priceType = type === 'current' ? 'price' : 'priceold';
4177 var str = '';
4178
4179 var priceStylingClass = type === 'current' ? 't-catalog__card__price' : 't-catalog__card__price_old';
4180
4181 var styleAttr;
4182 var styleStr = '';
4183 styleStr += !value || !+value.replace(/\s/g, '') ? 'display: none;' : '';
4184
4185 // стили для типографики вынесены в отдельный тег <style> в tpl_catalog_setup.tpl
4186 // проверка наличия свойств в options необходима для пользователей, которые не успели переопубликовать страницы,
4187 // а значит обновления в tpl еще не применились
4188 var shouldUseInlineStyleForPrice =
4189 Object.prototype.hasOwnProperty.call(options.price, 'fontWeight') &&
4190 Object.prototype.hasOwnProperty.call(options.price, 'fontSize');
4191
4192 if (shouldUseInlineStyleForPrice) {
4193 var color = type === 'current' ? options.price.color : options.price.colorOld;
4194
4195 styleStr += color ? 'color:' + color + ';' : '';
4196 styleStr += options.price.fontSize ? 'font-size:' + options.price.fontSize + ';' : '';
4197 styleStr += options.price.fontWeight ? 'font-weight:' + options.price.fontWeight + ';' : '';
4198 }
4199
4200 styleAttr = styleStr !== '' ? 'style = "' + styleStr + '"' : '';
Предыдущие 100 строкСледующие 100 строк