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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
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
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
str += t_store_get_productCard_onePrice_html(product, edition, options, 'old');
3213 }
3214 str += '</div>';
3215 return str;
3216}
3217
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;
3225 }
3226
3227 var priceType = type === 'current' ? 'price' : 'priceold';
3228 var str = '';
3229
3230 var priceStylingClass = type === 'current' ? 't-store__card__price' : 't-store__card__price_old';
3231
3232 var styleAttr;
3233 var styleStr = '';
3234 styleStr += !value || !+value.replace(/\s/g, '') ? 'display: none;' : '';
3235
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');
3242
3243 if (shouldUseInlineStyleForPrice) {
3244 var color = type === 'current' ? options.price.color : options.price.colorOld;
3245
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 + ';' : '';
3249 }
3250
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"'
3255 : '';
3256
3257 var currency = options.currencyTxt
3258 ? '<div class="t-store__card__price-currency" translate="no">' + options.currencyTxt + '</div>'
3259 : '';
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';
3263 }
3264
3265 var isT1025 = options.prodCard.blockId === '1025';
3266 str +=
3267 '<div class="' +
3268 priceStylingClass +
3269 ' t-store__card__price-item t-name t-name_' +
3270 (isT1025 ? 'md' : 'xs') +
3271 '" ' +
3272 styleAttr +
3273 '>';
3274 if (formattedPriceRange && priceRangeDesign === 'from') {
3275 str +=
3276 '<div class="t-store__card__price-from t-store__card__price-value" translate="no" ' +
3277 priceFieldAttr +
3278 '>' +
3279 window.tStoreDict['from'] +
3280 '</div>';
3281
3282 var minPrice = t_store__getFormattedMinPrice(options, product);
3283 if (minPrice !== null) {
3284 formattedPrice = minPrice;
3285 }
3286 }
3287 str += options.currencySide !== 'r' && currency ? currency : '';
3288 str +=
3289 '<div class="' +
3290 jsProdClass +
3291 ' t-store__card__price-value" translate="no" ' +
3292 priceFieldAttr +
3293 '>' +
3294 formattedPrice +
3295 '</div>';
3296 str += options.currencySide === 'r' && currency ? currency : '';
3297
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') {
Предыдущие 100 строкСледующие 100 строк