Is there any way to create a popup notification when a customer leaves the website while there are still items in the cart?

It should contain message like: There are still items in your cart, are you sure you want to leave?

I've tried to search for any extension to realise this, but i couldn't found any.

Got any ideas? Can this be achieved by adding a code onto all pages?

Thanks in advance.

1 Answer 1


To accomplish this you will need to use javascript and only trigger it if the cart contain items.

Take a look at


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.