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.

6
  • product detail page
    – Daniel_12
    Commented May 11, 2018 at 12:24
  • @Daniel_12 check magento.stackexchange.com/questions/125681/… Commented May 11, 2018 at 12:27
  • magento version 2.2.0
    – Daniel_12
    Commented May 11, 2018 at 12:31
  • I know its default but i need to check stock in my third party api
    – Daniel_12
    Commented May 11, 2018 at 12:39
  • @SureshChikani sure :) I will be take care of this thing in future but as of now do you know how can I implement this
    – Daniel_12
    Commented May 11, 2018 at 12:51

1 Answer 1

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 and acknowledge you have read our privacy policy.

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