1

I have to change a field of my contact form. For example, there is a field "telephone" which I have to replace with "subject" field in the contact us page form. Will anyone please tell me how can I make these changes?

1 Answer 1

2
  • Open form.phtml file located at app/design/frontend/default/YOUR_THEME/template/contacts folder.
  • Then find the following lines of code:

**

<li>
    <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
    <div class="input-box">
        <input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
    </div>
</li>

**

and replace it with:

<li>
    <label for="subject"><?php echo Mage::helper('contacts')->__('Subject') ?> <span class="required">*</span></label>
    <div class="input-box">
        <input name="subject" id="subject" title="<?php echo Mage::helper('contacts')->__('Subject') ?>" value="" class="required-entry input-text" type="text"/>
    </div>
</li>
  • Now to show this field in contact us mail login to Admin Panel => System => Transactional Emails and click Add New Template and from the templates drop-down box select Contact Form. Then click on Load Template button.
  • Under template content, find:

Telephone: {{var data.telephone}}

and replace it with:

Subject: {{var data.subject}}

  • Now go to System => Configuration and select Contacts. Then under the Email Options, select your new template under the Email Template drop-down and click on Save Config button.
3
  • Thank you so much Mohit. Its Working. You have solved out my query. Thanks once again. Jul 11, 2017 at 7:29
  • yeah sure.......... Jul 13, 2017 at 11:04
  • how to get Attachment field i have tried but file name is get only Please Check screen-short prnt.sc/r2yo9s Please Help me Feb 16, 2020 at 5:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.