Shopify themes, liquid, logos, and UX
Hi team,
I'm currenlty trying to implement the Klaviyo back in stock button. We're using the Wookiee theme and finally managed to get the button to show up, but for some reason the button only displays after you refresh the product page.
This is the code snippet I used in the product-template.liquid:
<script type="text/javascript">document.addEventListener("DOMContentLoaded", function(){ var _learnq = _learnq || [];var classname = document.getElementsByClassName("btn btn-lg btn-addtocart addtocart-js");var addToCart = function() {learnq.push(['track', 'Added to Cart', item]);}; for (var i = 0; i < classname.length; i++) {classname[i].addEventListener('click', addToCart, false); } });</script>
Would someone be able to help me with this?
Cheers,
Andre
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024