-Sert Cases - iPhone 6 Plus skins by DesignSkinz — 1,877+ designs, each printed in vivid fade-proof color and precision die-cut for a perfect fit. Not a case, not a sticker: a paper-thin vinyl skin that protects against scratches and scuffs, installs bubble-free in minutes, and peels off clean whenever you want a new look.
Every skin is made to order in Danville, Virginia and ships within 48 hours, in your choice of Ultra High-Gloss or Soft-Touch Matte. Rated 4.9/5 by 38,000+ customers — over 1,000,000 devices skinned since 2011. Free U.S. shipping over $35 and a lifetime peel-clean guarantee on every order.
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);
})();