I have added custom add to cart submit button on product detail page.

On submit, i am getting other form fields values but not getting submit button name and value.

So how can i get the name or value of submit button in post.

Does anyone know how to solve it ? Thanks in advance.

  • please put your custom code. Dec 3, 2019 at 6:43

1 Answer 1


Override Js file in your theme and update the code that you want to update:




  • Thanks for your response but i don't want to do with theme, I will override in module and try.
    – Soni5041
    Dec 3, 2019 at 10:33
  • You can override with the custom module as below: In your app\code\Custom\Module\view\frontend\requirejs-config.js Add the following code. var config = { map: { '*': { 'Magento_Catalog/js/catalog-add-to-cart':'Custom_Module/js/catalog-add-to-cart', catalogAddToCart:'Custom_Module/js/catalog-add-to-cart' } } }; Put your add to cart file in app\code\Custom\Module\view\frontend\web\js path with name catalog-add-to-cart.js copy and past the parent file and Make your changes. Hope this will help. Dec 4, 2019 at 11:21

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.