How to show Pop Up when clicking on Add to cart checkbox for related products Magento 2.1.7?

The pop-up message should be (The product has been added to cart)


You can do it in the javascript that adds the product to the cart

You could add this to your page and then add some popup code into it

        <script type="text/x-magento-init">
            "[data-role=tocart-form], .form.map.checkout": {
            "catalogAddToCart": {}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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