Md Toufic Ahmed Khan Badhon
01/25/2025, 10:25 PMNoah Gilmore
01/26/2025, 3:53 AMSteve (Replo Team)
01/26/2025, 7:19 PMMd Toufic Ahmed Khan Badhon
01/26/2025, 7:20 PMSteve (Replo Team)
01/26/2025, 7:28 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 1:53 AMMd Toufic Ahmed Khan Badhon
01/29/2025, 1:53 AMSteve (Replo Team)
01/29/2025, 2:19 AMMd Toufic Ahmed Khan Badhon
01/29/2025, 2:21 AMMd Toufic Ahmed Khan Badhon
01/29/2025, 2:23 AMMd Toufic Ahmed Khan Badhon
01/29/2025, 2:23 AMMd Toufic Ahmed Khan Badhon
01/29/2025, 9:44 AMSteve (Replo Team)
01/29/2025, 7:24 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 7:25 PMSteve (Replo Team)
01/29/2025, 7:30 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 7:31 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 7:32 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 7:33 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 7:33 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 7:34 PMSteve (Replo Team)
01/29/2025, 7:34 PMMd Toufic Ahmed Khan Badhon
01/29/2025, 7:50 PMSteve (Replo Team)
01/29/2025, 8:52 PMcart-drawer section. The Replo preview page (e.g., /apps/alchemy/...) doesn’t load the full theme, so the section is missing, causing errors.
Why This Happens
• ✅ Live Pages (skinglow.mx, /pages/<slug>): Include the cart-drawer section. The script works because:
◦ cartData.sections returns the section’s HTML.
◦ The <cart-drawer> element exists in the DOM.
• ❌ Replo Preview: Uses a simplified template without the cart-drawer section, so cartData.sections is undefined and the element is missing.
Quick Fix
Add error handling to avoid crashes on previews and simply understand this limitation:
fetch("/cart/update.js", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ updates: {}, sections: ["cart-drawer", "cart-icon-bubble"] })
})
.then(res => res.json())
.then(cartData => {
const cartDrawer = document.querySelector("cart-drawer");
if (cartDrawer && cartData.sections?.["cart-drawer"]) {
cartDrawer.renderContents(cartData);
document.querySelector("cart-drawer.drawer")?.classList?.remove("is-empty");
}
})
.catch(err => console.error("Error:", err));
Live Pages Will Work
Once your Replo page is published to /pages/<slug>, the theme will include {% section 'cart-drawer' %} in the pages live rendered form. The script will then work then just as it does today on the homepage.
You can basically execute any JS code in console so getting good at debugging these will helpMd Toufic Ahmed Khan Badhon
01/29/2025, 8:54 PMSteve (Replo Team)
01/29/2025, 8:55 PMSteve (Replo Team)
01/29/2025, 9:06 PM