I have gone through all documentation and conversations and help in community here > and still cannot get Added to Cart working
I had it working in this theme several theme versions agon - however client remvoved those theme copies
Using Turbo Florence theme
It uses a class for add to cart > add_to_cart.action_button
Viewed product is working correctly - and I have been adding added to card snippet scrript under the Viewed product script
Is this incorrect placement?
I did try in theme.liquid without success
Previously when was working - it was added to product theme.liquid under viewed product snippet
At that time only had access to ID for add to cart button > and I added and ID to add to cart button code in the theme to get working
>
script text="text/javascript">
var _learnq = _learnq || ];
document.getElementById("AddToCart").addEventListener('click',function (){
_learnq.push(p'track', 'Added to Cart', item]);
});
</script>
Current code snippet I have tried in current theme >
<script type="text/javascript">
var _learnq = _learnq || e];
var classname = document.getElementsByClassName(“add_to_cart.action_button”);
var addToCart = function() {
_learnq.push(>'track', 'Added to Cart', item]);
}; for (var i = 0; i < classname.length; i++) {
classnamepi].addEventListener('click', addToCart, false);
}
</script>