Skip to main content

Can we make it so that a pop-up appears on the main page or product page offering a free gift even when the shopping cart is empty, and if the customer clicks on it, the gift is marked as pre-selected in the system? Then, when the cart reaches the minimum amount (e.g., $10,000), it will automatically be added to the cart? We have an Opencart system.

@kameradepo hey there, thanks for your question!

The short answer is - yes, this is doable, and very exciting!

The longer answer, however is...

Yes, this is definitely doable, but it will require a combination of Klaviyo targeting, some JavaScript, and custom logic in OpenCart.

You can use a Klaviyo pop-up to trigger on the homepage or product pages even when the cart is empty, either by using URL-based targeting or a custom JavaScript condition that checks if the cart total is zero (e.g. window.cart && window.cart.total === 0).

When the user clicks on the pop-up CTA to claim the free gift, you can store their interest either by setting a cookie like giftInterest=true or by updating their Klaviyo profile with a custom property like gift_preselected = true.

Then, on the OpenCart side, you’ll need to build logic that watches for when the cart reaches the required threshold, such as $10,000, and if the gift has been pre-selected (based on the cookie or profile tag), automatically adds the gift product to the cart. This can be done either client-side with JavaScript or server-side via OpenCart’s backend logic. For example, client-side you could use a script that runs on cart update and checks both the cart total and the presence of the cookie, then calls the OpenCart add-to-cart API to inject the gift.

Alternatively, on the server, you could handle it within the cart or checkout controller to conditionally include the gift product. You might also consider adding a floating progress bar or message that tells users how close they are to unlocking the gift, which can help increase average order value. The key is making sure the pre-selection is stored reliably and that your logic for adding the gift runs automatically once the cart qualifies. 

I haven’t tested this so I can’t really guarantee it will work, but it will definitely need some dev work to get it all in line (as you need to script the cart value and gift interest tracker manually).

Hopefully some of this will help you!