I am new to the Magento, so not sure how we can implement this I want to send ajax request on Add to cart button on product detail page where I have to send the request to get stock from third party API.


You need to override file:-


Replace "bindSubmit": false To "bindSubmit": true

<script type="text/x-magento-init">
        "#product_addtocart_form": {
            "catalogAddToCart": {
                "bindSubmit": true

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.