javascript (function() { "use strict"; // === РАБОТАЕМ ТОЛЬКО НА СТРАНИЦЕ /promo === if (!window.location.pathname.includes('/promo')) return; var PRODUCT_ID = '896462044932'; // === ФУНКЦИЯ ДОБАВЛЕНИЯ ТОВАРА === function addProductToCart(productData) { return new Promise(function(resolve, reject) { // 1. Пробуем API Tilda if (window.tcart__addItem) { window.tcart__addItem({ id: PRODUCT_ID, title: productData.title, price: productData.price, quantity: 1, image: productData.image }); console.log('[Кнопка] Товар добавлен через API'); return resolve(true); } // 2. Пробуем клик по ссылке #order (если есть) var orderLink = document.querySelector('a[href="#order"]'); if (orderLink) { orderLink.click(); console.log('[Кнопка] Товар добавлен через клик по #order'); return resolve(true); } // 3. Ищем любую кнопку с текстом "Купить" или "В корзину" var allBtns = document.querySelectorAll('button, a, .t-btn'); for (var i = 0; i < allBtns.length; i++) { var text = allBtns[i].innerText.toLowerCase(); if (text.indexOf('купить') !== -1 || text.indexOf('в корзину') !== -1) { allBtns[i].click(); console.log('[Кнопка] Товар добавлен через клик по кнопке'); return resolve(true); } } reject('Не удалось добавить товар'); }); } // === ПОЛУЧЕНИЕ ДАННЫХ ТОВАРА СО СТРАНИЦЫ === function getProductData() { var block = document.querySelector('.t-store__prod, .t-store__card, .t-product, [data-product-id]'); if (!block) { // Если блок не найден, попробуем собрать данные вручную var title = document.querySelector('h1') ? document.querySelector('h1').innerText.trim() : 'Товар'; var priceText = document.querySelector('[class*="price"]'); var price = 0; if (priceText) { var num = parseFloat(priceText.innerText.replace(/\s/g, '').replace(',', '.').replace(/[^\d.]/g, '')); if (!isNaN(num)) price = num; } var image = document.querySelector('img') ? document.querySelector('img').src : ''; return { title: title, price: price, image: image }; } var titleEl = block.querySelector('.t-store__prod__title, .t-store__card__title, .t-name, h1, [class*="title"]'); var title = titleEl ? titleEl.innerText.trim() : 'Товар'; var price = 0; var priceEl = block.querySelector('.t-store__prod__price-value, .t-store__card__price-value, .js-product-price, [class*="price"]'); if (priceEl) { var txt = priceEl.innerText.trim(); var num2 = parseFloat(txt.replace(/\s/g, '').replace(',', '.').replace(/[^\d.]/g, '')); if (!isNaN(num2)) price = num2; } var image = ''; var imgEl = block.querySelector('img'); if (imgEl) image = imgEl.src; return { title: title, price: price, image: image }; } // === ОСНОВНАЯ ЛОГИКА === function handleAddToCart() { var product = getProductData(); if (!product || product.price === 0) { alert('Не удалось определить товар. Проверьте, что карточка товара загружена.'); return; } addProductToCart(product) .then(function() { var btn = document.getElementById('mobileAddBtn'); if (btn) { btn.textContent = '✓ В КОРЗИНЕ'; btn.style.background = '#2a7a2a'; setTimeout(function() { btn.textContent = 'ДОБАВИТЬ В КОРЗИНУ'; btn.style.background = '#3f3f3f'; }, 1500); } }) .catch(function(err) { alert('Не удалось добавить товар. Попробуйте обновить страницу.'); console.error(err); }); } // === СОЗДАНИЕ КНОПКИ === function createButton() { if (document.getElementById('mobileAddBtn')) return; var bar = document.createElement('div'); bar.className = 'mobile-bar'; bar.style.cssText = 'position:fixed;bottom:0;left:0;width:100%;background:#f4efe6;padding:12px 0;z-index:9999;display:none;justify-content:center;transition:opacity 0.5s ease, visibility 0.5s ease;box-shadow:0 -2px 10px rgba(0,0,0,0.05)'; var btn = document.createElement('div'); btn.id = 'mobileAddBtn'; btn.className = 'mobile-add-to-cart'; btn.textContent = 'ДОБАВИТЬ В КОРЗИНУ'; btn.style.cssText = 'width:90%;max-width:420px;background:#3f3f3f;color:#fff;text-align:center;padding:16px;font-size:13px;font-family:"Open Sans",Arial,sans-serif;text-transform:uppercase;letter-spacing:1px;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:10px;border:none'; // Добавляем иконку через CSS var style = document.createElement('style'); style.textContent = ` .mobile-add-to-cart::after { content: ""; display: inline-block; width: 28px; height: 28px; background-image: url('https://static.tildacdn.com/tild6439-3163-4265-b935-336265653233/export75-white.svg'); background-size: contain; background-repeat: no-repeat; background-position: center; } @media (max-width: 768px) { .mobile-bar { display: flex !important; } } `; document.head.appendChild(style); bar.appendChild(btn); document.body.appendChild(bar); btn.addEventListener('click', function(e) { e.preventDefault(); e.stopPropagation(); if (window.innerWidth > 768) return; if (this.dataset.processing === 'true') return; this.dataset.processing = 'true'; handleAddToCart(); this.style.transform = 'scale(0.98)'; setTimeout(function() { btn.style.transform = ''; }, 150); setTimeout(function() { btn.dataset.processing = 'false'; }, 1000); }); // Показываем на мобильных if (window.innerWidth <= 768) bar.style.display = 'flex'; // Скрытие при скролле до блока #rec2051308951 var target = document.getElementById('rec2051308951'); if (target) { function updateVisibility() { if (window.innerWidth > 768) { bar.style.opacity = ''; bar.style.visibility = ''; return; } var rect = target.getBoundingClientRect(); var fadeStart = 150; var opacity = 1; if (rect.top <= fadeStart) { var progress = 1 - (rect.top / fadeStart); if (progress > 1) progress = 1; if (progress < 0) progress = 0; opacity = 1 - progress; if (rect.top <= 0) opacity = 0; } bar.style.opacity = opacity; bar.style.visibility = (opacity <= 0) ? 'hidden' : 'visible'; } window.addEventListener('scroll', updateVisibility); window.addEventListener('resize', updateVisibility); updateVisibility(); } console.log('[Кнопка] Создана. ID товара:', PRODUCT_ID); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', createButton); } else { createButton(); } })();
Натуральная кожа крупного рогатого скота Российского производства. Кожа хромого дубления в насыщенном цвете виски. Особенность кожи - акцент на винтажном эффекте: богатая и не предсказуемая фактура с красивыми «морщинками» и заломами, создают легкий шарм истории. Кожа Old Brown используется в крупных, средних и маленьких аксессуарах.
Пожалуйста, обратите внимание! Отображение цвета кожи на вашем устройстве может отличаться от фактического цвета изделия.
Black Nero - это великолепная кожа Наппа с полуматовым эффектом, произведена в Италии. Наппа - это органический и чувствительный материал, который со временем будет внешне меняться. Сквозной и пигментный окрас придают коже великолепную насыщенность и глубину черного цвета, «лицо» кожи остается целым и неизменным - это обеспечивает устойчивость кожи, а также подчеркивает некоторые естественные характеристики кожи, такие как морщины, прожилки и поры. Эти нюансы, далекие от того, чтобы считаться недостатками, демонстрируют великолепную "прозрачность" кожи, которая является отличительной чертой ее долговечности. Этот великолепный образец кожи больше не повторится (формат Limited Edition)