Custom cart popup

I would like to create a popup/lightbox that activates when a customer clicks the checkout button, but only if a particular product has not been added to the store’s cart. The popup will encourage the customer to add the particular product to their cart.

Is this possible?

See Ahmad’s answer below

Hello :raised_hand_with_fingers_splayed:

If you’re using Wix own Stores, you unfortunately can’t since the “Checkout” button is part of Wix Stores App.

Elements part of apps are off-limits and can’t be accessible using the global selector $w , you can only control apps through their respective settings.

Ahmad

Ahmad, I have no experience with Wix Stores, but maybe you can create a router and once it gets a call for the checkout page it’ll check the cart products and based on that it’ll decide whether or not to stay on the cart page and to open a lightbox.
Isn’t that possible?

Yeah, I think it is.

@J.D. and @Ahmad thanks very much for your help.

Hi @neilpadgett452 & @ahmadnasriya , looking to do something similar myself - did you manage this?

Hi @Alex Butler, no, I didn’t take it any further.

There is this - https://support.wix.com/en/article/corvid-tutorial-cross-selling-a-product-in-your-store-with-corvid-by-wix which I think does (or will do with a bit of alteration) what you want.

However see my post where the coding doesn’t completely match the description of what it is going to do. There needs to be some extra coding.

@knight.maidstone That looks like it does the job. I wished I’d have seen that sooner.

Thanks @knightmaidstone ! Trying to get my head around the isProductMissingFromCart function, did you get the code to work for you in the end?