Result
| grid_id |
block_id |
content |
object_id |
object_type |
object_ids |
snapping_id |
wrapper |
user_class |
order |
status |
type |
properties |
company_id |
abt__yt_banners_use |
abt__yt_banner_max_position |
storefront_id |
ab__ab_hide_block |
lang_code |
name |
| 864 |
4 |
|
0 |
|
|
3160 |
|
|
0 |
A |
geo_maps_customer_location |
a:5:{s:8:"template";s:44:"addons/geo_maps/blocks/customer_location.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Местоположение покупателя |
| 2621 |
6 |
|
0 |
|
|
3175 |
|
top-logo |
0 |
A |
template |
a:6:{s:8:"template";s:32:"blocks/static_templates/logo.tpl";s:11:"enable_link";s:1:"Y";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Логотип |
| 874 |
11 |
|
0 |
|
|
1008 |
|
|
0 |
A |
breadcrumbs |
a:1:{s:8:"template";s:22:"common/breadcrumbs.tpl";} |
1 |
N |
100 |
1 |
N |
ru |
Строка навигации |
| 875 |
12 |
|
0 |
|
|
1009 |
blocks/wrappers/mainbox_general.tpl |
|
0 |
A |
main |
a:3:{s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Главное содержимое |
| 2628 |
43 |
|
0 |
|
|
3190 |
|
ut2-top-cart-content |
0 |
A |
cart_content |
a:8:{s:8:"template";s:23:"blocks/cart_content.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";s:22:"display_bottom_buttons";s:1:"Y";s:20:"display_delete_icons";s:1:"Y";s:19:"products_links_type";s:5:"thumb";} |
1 |
N |
100 |
1 |
N |
ru |
Корзина |
| 1295 |
100 |
a:1:{s:7:"content";s:663:"<!-- Bitrix24 -->
<script>(function(w,d,u){
var s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/60000|0);
var h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
})(window,document,'https://cdn.bitrix24.ru/b10200735/crm/tag/call.tracker.js');
</script>
<p><!-- Bitrix24 Чат --></p>
<script> (function(w,d,u){
var s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/60000|0);
var h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
})(window,document,'https://cdn-ru.bitrix24.ru/b10200735/crm/site_button/loader_10_lppvkn.js');
</script>";} |
0 |
|
|
1541 |
|
|
0 |
A |
html_block |
a:5:{s:8:"template";s:21:"blocks/html_block.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
A |
ru |
CodeBitrix |
| 879 |
109 |
a:1:{s:7:"content";s:834:" <ul id="customer_service_links">
<li class="ty-footer-menu__item"><a href="/login/" rel="nofollow">Войти</a></li>
<li class="ty-footer-menu__item"><a href="{"orders.search"|fn_url}" rel="nofollow">Ваши заказы</a></li>
{if $addons.wishlist && $addons.wishlist.status == 'A'}
<li class="ty-footer-menu__item"><a href="index.php?dispatch=pages.view&page_id=21" rel="nofollow">Обмен и возврат</a></li>
<li class="ty-footer-menu__item"><a href="{"wishlist.view"|fn_url}" rel="nofollow">Отложенные</a></li>
{/if}
{if $settings.General.enable_compare_products == 'Y'}
<li class="ty-footer-menu__item"><a href="{"product_features.compare"|fn_url}" rel="nofollow">Список сравнения</a></li>
{/if}
</ul>";} |
0 |
|
|
1012 |
blocks/wrappers/footer_general.tpl |
footer-no-wysiwyg |
0 |
A |
smarty_block |
a:5:{s:8:"template";s:23:"blocks/smarty_block.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Покупателям |
| 2620 |
141 |
|
0 |
|
|
3180 |
|
top-buttons-grid hidden-tablet hidden-phone |
0 |
A |
template |
a:5:{s:8:"template";s:49:"blocks/static_templates/abt__ut2__top_buttons.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
AB: Кнопки Сравнение и Избранное |
| 1295 |
240 |
a:1:{s:7:"content";s:576:"<script>
(function(w, d, s, h, id) {
w.roistatProjectId = id; w.roistatHost = h;
var p = d.location.protocol == "https:" ? "https://" : "http://";
var u = /^.*roistat_visit=[^;]+(.*)?$/.test(d.cookie) ? "/dist/module.js" : "/api/site/1.0/"+id+"/init?referrer="+encodeURIComponent(d.location.href);
var js = d.createElement(s); js.charset="UTF-8"; js.async = 1; js.src = p+h+u; var js2 = d.getElementsByTagName(s)[0]; js2.parentNode.insertBefore(js, js2);
})(window, document, 'script', 'cloud.roistat.com', '4c4ccc6374d686c4f72db1f1d537e205');
</script>";} |
0 |
|
|
1804 |
|
|
0 |
D |
html_block |
a:2:{s:8:"template";s:21:"blocks/html_block.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
ROI |
| 878 |
381 |
a:1:{s:7:"content";s:553:"<ul id="demo_store_links">
<li class="ty-footer-menu__item"><a href="{"pages.view?page_id=2"|fn_url}">О компании</a></li>
<li class="ty-footer-menu__item"><a href="/opt" target="_blank">Оптовикам и партнерам</a></li>
<li class="ty-footer-menu__item"><a href="/oplata-i-dostavka/">Оплата и доставка</a></li>
<li class="ty-footer-menu__item"><a href="{"pages.view?page_id=26"|fn_url}">Блог</a></li>
<li class="ty-footer-menu__item"><a href="{"sitemap.view"|fn_url}">Карта сайта</a></li>
</ul>";} |
0 |
|
|
3126 |
blocks/wrappers/footer_general.tpl |
footer-no-wysiwyg |
0 |
A |
safe_smarty_block |
a:5:{s:8:"template";s:28:"blocks/safe_smarty_block.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Информация |
| 880 |
382 |
a:1:{s:7:"content";s:683:"<ul>
<li>г. {$settings.Company.company_city}, {$settings.Company.company_address}</li>
<li><a href="tel:{$settings.Company.company_phone}">{$settings.Company.company_phone} (звонок бесплатный)</a></li>
<li><a href="tel:{$settings.Company.company_phone_2}">{$settings.Company.company_phone_2}</a></li>
<li>{__('weekday_abr_1')}-{__('weekday_abr_0')} 9.00 - 18.00</li>
<li><a class="ty-exception__links-a greeny" href="mailto:{$settings.Company.company_users_department}">{$settings.Company.company_users_department}</a></li>
<li><a href="{'pages.view&page_id=20'|fn_url}" class="ty-exception__links-a">{__('view_on_map')}</a></li>
</ul>";} |
0 |
|
|
3127 |
blocks/wrappers/footer_general.tpl |
footer-no-wysiwyg |
0 |
A |
safe_smarty_block |
a:5:{s:8:"template";s:28:"blocks/safe_smarty_block.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Контакты |
| 2630 |
8 |
|
0 |
|
|
3211 |
|
Content top |
1 |
A |
template |
a:5:{s:8:"template";s:34:"blocks/static_templates/search.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Поиск |
| 877 |
107 |
|
0 |
|
|
3194 |
blocks/wrappers/footer_general.tpl |
footer-no-wysiwyg |
1 |
A |
template |
a:5:{s:8:"template";s:44:"blocks/static_templates/my_account_links.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Моя учетная запись |
| 2602 |
139 |
a:1:{s:4:"menu";s:1:"1";} |
0 |
|
|
3161 |
|
top-quick-links |
1 |
A |
menu |
a:7:{s:8:"template";s:26:"blocks/menu/text_links.tpl";s:18:"show_items_in_line";s:1:"Y";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";s:27:"open_on_sticky_panel_button";s:1:"N";} |
1 |
N |
100 |
1 |
N |
ru |
Быстрые ссылки |
| 2628 |
145 |
|
0 |
|
|
3191 |
|
ut2-top-my-account |
1 |
A |
my_account |
a:5:{s:8:"template";s:21:"blocks/my_account.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Аккаунт |
| 2620 |
245 |
a:1:{s:7:"content";s:140:" <div class="ut2-pn">
<a href="tel:{$settings.Company.company_phone}">8 800 551-32-48</a>
<p>Пн. - Пт.: 10.00 - 18.00</p>
</div>";} |
0 |
|
|
3182 |
|
top-phones-grid |
1 |
A |
safe_smarty_block |
a:5:{s:8:"template";s:28:"blocks/safe_smarty_block.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Обратный Звонок |
| 875 |
364 |
a:1:{s:7:"content";s:26230:"<style>
#popup-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 99998 !important;
}
#popup {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width: 800px;
max-height: 500px;
width: 100%;
height: 100%;
background-color: #fff;
padding: 0px;
border-radius: 1px;
z-index: 99999 !important;
}
#popup.second-popup {
max-width: 476px;
max-height: 680px;
width: 100%;
height: 100%;
padding: 30px;
border: 1px solid rgba(198, 211, 192, 1);
border-radius: 20px;
background: #fff;
}
/* Контент попапа */
#popup-content {
padding: 0px;
top: 0px;
}
#popup-content #content_discussion {
display: none;
}
#popup-content p {
padding: 0px;
top: 0px;
}
.close-popup {
background: transparent;
border: none;
cursor: pointer;
position: absolute;
top: 20px;
right: 20px;
width: 44px;
height: 44px;
opacity: 0.8;
transition: all 0.3s ease;
background-image: url("/images/close.png");
background-repeat: no-repeat;
background-position: center;
background-size: contain;
}
.close-second-popup {
background: transparent;
border: none;
cursor: pointer;
position: absolute;
top: 20px;
right: 20px;
width: 44px;
height: 44px;
opacity: 0.5;
transition: all 0.3s ease;
background-image: url("/images/close2.png");
background-repeat: no-repeat;
background-position: center;
background-size: contain;
}
.close-popup:hover {
opacity: 1;
}
.close-second-popup:hover {
opacity: 1;
}
.go-button {
position: absolute;
width: 260px;
height: 80px;
background-color: white;
color: #5e7f48;
border: 1px solid #5e7f48;
border-radius: 50px;
padding: 10px;
font-size: 18px;
font-weight: 700;
text-align: center;
margin: 0 auto;
display: block;
top: 350px;
left: 250px;
transition: all 0.3s ease;
z-index: 999999 !important;
}
.go-button::before {
content: "";
position: absolute;
top: -10px;
right: -10px;
bottom: -10px;
left: -10px;
border-radius: inherit;
border: 1px solid #5e7f48;
z-index: -1;
}
.go-button:hover {
background-color: #f5f5f5;
box-shadow: 0 0 30px rgba(94, 127, 72, 0.7);
}
form {
display: block;
margin-top: 0em;
unicode-bidi: isolate;
}
.form_wrap2 {
max-width: 476px;
max-height: 560px;
width: 100%;
height: 100%;
background: #fff;
position: relative;
}
.form_wrap2 .form_title2 {
font-family: Montserrat;
font-size: 28px;
font-weight: 400;
line-height: 33.6px;
text-align: left;
color: rgba(51, 51, 51, 1);
}
.form_wrap2 p {
margin: 10px auto;
font-family: Montserrat;
font-size: 14px;
font-weight: 400;
line-height: 15px;
text-align: left;
color: rgba(51, 51, 51, 1);
}
.form_group2 {
position: relative;
width: 100%;
border: 1px solid #e8e8e8;
border-radius: 30px;
padding: 10px 40px;
margin: 18px auto;
background-color: #f5f5f5;
position: relative;
}
.form_group2 i {
color: rgba(94, 127, 72, 1);
font-size: 18px;
padding-right: 8px;
vertical-align: middle;
width: 30px;
}
.form_group2 .fa i {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.form_group2 .form_inp {
min-height: var(--height-button);
height: var(--height-button);
font-size: var(--button-font-size);
outline: none !important;
-webkit-transition: all 150ms;
-moz-transition: all 150ms;
-o-transition: all 150ms;
transition: all 150ms;
border: none;
border-radius: 0;
width: calc(100% - 40px);
background: none;
border-left: 2px solid #e8e8e8;
padding: 10px 10px 10px 20px;
}
.form_group2 .form_inp[type="text"]:hover,
.form_group2 .form_inp[type="text"]:focus,
.form_group2 .form_inp[type="phone"]:hover,
.form_group2 .form_inp[type="phone"]:focus,
.form_group2 .form_inp[type="tel"]:hover,
.form_group2 .form_inp[type="tel"]:focus,
.form_group2 .form_inp[type="email"]:hover,
.form_group2 .form_inp[type="email"]:focus {
border-color: #379424;
box-shadow: 0 0 0 2px rgba(55, 148, 36, 0.1);
}
.baner-link-b2 {
margin-top: 30px;
margin-bottom: 30px;
}
.baner-link-b2 button {
position: relative;
width: 100%;
border: 2px solid rgba(113, 155, 85, 1);
display: block;
padding: 10px 40px;
border-radius: 40px;
font-family: Inter;
font-size: 18px;
font-weight: 500;
line-height: 21.6px;
text-align: center;
background: linear-gradient(180deg, #719b55 0%, #5e7f48 100%);
background: rgba(94, 127, 72, 1);
color: rgba(255, 255, 255, 1);
z-index: 999999 !important;
}
.baner-link-b2 button::before {
content: "";
position: absolute;
top: -10px;
right: -10px;
bottom: -10px;
left: -10px;
border-radius: inherit;
border: 1px solid #5e7f48;
z-index: -1;
}
.invalid {
border-color: #dc3545;
}
.error-message {
color: #dc3545;
margin-top: 5px;
}
.form_inp {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
}
.form_inp:focus {
border-color: #007bff;
outline: 0;
}
/* Мобильная версия */
@media (max-width: 480px) {
#popup {
max-width: 300px;
max-height: 400px;
}
#popup.second-popup {
max-width: 300px;
max-height: 700px;
width: 100%;
height: 100%;
padding: 10px;
border: 1px solid rgba(198, 211, 192, 1);
border-radius: 20px;
background: #fff;
}
.close-popup {
width: 30px;
height: 30px;
top: 10px;
right: 10px;
}
.close-second-popup {
top: 10px;
right: 10px;
width: 30px;
height: 30px;
}
#popup-content {
padding: 0px;
top: 0px;
}
#popup-content #content_discussion {
display: none;
}
.go-button {
position: absolute;
width: 280px;
height: 50px;
background-color: white;
color: #5e7f48;
border: 1px solid #5e7f48;
border-radius: 50px;
padding: 10px;
font-size: 15px;
font-weight: 700;
text-align: center;
margin: 0 auto;
display: block;
top: 310px;
left: 10px;
transition: all 0.3s ease;
z-index: 999999 !important;
}
.go-button::before {
content: "";
position: absolute;
top: -5px;
right: -5px;
bottom: -5px;
left: -5px;
border-radius: inherit;
border: 1px solid #5e7f48;
z-index: -1;
}
.form_wrap2 {
max-width: 310px;
max-height: 630px;
width: 100%;
height: 100%;
background: #fff;
position: relative;
}
.form_wrap2 .form_title2 {
font-family: Montserrat;
font-size: 22px;
font-weight: 400;
line-height: 28px;
text-align: left;
color: rgba(51, 51, 51, 1);
}
.form_wrap2 p {
margin: 10px auto;
font-family: Montserrat;
font-size: 14px;
font-weight: 400;
line-height: 15px;
text-align: left;
color: rgba(51, 51, 51, 1);
}
.form_group2 {
position: relative;
width: 100%;
border: 1px solid #e8e8e8;
border-radius: 30px;
padding: 10px 40px;
margin: 18px auto;
background-color: #f5f5f5;
position: relative;
}
.error-message {
color: #dc3545;
margin-top: 5px;
font-size: 12px;
}
}
</style>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.min.js"></script>
<script>
$(document).ready(function () {
const defaultDelay = 10000; //задержка в 10 секунд
let delay = defaultDelay;
let config = {};
try {
config = window.configData || {};
if (config.delay) {
delay = config.delay;
}
} catch (error) {
// Обработка ошибок
}
// Получаем текущее время
const currentTime = new Date();
// Получаем начало текущих суток
const todayStart = new Date(currentTime.getFullYear(), currentTime.getMonth(), currentTime.getDate());
// Проверяем доступность localStorage
try {
if (!localStorage) {
throw new Error("localStorage недоступен");
}
} catch (e) {
console.error("Ошибка: localStorage недоступен", e);
}
// Проверяем, было ли окно показано сегодня
const lastShown = localStorage.getItem("popupLastShown");
if (!lastShown) {
// Если никогда не показывалось, показываем окно с задержкой
setTimeout(function () {
showFirstPopup();
localStorage.setItem("popupLastShown", todayStart.toISOString());
}, delay);
} else {
const lastShownDate = new Date(lastShown);
if (todayStart.getTime() > lastShownDate.getTime()) {
// Если новый день, показываем окно с задержкой
setTimeout(function () {
showFirstPopup();
localStorage.setItem("popupLastShown", todayStart.toISOString());
}, delay);
}
}
// Функция загрузки и показа попапа
function showFirstPopup() {
console.log("Функция showFirstPopup вызвана");
const isMobile = /iPhone|iPad|iPod|Android|BlackBerry|Windows Phone/i.test(navigator.userAgent);
let popupUrl = isMobile ? "/mobanner" : "/banner";
$("#popup-overlay").fadeIn("slow");
$.ajax({
url: popupUrl,
method: "GET",
success: function (data) {
$("#popup-content").html(data);
const goUrl = config.goUrl || "";
// Обработчик для оверлея
$("#popup-overlay").on("click", function (e) {
if ($(e.target).is("#popup-overlay")) {
closePopups();
}
});
$(".go-button").on("click", function (e) {
e.preventDefault();
//window.location.href = goUrl;
showSecondPopup();
});
},
error: function (error) {
$("#popup-content").text("Произошла ошибка при загрузке");
},
});
}
function showSecondPopup() {
//console.log("Функция showSecondPopup вызвана");
const isMobile = /iPhone|iPad|iPod|Android|BlackBerry|Windows Phone/i.test(navigator.userAgent);
let popupUrl = isMobile ? "/mobsvyaz" : "/desksvyaz";
$("#popup-overlay").fadeIn("slow");
$.ajax({
url: popupUrl,
method: "GET",
success: function (data) {
$("#popup-content").html(data);
// Получаем текущий security_hash с текущей страницы
const currentHash = $('input[name="security_hash"]').val();
// Проверяем, что хэш получен
if (!currentHash) {
console.error("Хэш не найден на текущей странице");
return;
}
//console.log("Полученный security_hash:", currentHash);
// Создаем скрытый инпут
const securityHashInput = document.createElement("input");
securityHashInput.type = "hidden";
securityHashInput.name = "security_hash";
securityHashInput.className = "cm-no-hide-input";
securityHashInput.value = currentHash;
// Добавляем инпут в форму
$("#popup-content form").append(securityHashInput);
// Проверяем, что инпут успешно добавлен
const addedHash = $('#popup-content form input[name="security_hash"]').val();
//console.log("Добавлен security_hash:", addedHash);
$("#popup").addClass("second-popup");
// Прячем кнопку первого попапа и показываем кнопку второго
$(".close-popup").hide();
$(".close-second-popup").show();
// Обработчик для полей ввода
$("#popup-content input").on("input", function () {
const input = $(this);
const value = input.val().trim();
if (value) {
input.removeClass("invalid");
input.next(".error-message").remove();
}
// Для полей телефона добавляем маску и валидацию
if (input.attr("name") === "phone") {
try {
// Применяем маску
input.mask("+0 (000) 000-00-00", {
placeholder: "",
clearIfNotMatch: true,
onComplete: function (phone) {
// Проверяем номер при заполнении
if (!validatePhone(phone)) {
input.addClass("invalid");
}
},
});
// Проверяем номер при каждом изменении
const currentPhone = input.val().replace(/\D/g, "");
if (!validatePhone(currentPhone)) {
input.addClass("invalid");
}
} catch (error) {
console.error("Ошибка при применении маски:", error);
}
}
checkFormFields();
});
// Добавляем метод setCursorPosition в прототип jQuery
$.fn.setCursorPosition = function (position) {
try {
if (this.length === 0) return this;
return $(this).each(function () {
try {
if (this.setSelectionRange && this.nodeType === 1 && !this.isRemoved && this.type !== "email") {
// Добавляем проверку типа input
if (this.setSelectionRange) {
this.setSelectionRange(position, position);
} else if (this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd("character", position);
range.moveStart("character", position);
range.select();
}
}
} catch (err) {
console.error("Ошибка при установке курсора:", err);
}
});
} catch (err) {
console.error("Ошибка в setCursorPosition:", err);
}
};
// Основной код для работы с телефоном
try {
// Обработчик для корректной работы с курсором
$("#popup-content input[type='phone']").on("click keyup", function (e) {
// Добавляем селектор по типу
try {
const caretPosition = $(this).get(0).selectionStart;
// Если курсор в начале, перемещаем после "+7 ("
if (caretPosition <= 2) {
$(this).setCursorPosition(5);
}
// Если курсор в конце маскированных символов, перемещаем дальше
if (caretPosition === 6 && e.type === "keyup") {
$(this).setCursorPosition(9);
}
if (caretPosition === 10 && e.type === "keyup") {
$(this).setCursorPosition(14);
}
} catch (err) {
console.error("Ошибка при обработке события:", err);
}
});
// Обработчик для корректной работы с удалением
$("#popup-content input[type='phone']").on("keydown", function (e) {
// Добавляем селектор по типу
try {
var key = e.which;
// Обрабатываем удаление
if (key === 8 || key === 46) {
var position = $(this).get(0).selectionStart;
// Если удаляем в начале маски, перемещаем курсор
if (position <= 5) {
$(this).setCursorPosition(Math.max(position - 1, 5));
}
}
} catch (err) {
console.error("Ошибка при удалении:", err);
}
});
// Добавляем обработчик удаления элемента
$("#popup-content input").on("remove", function () {
this.isRemoved = true;
});
} catch (err) {
console.error("Основная ошибка:", err);
}
// Обработчик для кнопки "Задать вопрос"
$(".btn").on("click", function (e) {
e.preventDefault();
if (checkFormFields()) {
history.replaceState({}, "", window.location.href.split("?")[0]);
// Отправляем метрику
ym(54102109, "reachGoal", "askq");
// Получаем форму по ID
const form = $("#contact_form-2");
if (form.length > 0) {
// Получаем данные формы
const formData = new FormData(form[0]);
// Выводим данные в консоль
// for (let pair of formData.entries()) {
// console.log(pair[0] + ': ' + pair[1]);
// }
// Отправляем данные на сервер
$.ajax({
url: "/opt/rest.php",
type: "POST",
data: formData,
contentType: false,
processData: false,
success: function (response) {
closePopups();
alert("Ваши данные успешно отправлены!");
},
error: function (xhr, status, error) {
console.error("Ошибка отправки данных:", error);
alert("Ошибка! Ваши данные не отправлены.");
},
});
} else {
console.error("Форма не найдена");
alert("Ошибка! Форма не найдена.");
}
}
});
// Обработчик для кнопок закрытия
$("#popup").on("click", ".close-popup,.close-second-popup", function (e) {
e.stopPropagation();
closePopups();
});
// Обработчик для оверлея
$("#popup-overlay").on("click", function (e) {
if ($(e.target).is("#popup-overlay")) {
closePopups();
}
});
history.pushState({}, "", "?popup=second");
$(".go-button").remove();
},
error: function (error) {
$("#popup-content").text("Произошла ошибка при загрузке");
},
});
}
function checkFormFields() {
//console.log("Проверяем все поля");
// Получаем элементы формы
const nameInput = $('#popup-content [name="name"]');
const phoneInput = $('#popup-content [name="phone"]');
const emailInput = $('#popup-content [name="email"]');
// Очищаем все возможные ошибки
clearErrors();
let isValid = true;
// Проверяем имя
if (!nameInput.val().trim()) {
showError(nameInput, "Пожалуйста, введите ваше имя, например: Юлия");
isValid = false;
}
// Проверяем телефон
if (!validatePhone(phoneInput.val())) {
showError(phoneInput, "Введите номер телефона в формате +X (XXX) XXX-XX-XX");
isValid = false;
}
// Проверяем email
if (!validateEmail(emailInput.val())) {
showError(emailInput, "Введите корректный email, например: julia@yandex.ru");
isValid = false;
}
return isValid;
}
function clearErrors() {
$(".error-message").remove();
$("#popup-content input").removeClass("invalid");
}
function showError(input, message) {
//console.log("Показываем ошибку:", message);
input.addClass("invalid");
const errorMessage = $("<div>").addClass("error-message").text(message);
input.after(errorMessage);
}
// Обновленная функция валидации
function validatePhone(phone) {
const cleanedPhone = phone.replace(/\D/g, "");
return cleanedPhone.length >= 3 && cleanedPhone.length <= 18;
}
function validateEmail(email) {
const emailPattern = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
return emailPattern.test(email);
}
// Функция закрытия попапов
function closePopups() {
$("#popup-overlay").fadeOut("slow");
$("#popup").hide();
$("#popup").removeClass("popup");
$(".close-popup").show();
$(".close-second-popup").hide();
$("#popup").removeClass("second-popup");
// Удаляем параметр popup из URL
history.replaceState({}, "", window.location.href.split("?")[0]);
}
// Изменяем обработчик закрытия
$(document).on("click", ".close-popup", function () {
$("#popup-overlay").fadeOut("slow");
});
// Добавляем отдельный обработчик для второго попапа
$(document).on("click", ".close-second-popup", function () {
$("#popup-overlay").fadeOut("slow");
});
});
</script>
<div id="popup-overlay" style="display:none;">
<div id="popup">
<div id="popup-content"></div>
<div><button class="go-button">Запросить прайс-лист</button></div>
<div><button class="close-popup" style="display:block;"></button></div>
<div><button class="close-second-popup" style="display:none;"></button></div>
</div>
</div>";} |
0 |
|
|
2785 |
|
|
1 |
A |
safe_smarty_block |
a:5:{s:8:"template";s:28:"blocks/safe_smarty_block.tpl";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";} |
1 |
N |
100 |
1 |
N |
ru |
Баннер(popup) |
| 882 |
19 |
|
0 |
|
|
1014 |
|
|
2 |
A |
template |
a:1:{s:8:"template";s:37:"blocks/static_templates/copyright.tpl";} |
1 |
N |
100 |
1 |
N |
ru |
Копирайт |
| 2603 |
140 |
a:1:{s:4:"menu";s:1:"6";} |
0 |
|
|
3183 |
|
hidden-phone hidden-tablet |
2 |
A |
menu |
a:7:{s:8:"template";s:26:"blocks/menu/text_links.tpl";s:18:"show_items_in_line";s:1:"N";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";s:27:"open_on_sticky_panel_button";s:1:"N";} |
1 |
N |
100 |
1 |
N |
ru |
Верхнее меню |
| 2629 |
186 |
a:1:{s:4:"menu";s:1:"5";} |
0 |
|
|
3188 |
blocks/wrappers/onclick_dropdown.tpl |
top-menu-grid-vetrtical |
2 |
A |
menu |
a:16:{s:8:"template";s:46:"blocks/menu/abt__ut2_dropdown_vertical_mwi.tpl";s:21:"abt__ut2_filling_type";s:14:"column_filling";s:22:"abt__ut2_columns_count";s:1:"4";s:22:"abt__menu_compact_view";s:1:"N";s:19:"abt_menu_icon_items";s:1:"Y";s:36:"no_hidden_elements_second_level_view";s:1:"4";s:36:"elements_per_column_third_level_view";s:2:"10";s:30:"dropdown_second_level_elements";s:2:"12";s:29:"dropdown_third_level_elements";s:1:"5";s:31:"abt__ut2_view_more_btn_behavior";s:10:"view_items";s:24:"abt__ut2_menu_min_height";s:3:"475";s:22:"abt__ut2_demo_block_id";s:0:"";s:23:"skeleton_height_desktop";s:0:"";s:22:"skeleton_height_tablet";s:0:"";s:22:"skeleton_height_mobile";s:0:"";s:27:"open_on_sticky_panel_button";s:1:"N";} |
1 |
N |
100 |
1 |
N |
ru |
Каталог товаров |