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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
8301	return wrapper.querySelector('.js-product-edition-option[data-edition-option-id="' + curOption.id + '"]');8302}8303 8304function t_store_combineOptionIdByName(text) {8305	return text.replace(/[\\'"<>{}]/g, '');8306}8307 8308function t_store_getProductFirstImg(product) {8309	if (product.gallery && product.gallery[0] === '[') {8310		var galleryArr = JSON.parse(product.gallery);8311		if (galleryArr[0] && galleryArr[0].img) {8312
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
return galleryArr[0].img;
8313 }
8314 }
8315 return '';
8316}
8317
8318function t_store__getFormattedPrice(options, price) {
8319 if (typeof price === 'undefined' || price === null || price === '') {
8320 return '';
8321 }
8322 var clearedPrice = t_store__cleanPrice(price);
8323 clearedPrice = clearedPrice.toString();
8324
8325 var showDecPart = false;
8326 var hasDefinedSeparator = false;
8327
8328 if (options.currencyDecimal) {
8329 showDecPart = options.currencyDecimal === '00';
8330 } else if (typeof window.tcart !== 'undefined' && typeof window.tcart.currency_dec !== 'undefined') {
8331 showDecPart = window.tcart.currency_dec === '00';
8332 }
8333
8334 if (options.currencySeparator) {
8335 hasDefinedSeparator = options.currencySeparator === '.';
8336 } else if (typeof window.tcart !== 'undefined' && typeof window.tcart.currency_sep !== 'undefined') {
8337 hasDefinedSeparator = window.tcart.currency_sep === '.';
8338 }
8339
8340 // always show decimial part, if it was defined in settings
8341 if (showDecPart) {
8342 if (clearedPrice.indexOf('.') === -1 && clearedPrice.indexOf(',') === -1) {
8343 clearedPrice = clearedPrice + '.00';
8344 } else {
8345 var foo = clearedPrice.substring(clearedPrice.indexOf('.') + 1);
8346 if (foo.length === 1) {
8347 clearedPrice = clearedPrice + '0';
8348 }
8349 }
8350 }
8351
8352 // show correct decimial separator
8353 if (hasDefinedSeparator) {
8354 clearedPrice = clearedPrice.replace(',', '.');
8355 } else {
8356 clearedPrice = clearedPrice.replace('.', ',');
8357 }
8358
8359 // divide thousands with spaces
8360 clearedPrice = clearedPrice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
8361
8362 return clearedPrice;
8363}
8364
8365function t_store__getFormattedMinPrice(options, product) {
8366 var minPrice = product.minPrice;
8367
8368 if (minPrice !== null && minPrice !== undefined) {
8369 minPrice = t_store__getFormattedPrice(options, minPrice);
8370 }
8371
8372 return minPrice;
8373}
8374
8375function t_store__getFormattedPriceRange(options, product) {
8376 // Important: return null if user selected to draw product variants UI in product card
8377 if (
8378 !Object.prototype.hasOwnProperty.call(options, 'prodCard') ||
8379 options.prodCard.showOpts ||
8380 !options.price.priceRange ||
8381 options.price.priceRange === '' ||
8382 !Object.prototype.hasOwnProperty.call(product, 'minPrice') ||
8383 !Object.prototype.hasOwnProperty.call(product, 'maxPrice')
8384 ) {
8385 return null;
8386 }
8387
8388 var minPrice = product.minPrice;
8389 var maxPrice = product.maxPrice;
8390
8391 if (minPrice !== null && maxPrice !== null && minPrice !== maxPrice) {
8392 minPrice = t_store__getFormattedPrice(options, minPrice);
8393 maxPrice = t_store__getFormattedPrice(options, maxPrice);
8394 var priceRangeDesign = options.price.priceRange;
8395
8396 if (priceRangeDesign === 'range') {
8397 return minPrice + '—' + maxPrice; // &mdash;
8398 } else if (priceRangeDesign === 'from') {
8399 return window.tStoreDict['from'] + ' ' + minPrice;
8400 }
Предыдущие 100 строкСледующие 100 строк