简体   繁体   中英

Js / show a popup link when there is a quantity typed and product not added to cart

I want to show an alert message when there is a quantity typed and the product is NOT added to cart with Magento.

It's to prevent the user to quit the page (with clicking in other links) witout adding the product to cart

How can I do that?

Thanks a lot:)

The only real way to stop the user from exiting a page when they attempt to leave is to use an onunload handler, which shows one of those terrible alert boxes where you click Ok or Cancel. These are considered to be poor practice, unless you are saving the user from losing a bunch of data, and even then the helpfulness is questionable.

Good manners on the internet dictate that the user be allowed to leave your page when they see fit, without being harangued by popups or error messages. If you want to capture some of that lost traffic, consider using a timer or something related to show an overlay on the page offering the customer something for staying (a coupon code, etc etc).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM