501if (!window.tStoreIsSearchBot && window.Tilda && typeof Tilda.sendEcommerceEvent === 'function') {502if (!urlSearch.editionuid) {503Tilda.sendEcommerceEvent('detail', [504{505id: '' + (product.id ? product.id : product.uid),506uid: '' + product.uid,507price: '' + (product.price_min ? product.price_min : product.price),508sku: product.sku ? product.sku : '',509name: product.title,510},511]);512
} else { product.editions.forEach(function (cur) { if (cur.uid === urlSearch.editionuid) { Tilda.sendEcommerceEvent('detail', [ { id: '' + cur.uid, uid: '' + cur.uid, price: '' + cur.price, sku: cur.sku ? cur.sku : '', name: product.title, }, ]); } }); } } }, 3000);}/** * This function is called when the user clicks on a product in the product list. * It stores the product data in the browser's history. * When the user clicks on the back button, the product data is retrieved from the browser's history. * This data is then used to open the product popup **/function t_store_initRouting() { window.onpopstate = function () { if (window.history.state && window.history.state.productData) { var productPopupData = window.history.state.productData; var recid = productPopupData.recid, options = productPopupData.opts, productObj = productPopupData.productObj, isRelevantsShow = productPopupData.isRelevantsShow; t_store_openProductPopup(recid, options, productObj, isRelevantsShow); } };}/** * Получает главную кнопку сниппета * @param {string} recid * @returns {HTMLButtonElement | null} */function t_store_getSnippetMainButton(recid) { const rec = document.getElementById('rec' + recid); if (!rec) { return null; } return rec.querySelector('.t-store__prod-popup__btn-wrapper .t-store__prod-popup__btn');}/** * Создает массив базовых CSS-правил для кнопки * @param {Record<string, string>} cssPropertiesMap * @param {Record<string, string>} styles * @returns {string[]} */function t_store_buildBaseButtonCssRules(cssPropertiesMap, styles) { const baseRules = []; // Основные одиночные поля по маппингу Object.keys(cssPropertiesMap).forEach(function (key) { const cssProp = cssPropertiesMap[key]; const value = styles[key]; if (value) { if (key === 'bgcolor') { if (t_store_isGradient(value)) { t_store_addRule(baseRules, 'background-image', value); t_store_addRule(baseRules, 'background-color', 'transparent'); } else { t_store_addRule(baseRules, 'background-color', value); t_store_addRule(baseRules, 'background-image', 'none'); } } else { t_store_addRule(baseRules, cssProp, value); } } }); const size = styles.bordersize || '0'; const color = styles.bordercolor || 'transparent'; if (styles.bordersize || styles.bordercolor) { if (/^0($|[^0-9])/i.test(size) || size === '0px') { t_store_addRule(baseRules, 'border', 'none'); } else { t_store_addRule(baseRules, 'border', size + ' solid ' + color); } }