How to enable the default Magento contact form?
- System > Configuration > Contacts
- Click the ‘Contact Us’ section on this page. Set ‘Enable Contact Us’ to ‘Yes’
- Click the ‘Email Options’ section on the same page, just under it. Set the email address to which the comments should come, subject and email template.
- Click ‘Save Config’
How to add a custom field to the default Magento contact form?
- Open [magento_root]/app/design/frontend/default/default/template/contacts/form.phtml in your favorite editor
- Copy & paste an existing form field code on this script and rename the field to create new field. For example:
This is the default code in the file:
123456789<div class="input-box"><label for="email"><?php echo Mage::helper('contacts')->__('Email') ?> <span class="required">*</span></label><br /><input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserEmail()) ?>" class="required-entry input-text validate-email" type="text" /></div><div class="clear"></div><div class="input-box"><label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label><br /><input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" /></div>This is how the modified code will look like:
12345678910111213141516<div class="input-box"><label for="email"><?php echo Mage::helper('contacts')->__('Email') ?> <span class="required">*</span></label><br /><input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserEmail()) ?>" class="required-entry input-text validate-email" type="text" /></div><div class="clear"></div><span style="background-color: #ffff00"><!-- New Field Code--><div class="input-box"><label for="website"><?php echo Mage::helper('contacts')->__('Website') ?></label><br /><input name="website" id="website" title="<?php echo Mage::helper('contacts')->__('Website') ?>" value="" class="input-text" type="text" /></div><div class="clear"></div><!-- End New Field Code--></span><div class="input-box"><label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label><br /><input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" /></div> - Now go to, System > Transaction Emails.
- Click ‘Add New Template’
- In the ‘Load default template’ section, select ‘Contact Form’ template and click ‘Load Template’
- The template content will look like this:
12345Name: {{var data.name}}E-mail: {{var data.email}}Telephone: {{var data.telephone}}Comment: {{var data.comment}}
- Add your new field in this content like this:
123456Name: {{var data.name}}E-mail: {{var data.email}}<span style="background-color: #ffff00">Website: {{var data.website}}</span>Telephone: {{var data.telephone}}Comment: {{var data.comment}}
- Enter a new ‘Template Name’ and click ‘Save template’
- Now go to, System > Configuration > Contacts
- Click the ‘Email Options’ section on this page and select the new template that you just created.
- Click ‘Save Config’
How to add a link to the contact form on the top menu bar?
- Open [magento_root]/app/design/frontend/default/default/template/catalog/navigation/top.phtml in your favorite editor
- After this line:
1<?php endforeach ?>
Add a line like this:
1<li><a href="<?php echo $this->getUrl('contacts')?>"><?php echo $this->__('Contact Us') ?></a></li> - Click the Magento cache; System > Cache Management
Reference links:
- http://www.magentocommerce.com/wiki/how_to/add_fields_to_contact_form
- http://www.richardcastera.com/2009/08/17/magento-add-additional-fields-to-the-contact-form/
- http://www.magentocommerce.com/boards/viewthread/21707/
- http://inchoo.net/ecommerce/magento/contact-form-in-magento/
Incoming search terms:
- online contact form creator in magento
- add contact us link in magento
- link to custom email 1 magento
- magento 1 7 add extra fields in contact form & email
- magento contact form in top menu
- magento contact form top menu
- magento contact us add a new required field
- magento contact us comment fields empty
- magento enable contact us page
- how to put captcha in contact us page in magento
Tagged with: magento contact form • magento contact form custom field • Magento eCommerce Tips
Filed under: Magento eCommerce Tips • Magento eCommerce Tips
Like this post? Subscribe to my RSS feed and get loads more!




I have done all the expected things to set up the contact us page but it still doesn’t actually work. Any ideas???
@Melanie – what is the error that you are getting?
Helpful piece of Magento code to refer back to when starting a new Magento site. So thanks, I’ve delicious’ed it.
Matthew Orley
Good day! This post couldn’t be written any better! Reading this post reminds me of my good old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Many thanks for sharing!