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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
9601		var uid = urlParams.editionuid;9602		if (uid && el_product.getAttribute('data-product-uid') !== uid) {9603			console.info('show product by uid from url = ' + uid);9604			/* find data for edition */9605			var edObj = '';9606			product.editions.forEach(function (edtn) {9607				if (edtn.uid === parseInt(uid, 10)) {9608					edObj = edtn;9609				}9610			});9611			if (!edObj) {9612
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
return;
9613 }
9614
9615 t_store_product_updateEdition(recid, el_product, edObj, product, options);
9616 var isSoldOut = parseInt(edObj.quantity) === 0;
9617 t_store_product_triggerSoldOutMsg(recid, el_product, isSoldOut, options);
9618 }
9619 } catch (error) {
9620 console.error('Error decode url:' + error);
9621 }
9622}
9623
9624function t_store_moveSearhSort(recid, opts) {
9625 // sidebar у ST320 может быть пустым, его функция должна находиться всегда в каталоге
9626 var rec = document.getElementById('rec' + recid);
9627 if (!rec) return;
9628 var searchSort = rec.querySelector('.t-store__filter__search-and-sort');
9629
9630 // If search was hidden on mobile, show it again on window resize
9631 // console.log($(searchSort).is(':hidden'));
9632 // console.log(window.getComputedStyle(searchSort).display);
9633 if (window.innerWidth > 960 && searchSort && window.getComputedStyle(searchSort).display === 'none') {
9634 searchSort.style.display = '';
9635 }
9636 // TODO: else on mobile
9637
9638 // For blocks with sidebars
9639 // If filters are in sidebar check position in DOM and replace properly
9640 // No worries, it works only once on window.width > or < 960
9641 if (!opts.sidebar) return;
9642
9643 var controlsWrapper = rec.querySelector('.t-store__filter__controls-wrapper');
9644 var contWithFiler = rec.querySelector('.js-store-cont-w-filter');
9645
9646 if (searchSort) {
9647 var isSearchOnTop = searchSort.parentNode.classList.contains('js-store-cont-w-filter');
9648
9649 if (window.innerWidth < 960) {
9650 if (isSearchOnTop) {
9651 t_store__removeElement(searchSort);
9652 controlsWrapper.insertAdjacentElement('beforeend', searchSort);
9653 }
9654 } else if (!isSearchOnTop) {
9655 t_store__removeElement(searchSort);
9656 contWithFiler.insertAdjacentElement('afterbegin', searchSort);
9657 }
9658 }
9659}
9660
9661/* for block ST330 */
9662function t_store_get_productCard_horizontalStructure(product, edition, options, link, isRelevantsShow, rec) {
9663 var str = '';
9664
9665 if (
9666 ((product.gallery[0] && product.gallery[0] !== '') || (product.gallery[0] && product.gallery[0] !== '')) &&
9667 options.prodCard &&
9668 options.prodCard.hasImg
9669 ) {
9670 str +=
9671 '<div class="t-store__card__imgwrapper_column"' +
9672 (options.imageWidth && options.imageWidth !== '0' ? ' style="width: ' + options.imageWidth + 'px;"' : '') +
9673 '>' +
9674 link.open +
9675 t_store_get_productCard_img_html(product, options) +
9676 link.close +
9677 '</div>';
9678 }
9679
9680 str +=
9681 '<div class="t-store__card__contentwrapper">' +
9682 t_store_get_horizontalProductCard_txt_html(product, options, link, edition, isRelevantsShow, rec) +
9683 t_store_get_horizontalProductCard_priceAndButtons(product, options, edition, isRelevantsShow, rec) +
9684 '</div>';
9685
9686 return str;
9687}
9688
9689function t_store_get_horizontalProductCard_txt_html(product, options, link, edition) {
9690 var titleName = product.title;
9691 if (options.isTitleClip) {
9692 titleName = product.title.length > 50 ? product.title.slice(0, 50) + '...' : product.title;
9693 }
9694
9695 var title;
9696
9697 if (product.title) {
9698 title =
9699 '<div class="t-store__card__title t-typography__title t-name t-name_md js-store-prod-name js-product-name"' +
9700 (!options.title_typo && Object.prototype.hasOwnProperty.call(options.typo, 'title')
Предыдущие 100 строкСледующие 100 строк