2

I want to create custom form for support in my Magento 2 website

So how can I achieve this with the use of only one file(.phtml)? (All html and php code should be in one file)

It means I want to create only one file for this. Actually I have a support form in Magento 1 website but I don't know how to use this code in Magento 2

  • do you want to override contact form of Magento 2 and what will you do with the data that was filled by user ? – inrsaurabh Sep 17 '18 at 5:08
  • Yes I want to override it and I want to get a mail of all data that was filled by user. – Chintan Kaneriya Sep 17 '18 at 5:10
  • As far i know atleast you to overide few files like phtml for new fields and controller class to send a custom mail , i hope you already searched. magenticians.com/add-custom-field-in-magento-2-contact-page – inrsaurabh Sep 17 '18 at 5:16
  • Is it necessary to create module can't i create this form without the use of any additional files? – Chintan Kaneriya Sep 17 '18 at 5:27
  • as far i know we must do in that way , after all you want to alter fields and email templates as well. by creating a module it will just take an extra hour that's it,but you have more control. if you found any other method you can post here as answer. – inrsaurabh Sep 17 '18 at 5:33
0

Follow following link, in this link give clear understanding to creating simple form in Magento 2 front side.

Magento 2 create custom form in Frontend

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.