Montreal-based Shopify experts cooking some Shopify apps.
By default, once customers deserve a free gift, the popup from our Automatic Discount app will show right away, once rules are met of course. That means it can show in the product page, after an item is added to cart, for example. This happens in store using a drawer aka ajax cart, or when the customer isn't automatically redirect to the cart page after he or she adds an item to cart.
If you prefer to make sure that the gift popup is only displayed in the cart page, simply do these 2 steps.
Inside the same condition that triggers the discount, click on "add rule" and select "Custom JS Function".
Then, you will define a global function (javascript) to make it pop ONLY on the cart page. See step 2 below.
Define a global javascript function somewhere in your theme.liquid. If this function returns TRUE, the rule will be considered completed, anything else and it will be considered incomplete. See example of a function named _tbn_is_on_cart_page
below:
<script>
window['_tbn_is_on_cart_page'] = function ({ cart, smart_cart, rule, customer }){
return window.location.pathname.indexOf("/cart")>=0
}
</script>
Tabarnapp's mission is to help you get the most of each visit on your Shopify store.
E: support@tabarnapp.com