Skip to content

Instantly share code, notes, and snippets.

@Sally165
Created April 24, 2023 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Sally165/a954a258ccb375b85fbcf00b988a9d7b to your computer and use it in GitHub Desktop.
Save Sally165/a954a258ccb375b85fbcf00b988a9d7b to your computer and use it in GitHub Desktop.
<!--- PageFly Cart Helper code - DO NOT DELETE - Added by Cristian -->
<script>
try {
setTimeout(function () {
window.__pagefly_helper_store__ &&
window.__pagefly_helper_store__.subscribe(function (res) {
$.getJSON('/cart.json').then(cart => {
let t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
try {
const {Cart: i} = MinimogTheme;
MinimogEvents.emit("ON_ITEM_ADDED", e),
i && (await i.refreshCart(),
t && (await i.renderNewCart(),
i.openCartDrawer(),
MinimogTheme.Notification.show({
target: i.domNodes?.cartDrawerItems,
method: "prepend",
type: "success",
message: MinimogStrings.itemAdded,
delay: 400
})),
await Shopify.onCartUpdate(i.cart, !1))
} catch (e) {}
});
});
}, 2500);
} catch (e) {
console.warn(e);
}
</script>
<!--- End of Code →
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment