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>
|
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}}
|
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.