Skip to content

Instantly share code, notes, and snippets.

@swym-public
Created March 29, 2022 15:38
Show Gist options
  • Save swym-public/b98033cbc4aeed191d60ccd45e9285dc to your computer and use it in GitHub Desktop.
Save swym-public/b98033cbc4aeed191d60ccd45e9285dc to your computer and use it in GitHub Desktop.
swym-wishlist counter.
<script class="swym-wishlist-header-counter-custom">
function renderWishlistCounter(swat) {
var counter_elem = document.querySelectorAll(".swym-wishlist-header-counter"); /* Custom header can be added here.*/
if (counter_elem) {
for (var i = 0; i < counter_elem.length; i++) {
if (swat.renderWishlistCount) {
swat.renderWishlistCount(counter_elem[i], function(count, element) {
console.log("debug - renderWishlistCount", count, element);
});
}
}
}
}
if (!window.SwymCallbacks) {
window.SwymCallbacks = [];
}
window.SwymCallbacks.push(renderWishlistCounter);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment