Description
Customer Reviews
Payment & Security
Your payment information is processed securely. We do not store credit card details nor have access to your credit card information.
Your payment information is processed securely. We do not store credit card details nor have access to your credit card information.
in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();
just before in theme.liquid.
*/
(function () {
var syncing = false;
function swap() {
if (syncing) return;
syncing = true;
fetch("/cart.js", { credentials: "same-origin" })
.then(function (r) { return r.json(); })
.then(function (cart) {
var lines = (cart.items || []).map(function (item) {
return {
preview: item.properties && (item.properties._preview || item.properties._previewUrl),
design: item.properties && item.properties.Design,
key: item.key,
image: item.image || "",
};
});
if (!lines.some(function (l) { return l.preview; })) return;
// Cart line images across themes: an
inside an element that links
// to the line's variant, or (fallback) all imgs currently showing a
// line's placeholder product image, matched in cart order.
var imgs = Array.prototype.slice.call(
document.querySelectorAll(
"#CartDrawer img, cart-drawer img, #cart img, form[action='/cart'] img, .cart-items img, [class*='cart'] img"
)
);
var used = [];
lines.forEach(function (line) {
if (!line.preview) return;
var placeholderFile = (line.image.split("/").pop() || "").split("?")[0];
var match = imgs.find(function (img) {
if (used.indexOf(img) !== -1) return false;
if (img.src.indexOf(line.preview) !== -1) { used.push(img); return false; } // already swapped
return placeholderFile && img.src.indexOf(placeholderFile) !== -1;
});
if (match) {
used.push(match);
match.src = line.preview;
if (match.srcset) match.removeAttribute("srcset");
match.style.objectFit = "cover";
if (line.design) match.alt = line.design;
}
});
})
.catch(function () {})
.finally(function () { syncing = false; });
}
// initial + whenever the cart UI rerenders (AJAX drawers replace DOM nodes)
var t;
new MutationObserver(function () { clearTimeout(t); t = setTimeout(swap, 150); })
.observe(document.documentElement, { childList: true, subtree: true });
if (document.readyState !== "loading") swap();
else document.addEventListener("DOMContentLoaded", swap);
})();