I’m in need of updating a line of code to switch from the way that it currently is, using an alert, to using a modal. Basically I just need to add in a quick, “Added to Cart.” popup modal function where the current alert is called. The code in question is:
<a href="<?php echo $buylink; ?>" onClick="alert('Added to cart.')" target="noFrame">BUY</a>
I’ve searched and have found no solution for doing this outside of installing a plugin, which I would really prefer not to do for something so simple. I’m having trouble figuring out how to call the php function as the new onClick so that it would be something like onClick=”addToCart()” and reference a .js file.