-
-
Save Sally165/7a4d44aee4b5e97aa6e9aa8cf8d53ade to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script> | |
try { | |
setTimeout(function () { | |
window.__pagefly_helper_store__ && | |
window.__pagefly_helper_store__.subscribe(function (res) { | |
$.getJSON('/cart.json').then(cart => { | |
document.documentElement.dispatchEvent(new CustomEvent('product:added', { | |
bubbles: true, | |
detail: { | |
quantity: 1 | |
} | |
})); | |
$('.header__cart-count').text(cart.item_count) | |
}); | |
}); | |
}, 2500); | |
} catch (e) { | |
console.warn(e); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment