We are stoked to introduce our popular skin-kits for the Disney Magic Bands! Choose from our trendy designs or even let our designers create the perfect skin for you!
Add style to your MacBook without the bulk. With Design Skinz, you can change the look of your favorite device in seconds, literally. Made from a premium vinyl, these skinz can take a beating and will protect your device from scratches and other abuse.
Available for the OtterBox Commuter, Symmetry, Defender or Pursuit Cases for iPhone. // Dual-Layer Construction. Crystal clear lamination applied over graphic for extreme lifetime. Made in Premium 3M materials for long-lasting Ultra-Thin Protection.
If you're not completely satisfied, NEITHER ARE WE.
Top-notch support
We drive to deliver nothing short of the BEST.
Secure payments
Security built from the ground up with your privacy at our CORE.
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add
* then add Liquid error (snippets/cart-design-thumbs line 13): Nesting too deep 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);
})();
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);
})();