diff --git a/.section.php b/.section.php index 3fb82a9..1c42861 100644 --- a/.section.php +++ b/.section.php @@ -3,6 +3,6 @@ $sSectionName = "Главная страница"; $arDirProperties = Array( "description" => "Заполнять через \"Изменить раздел\" в панели сверху", "title" => "Заполнять через \"Изменить раздел\" в панели сверху", - "ROBOTS" => "index, follow" + "ROBOTS" => "noindex, nofollow" ); ?> \ No newline at end of file diff --git a/local/components/era/calculator/templates/.default/ajax.php b/local/components/era/calculator/templates/.default/ajax.php index 586cb27..5138fd1 100644 --- a/local/components/era/calculator/templates/.default/ajax.php +++ b/local/components/era/calculator/templates/.default/ajax.php @@ -1,44 +1,67 @@ - + [ + 'PRODUCT_ID' => $item['ID'], + 'CATALOG_GROUP_ID' => 1 + ], + 'select' => ['PRICE', 'CURRENCY'] + ])->fetch(); + ?>
- - <?=$item['NAME']?> + + <?= $item['NAME'] ?>
- -
/5
+ +
/5
- - -

+ + +

- -

Пользователей:

+ +

Пользователей:

- -

Производительность: м³/сут

+ +

Производительность: м³/сут

- -

Залповый сброс: л

+ +

Залповый сброс: л

- -

Питание:

+ +

Питание:

- -
+ + +
-
- - -
+ +
+ + + + + + +
Нажимая кнопку «Заказать звонок», вы подтверждаете свое согласие на обработку персональных данных
- \ No newline at end of file + \ No newline at end of file diff --git a/local/components/era/calculator/templates/.default/template.php b/local/components/era/calculator/templates/.default/template.php index 6eb4a0d..e844174 100644 --- a/local/components/era/calculator/templates/.default/template.php +++ b/local/components/era/calculator/templates/.default/template.php @@ -246,10 +246,18 @@
-
- - -
+
+
+ + + + + +
+ +

Отзывы:

