Adding 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 through 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, for instance.

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:

<script> 
window.addEventListener("gvlo:cart:add", function () {   

	// Your code here 
}); 

</script>
	
4

In the Govalo app, go to Configure > Advanced gift card configurations and add "?" to the Custom Redirect field:

5

Save the file when you're done editing.

Still need help? Contact Us Contact Us