Tutorial about create custom contact form in magento


Published on

Magento Extension Development | Magento Development India | Magento Development Company

Published in: Design, Technology
1 Like
  • What a filthy copy and paste job!

    For those looking for the original posting of this content see the following link:


    Not even a mention of the original creator... You should be ashamed.
    Are you sure you want to  Yes  No
    Your message goes here
  • http://www.slideshare.net/bhupendrarajput/wordpress-developers-new-york
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Tutorial about create custom contact form in magento

  1. 1. Tutorial about Create Custom Contact Form inMagento
  2. 2. sql/customcontacts_setup/mysql4-install-0.1.0.phpManually inserting a custom email template straight into the database.This isn’t really a necessary step because you could just create onemanually by going to System > Transactional Emails. To save you a bit oftime I’ve set up a really basic one which is very similar to the standardcontact form email template.
  3. 3. 1 | <?php2 | $installer = $this;3 | $installer->startSetup();4 |5 | $installer->run("6 | INSERT INTO {$this->getTable(core_email_template)}(`template_code`, `template_text`, `template_type`, `template_subject`, `template_sender_name`, `template_sender_email`, `added_at`, `modified_at`) VALUES7 | (Custom Contact Form, Name: {{var data.name}}rnSubject: {{var data.subject}}rnE-mail: {{var data.email}}rnTelephone: {{var data.telephone}}rnComment: {{vardata.comment}}, 1, Custom Contact Form, NULL, NULL, NOW(), NOW());8 | ");9 | $installer->endSetup();
  4. 4. etc/config.xmlWhen creating frontend router, specified it as ‘custom-contact’. You can change thisto something more appropriate.1 | <routers>2 | <customcontacts>3 | <use>standard</use>4 | <args>5 | <module>Creare_Customcontacts</module>6 | <frontName>custom-contact</frontName>7 | </args>8 | </customcontacts>9 | </routers>
  5. 5. During the setup script, create a transactional email template, but it’s notpossible to set this as a default with your form. So, you have to set a defaultform from the locale unless you want to go and create your own html form inthe locale. The following goes within the global node:1 | <template>2 | <email>3 | <contacts_customemail_email_template translate="label">4 | <label>Contacts</label>5 | <file>contact_form.html</file>6 | <type>text</type>7 | </contacts_customemail_email_template>8 | </email>9 | </template>
  6. 6. Following goes within the default node. This is just the process of assigning defaults tothe new config fields.1<default>2 <contacts>3 <customcontacts>4 <enabled>1</enabled>5 </customcontacts>6 <customemail>7 <recipient_email><![CDATA[hello@example.com]]></recipient_email>8 <sender_email_identity>custom2</sender_email_identity>9 <email_template>contacts_customemail_email_template</email_template>10 </customemail>11 </contacts>12</default>
  7. 7. ConfigurationOnce uploaded you need to set the custom email template to the new form: System >Configuration > Contacts.
  8. 8. If you leave the config.xml settings as default you will be able to go toyourdomain.com/custom-contacts to view your form. It will look identical to thenormal contact form. Now you can add as many extra fields as you want to thetemplate file without effecting the standard contact form. It can be found in thebase/default theme at customcontacts/form.
  9. 9. KGN Technologies is a one-stop solution for any of your Magento ecommerce webdevelopment requirements. Our team of expert Magento developers is well trained andcapable to develop most complex Magento websites. We can convert PSDs to pixel perfectMagento theme including developing Responsive Magento websites, custom Magentodevelopment, Integrating third party Systems with Magento, Payment Gatewayimplementation, maintenance and support work.Please contact us to know more about our price, examples and hiring models. We have agood strong portfolio to share and proven offshore Magento development methodologywhich can help you in reduction of development cost.Contact details :Email_id : info@kgntechnologies.comWebsite : www.kgntechnologies.com