Ad

Triggering An Onclick For Shopify Without It Happening On Page Load

- 1 answer

In my liquid template I've tried to create a trigger for a click event but it seems to trigger on page load and causing more product to be added to the cart than is specified.

I admit, I'm new to shopify but can't figure why it would happen on page load...

Ad

Answer

It turned out that on this project I had to declare any selector used as a variable first.

Ad
source: stackoverflow.com
Ad