We will show newsletter popup
when customers leave the site
Instead of showing popup on customers visit
the site:
- When customer is going to close the website?
- When customer is going to go to another website?
How to do this. Thanks.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityWe will show newsletter popup
when customers leave the site
Instead of showing popup on customers visit
the site:
How to do this. Thanks.
This javascript 'onbeforeunload' event is used to detect browser close or changing website. You can use the event to display popup.
window.onbeforeunload = function () {
return "Do you really want to close?";
};
You can do it in jquery. Please refer the Mouseleave and Mouseout function and set the event in your body
tag. Popup block
code shoud be in your header.phtml
For Example :
$( "body" ).mouseout(function() {
//call your popup block
});
Hope it will usefull for you.