This code is working (as is) on a live site. I am attempting to run it on localhost via XAMPP but addToCart.php is not being called.
Wondering if there's a better way to write this so it is more robust and will work on localhost config as well. I am not very familiar with JQuery or PHP, as may be obvious from the code.
<a id="atcAnchorTag'.$thisProduct['id'].'"
href="#"
onclick="
jQuery.ajax(\'./addToCart.php?id='.$thisProduct['id'].'\');
jQuery(atcAnchorTag'.$thisProduct['id'].').hide();
jQuery(rfcAnchorTag'.$thisProduct['id'].').show();
jQuery(mt'.$thisProduct['id'].').hide();
jQuery(grn'.$thisProduct['id'].').show();
scItemsCountJS++ ;
return false ; "
style="display:'.$atcDisplayType.'">add to cart</a>
data-attributes. That way, you can attach youronclickstuff via an event handler.