diff --git a/local/templates/.default/components/bitrix/catalog.item/.default/template.php b/local/templates/.default/components/bitrix/catalog.item/.default/template.php index 5be9d6e..e54dc78 100644 --- a/local/templates/.default/components/bitrix/catalog.item/.default/template.php +++ b/local/templates/.default/components/bitrix/catalog.item/.default/template.php @@ -112,12 +112,12 @@ $this->setFrameMode(true); " value="ADD2BASKET"> " value="" class="id-offer"> - - + +
diff --git a/local/templates/.default/js/custom.js b/local/templates/.default/js/custom.js index bd74848..70c1488 100644 --- a/local/templates/.default/js/custom.js +++ b/local/templates/.default/js/custom.js @@ -4,7 +4,7 @@ document.addEventListener("DOMContentLoaded", (event) => { Fancybox.bind("[data-fancybox]"); - document.body.addEventListener('submit', function(e) { + document.body.addEventListener('submit', function (e) { const form = e.target; if (form.matches('.add-to-cart-form')) { e.preventDefault(); @@ -14,7 +14,7 @@ document.addEventListener("DOMContentLoaded", (event) => { } }); - cartForm?.addEventListener('submit', function(e) { + cartForm?.addEventListener('submit', function (e) { e.preventDefault(); e.stopImmediatePropagation(); @@ -25,7 +25,7 @@ document.addEventListener("DOMContentLoaded", (event) => { function cartCheckout(formElement) { - if(!formElement) return; + if (!formElement) return; const formData = new FormData(formElement); const submitButton = formElement.querySelector('button[type=submit]'); @@ -47,7 +47,8 @@ function addToCart(formElement) { submitButton.classList.add('is-loading'); } - fetch(window.location.href, { + fetch(formElement.getAttribute('action'), { // чтоб работало по action формы + // fetch(window.location.href, { method: 'POST', body: formData }) @@ -145,7 +146,7 @@ function handleConsultationForm(formElement) { submitButton.classList.remove('is-loading'); } }); -} +} // search-history.js @@ -192,7 +193,7 @@ function updateHistoryUI(history, containerId, inputId) { }); // Повторить поиск по истории container.querySelectorAll('.header__search-btn--again').forEach(btn => { - btn.addEventListener('click', function(e) { + btn.addEventListener('click', function (e) { e.preventDefault(); const val = this.getAttribute('data-value'); const input = document.getElementById(inputId); @@ -201,7 +202,7 @@ function updateHistoryUI(history, containerId, inputId) { }); // Удалить элемент истории container.querySelectorAll('.header__search-btn--remove').forEach(btn => { - btn.addEventListener('click', function(e) { + btn.addEventListener('click', function (e) { e.preventDefault(); const idx = +this.getAttribute('data-idx'); history.splice(idx, 1); @@ -223,12 +224,12 @@ function setupSearchHistory(formId, inputId, containerId, clearBtnId) { const clearBtn = document.getElementById(clearBtnId); if (form && input) { - form.addEventListener('submit', function(e) { + form.addEventListener('submit', function (e) { e.preventDefault(); const val = input.value.trim(); if (!val) return; // Не дублируем подряд одинаковые - if (!history.length || history[history.length-1] !== val) { + if (!history.length || history[history.length - 1] !== val) { history.push(val); if (history.length > 10) history = history.slice(-10); // максимум 10 setCookie(containerId, JSON.stringify(history)); @@ -239,7 +240,7 @@ function setupSearchHistory(formId, inputId, containerId, clearBtnId) { }); } if (clearBtn) { - clearBtn.addEventListener('click', function(e) { + clearBtn.addEventListener('click', function (e) { e.preventDefault(); history = []; setCookie(containerId, JSON.stringify(history)); @@ -277,7 +278,7 @@ function ajaxSearch(inputId, blockId, historyBlockId) { const input = document.getElementById(inputId); const historyBlock = document.getElementById(historyBlockId); if (!input) return; - input.addEventListener('input', function() { + input.addEventListener('input', function () { const val = input.value.trim(); clearSearchResults(blockId); if (historyBlock) { @@ -298,7 +299,7 @@ function ajaxSearch(inputId, blockId, historyBlockId) { }); }); // Скрывать результаты при потере фокуса - input.addEventListener('blur', function() { + input.addEventListener('blur', function () { setTimeout(() => clearSearchResults(blockId), 200); if (historyBlock && input.value.trim().length === 0) { historyBlock.style.display = ''; @@ -310,10 +311,10 @@ function setupSearchBlockFocus(inputId, blockId) { const input = document.getElementById(inputId); const block = document.getElementById(blockId); if (!input || !block) return; - input.addEventListener('focus', function() { + input.addEventListener('focus', function () { block.classList.add('active'); }); - input.addEventListener('blur', function() { + input.addEventListener('blur', function () { setTimeout(() => block.classList.remove('active'), 200); }); } @@ -323,7 +324,7 @@ function toggleSearchTopAndHistory(inputId, topId, historiesId) { const top = document.getElementById(topId); const histories = document.getElementById(historiesId); if (!input || !top || !histories) return; - input.addEventListener('input', function() { + input.addEventListener('input', function () { if (input.value.trim().length > 0) { top.style.display = 'none'; histories.style.display = 'none'; @@ -332,7 +333,7 @@ function toggleSearchTopAndHistory(inputId, topId, historiesId) { histories.style.display = ''; } }); - input.addEventListener('blur', function() { + input.addEventListener('blur', function () { if (input.value.trim().length === 0) { setTimeout(() => { top.style.display = ''; @@ -347,7 +348,7 @@ function addToHistory(query, containerId, inputId) { try { history = JSON.parse(getCookie(containerId) || '[]'); } catch (e) { history = []; } - if (!history.length || history[history.length-1] !== query) { + if (!history.length || history[history.length - 1] !== query) { history.push(query); if (history.length > 10) history = history.slice(-10); setCookie(containerId, JSON.stringify(history)); @@ -356,7 +357,7 @@ function addToHistory(query, containerId, inputId) { } function setupResultClickToHistory(inputId, containerId) { - document.addEventListener('click', function(e) { + document.addEventListener('click', function (e) { const target = e.target.closest('.search-result-item'); if (target) { const input = document.getElementById(inputId); @@ -370,7 +371,7 @@ function setupResultClickToHistory(inputId, containerId) { }, true); } -document.addEventListener('DOMContentLoaded', function() { +document.addEventListener('DOMContentLoaded', function () { setupSearchHistory('header-search-form', 'header-search-input', 'header-search-histories', 'header-search-clear'); setupSearchHistory('mobile-search-form', 'mobile-search-input', 'mobile-search-histories', 'mobile-search-clear'); ajaxSearch('header-search-input', 'header-search-history-block', 'header-search-histories'); @@ -381,9 +382,14 @@ document.addEventListener('DOMContentLoaded', function() { toggleSearchTopAndHistory('mobile-search-input', 'mobile-search-top', 'mobile-search-histories'); setupResultClickToHistory('header-search-input', 'header-search-histories'); setupResultClickToHistory('mobile-search-input', 'mobile-search-histories'); -}); +}); +// Открытие попапа для local/components/era/calculator/templates/.default/ajax.php +function openCartPopupForProduct(productName) { + document.querySelector('.cart-popup__wrapper').classList.remove('cart-popup__wrapper--hidden'); + document.getElementById('fast_product').value = productName; +} // From main.js diff --git a/local/templates/.default/js/main.js b/local/templates/.default/js/main.js index 9206bad..e166b65 100644 --- a/local/templates/.default/js/main.js +++ b/local/templates/.default/js/main.js @@ -140,9 +140,12 @@ parcelRegister("6aHKA", function (module, exports) { const cartBreadcrumbs = document.querySelector(".js-cart__breadcrumbs"); const cartForm = document.getElementById("cart-form"); - orderBtn.addEventListener("click", () => { - cartPopup.classList.remove("cart-popup__wrapper--hidden"); - }); + + if (orderBtn) { + orderBtn.addEventListener("click", () => { + cartPopup.classList.remove("cart-popup__wrapper--hidden"); + }); + } // Закрытие попапа крестом и кликом по фону closeBtn.addEventListener("click", e => { diff --git a/local/templates/EraSeptik/footer.php b/local/templates/EraSeptik/footer.php index 0730adf..f57b689 100644 --- a/local/templates/EraSeptik/footer.php +++ b/local/templates/EraSeptik/footer.php @@ -49,7 +49,7 @@ use Bitrix\Main\Page\Asset;