How do I add custom events after the gift card is added to the cart?

Congratulations on getting started with Govalo. Now it may be time to add some custom events to your add to cart script in order to make sure Govalo flows your site and feels like it belongs!  This can be great for things like triggering a slide-out cart rather than directing to the cart page etc.

Let's dig in.

  1. Open the Online Store | Themes section of your Shopify Admin 
  2. Use the drop-down on your current theme to select "Edit Code"
  3. In the Theme.liquid file, before the </body> tag add the following code
document.body.addEventListener("govaloCardAdded", function () {   
document.body.removeEventListener("govaloCardAdded", redirectToCart, false);   

	// Your code here 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us