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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.2.js

Код файла
Версия от 05.12.2026, 07:01:02 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
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) {
История файла и сравнение версий
  • 05.12.2026, 07:01:02 · 56c3b845
4212
jsProdClass += ' js-catalog-prod-price-range-val';
4213 }
4214
4215 var isListStyle = options.prodCard.listStyle === 'list';
4216 str +=
4217 '<div class="' +
4218 priceStylingClass +
4219 ' t-catalog__card__price-item t-name t-name_' +
4220 (isListStyle ? 'md' : 'xs') +
4221 '" ' +
4222 styleAttr +
4223 '>';
4224 if (formattedPriceRange && priceRangeDesign === 'from') {
4225 str +=
4226 '<div class="t-catalog__card__price-from t-catalog__card__price-value" translate="no" ' +
4227 priceFieldAttr +
4228 '>' +
4229 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)
4230 // @ts-expect-error ST-2949_3
4231 window.tCatalogDict['from'] +
4232 '</div>';
4233
4234 var minPrice = t_catalog__getFormattedMinPrice(options, product);
4235 if (minPrice !== null) {
4236 formattedPrice = minPrice;
4237 }
4238 }
4239 str += options.currencySide !== 'r' && currency ? currency : '';
4240 str +=
4241 '<div class="' +
4242 jsProdClass +
4243 ' t-catalog__card__price-value" translate="no" ' +
4244 priceFieldAttr +
4245 '>' +
4246 formattedPrice +
4247 '</div>';
4248 str += options.currencySide === 'r' && currency ? currency : '';
4249
4250 if (product.unit && product.portion > 0) {
4251 str +=
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 + ' ';
4255 }
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>';
4259 }
4260
4261 str += '</div>';
4262 return str;
4263}
4264
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}`);
4270
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);
4275 }
4276
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('&amp;', '&'));
4287 if (linkTarget) buttonTemplate.setAttribute('target', '_blank');
4288 const firstButtonHtml = t_catalog__prepareCardButton({
4289 button: buttonTemplate,
4290 options,
4291 which: 'first',
4292 isRelevantsShow,
4293 productTitle: product && product.title,
4294 });
4295 if (firstButtonHtml && isListStyle) {
4296 firstButtonMarkup = `
4297 <div class="t-catalog__card__btn-row t-catalog__card__btn-first_wrapper">
4298 ${firstButtonHtml}
4299 </div>
4300 `;
Предыдущие 100 строкСледующие 100 строк