How to add a Contact Us form in Magento using code?

You want to add a contact form in Magento. Magento includes contact form functionality but it is not easy to add / edit. This can be done by creating a CMS page and including the contact form as a static block.

Steps for add a contact form:

–  Create a CMS page (Admin > Manage Pages

–  Select the page you want to edit or create a new page.

–  Paste the following HTML where you would like the contact form to be positioned in your CMS page:

Code:

 <!– CONTACT FORM CODE BEGIN–>{ {block type=’core/template’ name=’contactForm’ template=’contacts/form.phtml’} }<!– CONTACT FORM CODE END–>

Save changes and contact form will appear on the desired page.

 

Leave a Reply

Your email address will not be published. Required fields are marked *