
Dr. Berg, Электролиты, Electrolyte Powder Salty Raspberry Lemon, 30 шт
вариант.title значение frequencyLabel(frequency, product.subscriptioninterval) Количество n / assets/rebuy-cart.js / / 1) Закрыть вспомогательный провод (определить один раз, выше слушателя) / function wireCartDrawerClose(drawer) if (! drawer drawer.wiredClose) return; drawer.wiredClose = true; function close() drawer.removeAttribute('open'); drawer.setAttribute('aria-hidden','true'); document.body.classList.remove('overflow-hidden'); // внутри ящика: кнопки закрытия + внутренний оверлей drawer.addEventListener('click', (e) => if (e.target.closest('.js-close-drawer, data-drawer-close, data-action="close", aria-label="Close cart"')) e.preventDefault(); close(); if (e.target.closest('.draweroverlay, .cart-draweroverlay, .side-draweroverlay, data-drawer-overlay')) e.preventDefault(); close(); ); // фон страницы / глобальный оверлей function onDocDown(ev) if (! drawer.hasAttribute('open')) return; if (drawer.contains(ev.target)) return; const overlay = document.querySelector('.draweroverlay, .cart-draweroverlay, .side-draweroverlay, data-drawer-overlay'); if (overlay && overlay.contains(ev.target)) ev.preventDefault(); close(); return; close(); document.addEventListener('mousedown', onDocDown, true); document.addEventListener('touchstart', onDocDown, capture:true, passive:true ); // ESC document.addEventListener('keydown', (ev) => if (ev.key === 'Escape' && drawer.hasAttribute('open')) close(); ); / 2) Перезагрузка щелчка Rebuy открывает раздел ящика / document.addEventListener('click', function (e) const rebuyBtn = e.target.closest('.rebuy-button'); if (! rebuyBtn) return; setTimeout(() => fetch(window.Shopify.routes.root? sections=cart-drawer) .then(res => res.json()) .then(data => const drawerHTML = data'cart-drawer'; if (! drawerHTML) return; const parser = new DOMParser(); const doc = parser.parseFromString(drawerHTML, 'text/html'); // Предпочитаем заменить ВНЕШНИЙ раздел, чтобы тема повторно привязала свою собственную логику const currentOuter = document.getElementById('shopify-section-cart-drawer'); const newOuter = doc.querySelector('id="shopify-section-"'); if (currentOuter && newOuter) currentOuter.outerHTML = drawerHTML; // открыть с помощью встроенного триггера темы (чтобы закрытие фона/оверлея работало) ( document.querySelector('aria-controls="CartDrawer"') document.querySelector('data-drawer="cart"data-action="open"') document.querySelector('.js-drawer-open-cart') )? .click(); else // Резервная копия: поменять ВНУТРИ и провести закрытие обработчиков сами const currentDrawer = document.querySelector('cart-drawer'); const newDrawer = doc.querySelector('cart-drawer'); if (currentDrawer && newDrawer) currentDrawer.innerHTML = newDrawer.innerHTML; wireCartDrawerClose(currentDrawer); // убедитесь, что фон/оверлей/ESC закрыт currentDrawer.setAttribute('open',''); currentDrawer.setAttribute('aria-hidden','false'); document.body.classList.add('overflow-hidden'); ) .then(() => fetch('/cart.js', headers: 'Accept': 'application/json' )) .then(res => res.json()) .then(cart => // Обновить количество пузырей корзины const bubble = document.getElementById('cart-icon-bubble'); if (! bubble) return; let countEl = bubble.querySelector('.headercart-count-number'); if ((cart.itemcount 0) > 0) if (! countEl) const wrapper = document.createElement('div'); wrapper.className = 'headercart-count absolute bg-theme-text text-theme-bg text-center'; countEl = document.createElement('span'); countEl.className = 'headercart-count-number'; wrapper.appendChild(countEl); bubble.appendChild(wrapper); countEl.textContent = cart.itemcount; else countEl? .closest('.headercart-count')? .remove(); ) .catch(console.error); , 2000); // Дайте Rebuy время добавить товар ); .rebuy-bundleimage-item, .rebuy-bundleimage-item.bundle-single-image position: relative; .rebuy-badges position:absolute; top:0px; left:8px; display:flex; gap:6px; flex-wrap:wrap; z-index:2;display: inline-block; .rebuy-badge padding:4px 10px; font-size:14px; font-weight: 500; line-height:1.3; border-radius:5px; color:034e94; background:e7f1fb;display: inline-block; .rebuy-badge-wrap position: absolute; top: 0px; left: 4px; z-index: 2; .rebuy-badge-sale padding: 4px 10px; border-radius: 5px; color: 015021; background-color: d4f7e3; font-weight: 500; display: inline-block; max-width: 72.02px; .rebuy-badge-stack position: absolute; top: 0px; left: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; .rebuy-price-savings font-weight: 400; font-size: 15px; color: 008000; rebuy-widget-220501 .primary-title font-weight: 400; font-size: var(--h4-font-size); rebuy-widget-229213 .primary-title font-weight: 400; font-size: var(--h4-font-size); rebuy-widget-246717 .primary-title font-weight: 400; font-size: var(--h4-font-size); rebuy-widget-251949 .primary-title font-weight: 400; font-size: var(--h4-font-size); : В продаже В продаже Добавить В наличии Нет в наличии вариант.title значение Сохранить Math.round((compareAtSubtotal() - subtotal()) / compareAtSubtotal() 100) % .rebuy-bundleimage-item, .rebuy-bundleimage-item.bundle-single-image position: relative; .rebuy-badges position:absolute; top:0px; left:8px; display:flex; gap:6px; flex-wrap:wrap; z-index:2;display: inline-block; .rebuy-badge padding:4px 10px; font-size:14px; font-weight: 500; line-height:1.3; border-radius:5px; color:034e94; background:e7f1fb;display: inline-block; .rebuy-badge-wrap position: absolute; top: 0px; left: 4px; z-index: 2; .rebuy-badge-sale padding: 4px 10px; border-radius: 5px; color: 015021; background-color: d4f7e3; font-weight: 500; display: inline-block; .rebuy-badge-stack position: absolute; top: 0px; left: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 2; .rebuy-badge-stack-dynamic-bundle position: absolute; top: 0px; left: -4px; display: flex; flex-direction: column; gap: 6px; z-index: 2; .rebuy-bundleimage, .rebuy-bundle .rebuy-product-info position: relative; rebuy-widget-226202 .rebuy-bundleactions display: flex; flex-direction: column; align-items: center; order: 3; margin-top: 20px; rebuy-widget-226202 max-width: 1140px; margin: 0px auto 0; padding-top: 0px; rebuy-widget-226202 a text-decoration: none; white-space: normal; rebuy-widget-226202 .rebuy-bundleactions-price font-size: 16px; margin: 10px auto; rebuy-widget-226202 .rebuy-bundleactions-buttons margin: 0 auto; padding: 0px 15px; rebuy-widget-226202 .rebuy-bundleitems .rebuy-product-info display: flex; flex-direction: column; text-align: center; rebuy-widget-226202 .rebuy-bundleitems display: flex; justify-content: space-around; rebuy-widget-226202 .rebuy-product-block width: 100%; max-width: 300px; padding: 10px 15px; rebuy-widget-226202 .rebuy-bundleimage-item width: 100%; rebuy-widget-226202 .rebuy-bundle .rebuy-product-block .rebuy-product-options margin: 0px; rebuy-widget-226202 .rebuy-product-price padding: 10px 0px; rebuy-widget-226202 .rebuy-bundleactions.rebuy-mobile, rebuy-widget-226202 .rebuy-bundleimages display: none; rebuy-widget-226202 .primary-title font-weight: 400; font-size: var(--h4-font-size); rebuy-widget-226202 .rebuy-product-checkbox display: flex; justify-content: center; padding-block: 10px; media (max-width: 768px) rebuy-widget-226202 margin: 0; padding: 20px; rebuy-widget-226202 a text-align: left; white-space: nowrap; rebuy-widget-226202 .primary-title text-align: left; rebuy-widget-226202 .rebuy-product-price, rebuy-widget-226202 .rebuy-product-checkbox padding-block: 0; rebuy-widget-226202 .rebuy-product-price flex: 1; text-align: right; rebuy-widget-226202 .rebuy-bundleimages display: flex; flex-wrap: nowrap; gap: 20px; width: 100%; rebuy-widget-226202 .rebuy-bundleitems flex-direction: column; margin-top: 30px; rebuy-widget-226202 .rebuy-bundleitems .rebuy-product-info flex-direction: row; align-items: center; width: 50%; margin-block: 5px; rebuy-widget-226202 .rebuy-bundleactions.rebuy-desktop, rebuy-widget-226202 .rebuy-bundleitems .rebuy-bundleimage-item.bundle-single-image, rebuy-widget-226202 .rebuy-product-label display: none; rebuy-widget-226202 .rebuy-bundleactions.rebuy-mobile display: block; rebuy-widget-226202 .rebuy-bundleactions margin-top: 0; padding-top: 10px; rebuy-widget-226202 .rebuy-product-block width: 100%; max-width: unset; padding: 0; flex-flow: unset; gap: 0; rebuy-widget-226202 .rebuy-product-review white-space: nowrap; margin: 5px; rebuy-widget-226202 .rebuy-select padding: 8px; rebuy-widget-226202 .rebuy-bundle .rebuy-product-block .rebuy-product-options width: 45%; margin-left: 10px; rebuy-widget-226202 .rebuy-product-review display: block ! important; margin-top: 10px ! important; margin-bottom:











