-
-
Save Sally165/8b29ba47e0b3c1700f5b071e33f93e23 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
<!-- PAGEFLY CART HELPER - DO NOT DELETE --> | |
<script> | |
try { | |
setTimeout(function () { | |
window.__pagefly_helper_store__ && | |
window.__pagefly_helper_store__.subscribe(function (res) { | |
$.getJSON('/cart.json').then(data => { | |
var count, total_price; | |
total_price = theme.utils.formatMoney(data.total_price); | |
count = data.item_count; | |
$('.header--cart-number').attr('data-item-count', count); | |
$('.cart--root').attr('data-has-items', true); | |
$('.cart--external--total-price').text(total_price); | |
$('.cart--external--total-items').text(count); | |
var url | |
if (theme.partials.Cart.view === 'mobile') { | |
url = theme.partials.Cart.ajax_mobile_url | |
} else { | |
url = theme.partials.Cart.ajax_desktop_url | |
} | |
$.ajax({ | |
url: url, | |
type: "GET", | |
dataType: "html" | |
}).done(function(data) { | |
var cart_html; | |
cart_html = $($.parseHTML(data)); | |
$('.cart--root').html(cart_html[1]); | |
}); | |
}); | |
}); | |
}, 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