Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-catalog-1.2.js Следить за файлом 8401 if (isSoldOut) {8402 var productParent = el_product.parentNode;8403 var isList = productParent && productParent.classList.contains('t-catalog__card-list_style_list');8404 // Добавляем "нет в наличии" под ценой, когда нет кнопки покупки8405 var renderSoldOutMessage = function () {8406 var priceWrapper = el_product.querySelector('.js-catalog-price-wrapper');8407 if (priceWrapper) {8408 var soldOutMsg =8409 '<div class="js-catalog-prod-sold-out t-catalog__card__sold-out-msg t-name t-name_xs">' +8410 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)8411 История файла и сравнение версий // @ts-expect-error ST-2949_3
8412 window.tCatalogDict['soldOut'] +8415 var newPriceWrapperStr = '';8416 // ST-2522: обёртка только у карточки из нового шаблона. Старый список вставляет сообщение сразу после цены.8417 const isFromTemplate = el_product.classList.contains('t-catalog__card_from-template');8418 if (!isList || !isFromTemplate) {8419 priceWrapper.insertAdjacentHTML('afterend', soldOutMsg);8421 newPriceWrapperStr =8422 '<div class="t-catalog__card__sold-out-wrapper">' +8423 priceWrapper.outerHTML +8428 // Показываем priceWrapper, если он был скрыт8429 var computedStyle = window.getComputedStyle(priceWrapper);8430 if (computedStyle.visibility === 'hidden') {8431 priceWrapper.style.visibility = 'visible';8434 // ST-2522: редизайн карточек товаров8435 if (isList && isFromTemplate) {8436 priceWrapper.outerHTML = newPriceWrapperStr;8441 // Иконка #order остаётся в DOM без текстового узла8442 if (!el_buyBtn.length || !el_buyBtnTxt) {8443 renderSoldOutMessage();8446 Array.prototype.forEach.call(el_buyBtn, function (btn) {8447 btn.classList.add('t-catalog__prod-popup__btn_disabled');8450 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)8451 // @ts-expect-error ST-2949_38452 el_buyBtnTxt.textContent = window.tCatalogDict['soldOut'];8455 t_catalog_triggerEvent(el_product, 'tStoreSoldOut', {8456 product: t_catalog__collectProductDataByElement(el_product),8457 buttonBuyElement: el_buyBtn[0],8458 renderSoldOutMessage: renderSoldOutMessage,8462 Array.prototype.forEach.call(el_buyBtn, function (btn) {8463 btn.classList.remove('t-catalog__prod-popup__btn_disabled');8466 options.buyBtnTitle ||8467 (options.popup_opts && options.popup_opts.btnTitle) ||8468 // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538)8469 // @ts-expect-error ST-2949_38470 window.tCatalogDict['addtocart'];8471 if (el_product.getAttribute('data-card-size') === 'small') {8472 if (orderBtn1 && options.prodCard.btnTitle1) {8473 btnTitle = options.prodCard.btnTitle1;8476 if (orderBtn2 && options.prodCard.btnTitle2) {8477 btnTitle = options.prodCard.btnTitle2;8481 el_buyBtnTxt.textContent = btnTitle;8484 t_catalog_triggerEvent(el_product, 'tStoreAvailable', {8485 product: t_catalog__collectProductDataByElement(el_product),8486 buttonBuyElement: el_buyBtn[0],8491 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)8492 // @ts-expect-error ST-2949_28493 function t_catalog_product_getEditionOptionsArr(product, optionsData) {8494 var editions = product.editions;8495 var defaultProps = [