Skip to content
|
|
Customer services
aloha.roam@gmail.com
Wholesale inquires
sarah@roamwears.com
Partnership inquires
bella@roamwears.com
|
inside that template would
// terminate it early and drop the checkout button.
(function() {
function updateSaleNotice() {
var el = document.querySelector('.sale-notice-drawer');
if (!el) return;
fetch('/cart.js')
.then(function(r) { return r.json(); })
.then(function(cart) {
return Promise.all(cart.items.map(function(item) {
return fetch('/products/' + item.handle + '.js').then(function(r) { return r.json(); });
}));
})
.then(function(products) {
var hasSale = products.some(function(p) {
return p.tags && p.tags.indexOf('BlackFriday') !== -1;
});
var notice = document.querySelector('.sale-notice-drawer');
if (notice) notice.style.display = hasSale ? 'block' : 'none';
})
.catch(function() {});
}
var target = document.getElementById('CartContainer') || document.body;
new MutationObserver(function() {
if (document.querySelector('.sale-notice-drawer:not([data-sale-checked])')) {
document.querySelector('.sale-notice-drawer').setAttribute('data-sale-checked', '1');
updateSaleNotice();
}
}).observe(target, { childList: true, subtree: true });
})();