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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
501		if (!window.tStoreIsSearchBot && window.Tilda && typeof Tilda.sendEcommerceEvent === 'function') {502			if (!urlSearch.editionuid) {503				Tilda.sendEcommerceEvent('detail', [504					{505						id: '' + (product.id ? product.id : product.uid),506						uid: '' + product.uid,507						price: '' + (product.price_min ? product.price_min : product.price),508						sku: product.sku ? product.sku : '',509						name: product.title,510					},511				]);512
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
} else {
513 product.editions.forEach(function (cur) {
514 if (cur.uid === urlSearch.editionuid) {
515 Tilda.sendEcommerceEvent('detail', [
516 {
517 id: '' + cur.uid,
518 uid: '' + cur.uid,
519 price: '' + cur.price,
520 sku: cur.sku ? cur.sku : '',
521 name: product.title,
522 },
523 ]);
524 }
525 });
526 }
527 }
528 }, 3000);
529}
530
531/**
532 * This function is called when the user clicks on a product in the product list.
533 * It stores the product data in the browser's history.
534 * When the user clicks on the back button, the product data is retrieved from the browser's history.
535 * This data is then used to open the product popup
536 **/
537function t_store_initRouting() {
538 window.onpopstate = function () {
539 if (window.history.state && window.history.state.productData) {
540 var productPopupData = window.history.state.productData;
541 var recid = productPopupData.recid,
542 options = productPopupData.opts,
543 productObj = productPopupData.productObj,
544 isRelevantsShow = productPopupData.isRelevantsShow;
545 t_store_openProductPopup(recid, options, productObj, isRelevantsShow);
546 }
547 };
548}
549
550/**
551 * Получает главную кнопку сниппета
552 * @param {string} recid
553 * @returns {HTMLButtonElement | null}
554 */
555function t_store_getSnippetMainButton(recid) {
556 const rec = document.getElementById('rec' + recid);
557
558 if (!rec) {
559 return null;
560 }
561
562 return rec.querySelector('.t-store__prod-popup__btn-wrapper .t-store__prod-popup__btn');
563}
564
565/**
566 * Создает массив базовых CSS-правил для кнопки
567 * @param {Record<string, string>} cssPropertiesMap
568 * @param {Record<string, string>} styles
569 * @returns {string[]}
570 */
571function t_store_buildBaseButtonCssRules(cssPropertiesMap, styles) {
572 const baseRules = [];
573 // Основные одиночные поля по маппингу
574 Object.keys(cssPropertiesMap).forEach(function (key) {
575 const cssProp = cssPropertiesMap[key];
576 const value = styles[key];
577 if (value) {
578 if (key === 'bgcolor') {
579 if (t_store_isGradient(value)) {
580 t_store_addRule(baseRules, 'background-image', value);
581 t_store_addRule(baseRules, 'background-color', 'transparent');
582 } else {
583 t_store_addRule(baseRules, 'background-color', value);
584 t_store_addRule(baseRules, 'background-image', 'none');
585 }
586 } else {
587 t_store_addRule(baseRules, cssProp, value);
588 }
589 }
590 });
591
592 const size = styles.bordersize || '0';
593 const color = styles.bordercolor || 'transparent';
594 if (styles.bordersize || styles.bordercolor) {
595 if (/^0($|[^0-9])/i.test(size) || size === '0px') {
596 t_store_addRule(baseRules, 'border', 'none');
597 } else {
598 t_store_addRule(baseRules, 'border', size + ' solid ' + color);
599 }
600 }
Предыдущие 100 строкСледующие 100 строк