1

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.

0

You need to override file:-

app/design/frontend/[vendorname]/[themename]/Magento_Catalog/templates/product/view/addtocart.phtml

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

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

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.