Skip to content

Instantly share code, notes, and snippets.

@Sally165
Created April 24, 2023 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sally165/128019b21efd09bf5becaf691ff1aa4c to your computer and use it in GitHub Desktop.
Save Sally165/128019b21efd09bf5becaf691ff1aa4c to your computer and use it in GitHub Desktop.
<script>
window.addEventListener('load', () => {
var pfATCs = $('#__pf').find('[data-pf-type="ProductATC"]');
pfATCs.click(e => {
var checkoutAction = e.currentTarget.getAttribute('data-checkout');
if (checkoutAction === 'same') {
window.__pagefly_helper_store__ && window.__pagefly_helper_store__.subscribe(function(res) {
var id = res.id;
window.carts.forEach(function (e) {
e.onCartUpdated(id);
});
})
}
})
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment