How to Add New Field Contact Form in magento


Step 1: Add field to phtml file

Go to app -> design -> frontend -> yourpackage -> yourtheme -> template -> contacts -> form.phtml

If you want to add required field:

1
2
3
4
<li>
    <label for="email"><em>*</em><?php echo Mage::helper('contacts')->__('Company Name') ?></label>
    <div class="input-box"><input name="company" id="company" title="<?php echo Mage::helper('contacts')->__('Company Name') ?>" class="input-text required-entry validate-email" type="text" /></div>
</li>

If you want to add non-required field:

1
2
3
4
<li>
    <label for="telephone"><?php echo Mage::helper('contacts')->__('Company Name') ?></label>
<div><input name="company" id="company" title="<?php echo Mage::helper('contacts')->__('Company Name') ?>" value="" type="text" /></div>
</li>

Magento Contact us Form

Step 2: Add new field detail in email

Open admin panel and go to System -> Transactional E-mails -> Add New Template
Then From the ‘Template’ dropdown menu choose ‘Contact Form’ and then click on ‘Load Template’. You’ll see the current email content, so you’ll simply need to add your new piece of data:

1
2
3
4
5
6
7
Name: {{var data.name}}
E-mail: {{var data.email}}
Telephone: {{var data.telephone}}
Company Name: {{var data.company}}
Comment: {{var data.comment}}

Magento Contact Form Template

Step 3: Apply nwe template to contact email

Go to System -> Configuration -> Contacts. In the ‘Email Options’ section, choose your new template under the ‘Email Template’ dropdown menu and save.

Contactus Form Magento

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s