<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NemoPS &#187; contact form</title>
	<atom:link href="http://nemops.com/tag/contact-form/feed/" rel="self" type="application/rss+xml" />
	<link>http://nemops.com</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Wed, 05 Dec 2018 13:25:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>Adding new fields to the Prestashop contact form</title>
		<link>http://nemops.com/adding-new-fields-to-prestashop-contact-form/</link>
		<comments>http://nemops.com/adding-new-fields-to-prestashop-contact-form/#comments</comments>
		<pubDate>Mon, 29 Jul 2013 08:26:30 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1437</guid>
		<description><![CDATA[<p>In this tutorial, we will see how to enhance the default Prestashop contact form by adding new fields, so that it can accommodate all our needs (present and future). Introduction Adding new fields to the Prestashop contact form is by far a lot harder than simply throwing new inputs in the form itself. With that [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://nemops.com/adding-new-fields-to-prestashop-contact-form/">Adding new fields to the Prestashop contact form</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this tutorial, we will see how to enhance the default Prestashop contact form by adding new fields, so that it can accommodate all our needs (present and future).</p>
<p><span id="more-1437"></span></p>
<h2>Introduction</h2>
<p>Adding new fields to the Prestashop contact form is by far a lot harder than simply throwing new inputs in the form itself. With that only, these fields would never be actually added to the thread in the database. In order to do this properly, we need to edit:</p>
<ul>
<li>The contact-form.tpl template file, located in the theme folder</li>
<li>The database, to add the new field</li>
<li>The CustomerThread class (we will use an ovveride for it)</li>
<li>ContactController.php, to retrieve new data from the form</li>
<li>Message.tpl template file for the back office, to ensure new data is shown to employees as well!</li>
</ul>
<p>&nbsp;</p>
<div class="separator"></div>
<h2>Step 1 &#8211; The contact form</h2>
<p>Let’s get started by editing the actual contact form. Reach your theme’s folder and open up contact-form.tpl. There is no mandatory place to add the new field to (as long as it is inside the form); I will do it right above the message textarea. As always, I am using the default theme.</p>
<p>Locate the following code (might be different if you are using a custom theme):</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
&lt;p class=&quot;textarea&quot;&gt;
	&lt;label for=&quot;message&quot;&gt;{l s='Message'}&lt;/label&gt;
	&lt;textarea id=&quot;message&quot; name=&quot;message&quot; rows=&quot;15&quot; cols=&quot;10&quot;&gt;{if isset($message)}{$message|escape:'htmlall':'UTF-8'|stripslashes}{/if}&lt;/textarea&gt;
&lt;/p&gt;
</pre>
<p>Right <strong>before this</strong>, add:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
&lt;p class=&quot;text&quot;&gt;
	&lt;label for=&quot;extrafield&quot;&gt;{l s='Extra field'}&lt;/label&gt;
	{if isset($customerThread.extrafield)}
		&lt;input type=&quot;text&quot; id=&quot;extrafield&quot; name=&quot;extrafield&quot; value=&quot;{$customerThread.extrafield|escape:'htmlall':'UTF-8'}&quot; readonly=&quot;readonly&quot; /&gt;
	{else}
		&lt;input type=&quot;text&quot; id=&quot;extrafield&quot; name=&quot;extrafield&quot; value=&quot;&quot; /&gt;
	{/if}
&lt;/p&gt;		
</pre>
<p>And our new field is there. Of course, it can be anything, form a custom select box, to a radio button, textarea, etc. I chose a text input.</p>
<p>The field is there, but our database doesn&#8217;t know. Let&#8217;s tell it! Login to the database using your favorite tool (my choice is always phpMyAdmin).Locate the <strong>ps_customer_thread</strong> table (as always, your prefix might be other than <em>ps_</em>).</p>
<p>Add a new TEXT column with no limitations. Again, if you chose something other than a text input, like a radio or checkbox, you might want to use TINYINT instead, to add only 1 or 0.</p>
<p>
<strong>HEY! Why aren&#8217;t we doing this for the ps_customer_message?</strong><br/><br />
Because I chose to add one single value for the whole thread. In this tutorial I will cover how to add fields to the thread, not single messages. But no fear, the process is quite similar, requiring you to edit the CustomerMessage class instead, and relative table.
</p>
<div class="separator"></div>
<h2>Step 2 &#8211; Class and Controller</h2>
<p>Our new field is there, ready to be filled in, and so is the database column. But the CustomerThread object doesn&#8217;t know about the new field, so, we need to setup a <strong>class override</strong> to account for the new field.</p>
<p>Go to <em>override/classes/</em> and create a new file called <strong>CustomerThread.php</strong>. Open it up and fill it with the following code:</p>
<pre class="brush: php; title: ; notranslate">


&lt;?php

class CustomerThread extends CustomerThreadCore
{
    public $extrafield;

	public static $definition = array(
		'table' =&gt; 'customer_thread',
		'primary' =&gt; 'id_customer_thread',
		'fields' =&gt; array(
			'id_lang' =&gt; 	array('type' =&gt; self::TYPE_INT, 'validate' =&gt; 'isUnsignedId', 'required' =&gt; true),
			'id_contact' =&gt; array('type' =&gt; self::TYPE_INT, 'validate' =&gt; 'isUnsignedId', 'required' =&gt; true),
			'id_shop' =&gt; 	array('type' =&gt; self::TYPE_INT, 'validate' =&gt; 'isUnsignedId'),
			'id_customer' =&gt;array('type' =&gt; self::TYPE_INT, 'validate' =&gt; 'isUnsignedId'),
			'id_order' =&gt; 	array('type' =&gt; self::TYPE_INT, 'validate' =&gt; 'isUnsignedId'),
			'id_product' =&gt; array('type' =&gt; self::TYPE_INT, 'validate' =&gt; 'isUnsignedId'),
			'email' =&gt; 		array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isEmail', 'size' =&gt; 254),
			'token' =&gt; 		array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isGenericName', 'required' =&gt; true),
			'status' =&gt; 	array('type' =&gt; self::TYPE_STRING),
			'date_add' =&gt; 	array('type' =&gt; self::TYPE_DATE, 'validate' =&gt; 'isDate'),
			'date_upd' =&gt; 	array('type' =&gt; self::TYPE_DATE, 'validate' =&gt; 'isDate'),
			'extrafield' =&gt; 	array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isGenericName'),
		),
	);


}

</pre>
<p><strong>TIP: </strong>If you are new to overrides, you might want to have a look at my other tutorial on <a href="http://nemops.com/extending-prestashop-objects/" title="how to extend Prestashop objects">how to properly extend Prestashop objects</a>.</p>
<p><strong>Explanation:</strong> What we did is a simple redefinition of the fields this objects accept. First, we declared our new extrafield as a public variable, and then added it to the definitions list. We set it as a string type, and a simple generic validation. Be sure you check out the correct type and validation every time you add a new field, or you might end up with unexpected results!</p>
<p>At this point, we also need to amend the controller that is responsible of adding such data and sending out emails. We can do the same, and use an override for this as well, but this time we need to copy and paste a whole method from the original one.</p>
<p>&nbsp;</p>
<p>Go to <em>override/controllers/front/</em> and create a new file named <strong>ContactController.php</strong>, the open up the original file with the same name, located in <em>controllers/front</em>. copy the whole <strong>_postProcess</strong> method and paste it inside the newly created file, so it looks like this:</p>
<pre class="brush: php; title: ; notranslate">


&lt;?php

class ContactController extends ContactControllerCore
{
	public function postProcess()
	{
		if (Tools::isSubmit('submitMessage'))
		{
			$fileAttachment = null;
			if (isset($_FILES['fileUpload']['name']) &amp;&amp; !empty($_FILES['fileUpload']['name']) &amp;&amp; !empty($_FILES['fileUpload']['tmp_name']))
			{
				$extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg');
				$filename = uniqid().substr($_FILES['fileUpload']['name'], -5);
				$fileAttachment['content'] = file_get_contents($_FILES['fileUpload']['tmp_name']);
				$fileAttachment['name'] = $_FILES['fileUpload']['name'];
				$fileAttachment['mime'] = $_FILES['fileUpload']['type'];
			}
			$message = Tools::getValue('message'); // Html entities is not usefull, iscleanHtml check there is no bad html tags.
			if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from))
				$this-&gt;errors[] = Tools::displayError('Invalid email address.');
			else if (!$message)
				$this-&gt;errors[] = Tools::displayError('The message cannot be blank.');
			else if (!Validate::isCleanHtml($message))
				$this-&gt;errors[] = Tools::displayError('Invalid message');
			else if (!($id_contact = (int)(Tools::getValue('id_contact'))) || !(Validate::isLoadedObject($contact = new Contact($id_contact, $this-&gt;context-&gt;language-&gt;id))))
				$this-&gt;errors[] = Tools::displayError('Please select a subject from the list provided. ');
			else if (!empty($_FILES['fileUpload']['name']) &amp;&amp; $_FILES['fileUpload']['error'] != 0)
				$this-&gt;errors[] = Tools::displayError('An error occurred during the file-upload process.');
			else if (!empty($_FILES['fileUpload']['name']) &amp;&amp; !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) &amp;&amp; !in_array(substr($_FILES['fileUpload']['name'], -5), $extension))
				$this-&gt;errors[] = Tools::displayError('Bad file extension');
			else
			{
				$customer = $this-&gt;context-&gt;customer;
				if (!$customer-&gt;id)
					$customer-&gt;getByEmail($from);

				$contact = new Contact($id_contact, $this-&gt;context-&gt;language-&gt;id);

				if (!((
						($id_customer_thread = (int)Tools::getValue('id_customer_thread'))
						&amp;&amp; (int)Db::getInstance()-&gt;getValue('
						SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm
						WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop = '.(int)$this-&gt;context-&gt;shop-&gt;id.' AND token = \''.pSQL(Tools::getValue('token')).'\'')
					) || (
						$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, (int)Tools::getValue('id_order'))
					)))
				{
					$fields = Db::getInstance()-&gt;executeS('
					SELECT cm.id_customer_thread, cm.id_contact, cm.id_customer, cm.id_order, cm.id_product, cm.email
					FROM '._DB_PREFIX_.'customer_thread cm
					WHERE email = \''.pSQL($from).'\' AND cm.id_shop = '.(int)$this-&gt;context-&gt;shop-&gt;id.' AND ('.
						($customer-&gt;id ? 'id_customer = '.(int)($customer-&gt;id).' OR ' : '').'
						id_order = '.(int)(Tools::getValue('id_order')).')');
					$score = 0;
					foreach ($fields as $key =&gt; $row)
					{
						$tmp = 0;
						if ((int)$row['id_customer'] &amp;&amp; $row['id_customer'] != $customer-&gt;id &amp;&amp; $row['email'] != $from)
							continue;
						if ($row['id_order'] != 0 &amp;&amp; Tools::getValue('id_order') != $row['id_order'])
							continue;
						if ($row['email'] == $from)
							$tmp += 4;
						if ($row['id_contact'] == $id_contact)
							$tmp++;
						if (Tools::getValue('id_product') != 0 &amp;&amp; $row['id_product'] == Tools::getValue('id_product'))
							$tmp += 2;
						if ($tmp &gt;= 5 &amp;&amp; $tmp &gt;= $score)
						{
							$score = $tmp;
							$id_customer_thread = $row['id_customer_thread'];
						}
					}
				}
				$old_message = Db::getInstance()-&gt;getValue('
					SELECT cm.message FROM '._DB_PREFIX_.'customer_message cm
					LEFT JOIN '._DB_PREFIX_.'customer_thread cc on (cm.id_customer_thread = cc.id_customer_thread)
					WHERE cc.id_customer_thread = '.(int)($id_customer_thread).' AND cc.id_shop = '.(int)$this-&gt;context-&gt;shop-&gt;id.'
					ORDER BY cm.date_add DESC');
				if ($old_message == $message)
				{
					$this-&gt;context-&gt;smarty-&gt;assign('alreadySent', 1);
					$contact-&gt;email = '';
					$contact-&gt;customer_service = 0;
				}

				if ($contact-&gt;customer_service)
				{
					if ((int)$id_customer_thread)
					{
						$ct = new CustomerThread($id_customer_thread);
						$ct-&gt;status = 'open';
						$ct-&gt;id_lang = (int)$this-&gt;context-&gt;language-&gt;id;
						$ct-&gt;id_contact = (int)($id_contact);
						if ($id_order = (int)Tools::getValue('id_order'))
							$ct-&gt;id_order = $id_order;
						if ($id_product = (int)Tools::getValue('id_product'))
							$ct-&gt;id_product = $id_product;
						$ct-&gt;update();
					}
					else
					{
						$ct = new CustomerThread();
						if (isset($customer-&gt;id))
							$ct-&gt;id_customer = (int)($customer-&gt;id);
						$ct-&gt;id_shop = (int)$this-&gt;context-&gt;shop-&gt;id;
						if ($id_order = (int)Tools::getValue('id_order'))
							$ct-&gt;id_order = $id_order;
						if ($id_product = (int)Tools::getValue('id_product'))
							$ct-&gt;id_product = $id_product;
						$ct-&gt;id_contact = (int)($id_contact);
						$ct-&gt;id_lang = (int)$this-&gt;context-&gt;language-&gt;id;
						$ct-&gt;email = $from;
						$ct-&gt;status = 'open';
						$ct-&gt;token = Tools::passwdGen(12);

						$ct-&gt;add();
					}

					if ($ct-&gt;id)
					{
						$cm = new CustomerMessage();
						$cm-&gt;id_customer_thread = $ct-&gt;id;
						$cm-&gt;message = Tools::htmlentitiesUTF8($message);
						if (isset($filename) &amp;&amp; rename($_FILES['fileUpload']['tmp_name'], _PS_MODULE_DIR_.'../upload/'.$filename))
							$cm-&gt;file_name = $filename;
						$cm-&gt;ip_address = ip2long($_SERVER['REMOTE_ADDR']);
						$cm-&gt;user_agent = $_SERVER['HTTP_USER_AGENT'];
						if (!$cm-&gt;add())
							$this-&gt;errors[] = Tools::displayError('An error occurred while sending the message.');
					}
					else
						$this-&gt;errors[] = Tools::displayError('An error occurred while sending the message.');
				}

				if (!count($this-&gt;errors))
				{
					$var_list = array(
									'{order_name}' =&gt; '-',
									'{attached_file}' =&gt; '-',
									'{message}' =&gt; Tools::nl2br(stripslashes($message)),
									'{email}' =&gt;  $from,
								);

					if (isset($filename))
						$var_list['{attached_file}'] = $_FILES['fileUpload']['name'];

					$id_order = (int)Tools::getValue('id_order');
					
					if (isset($ct) &amp;&amp; Validate::isLoadedObject($ct))
					{
						if ($ct-&gt;id_order)
							$id_order = $ct-&gt;id_order;
						$subject = sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct-&gt;id, $ct-&gt;token);
					}
					else
						$subject = Mail::l('Your message has been correctly sent');

					if ($id_order)
					{
						$order = new Order((int)$id_order);
						$var_list['{order_name}'] = $order-&gt;getUniqReference();
						$var_list['{id_order}'] = $id_order;
					}
					
					if (empty($contact-&gt;email))
						Mail::Send($this-&gt;context-&gt;language-&gt;id, 'contact_form', $subject, $var_list, $from, null, null, null, $fileAttachment);
					else
					{					
						if (!Mail::Send($this-&gt;context-&gt;language-&gt;id, 'contact', Mail::l('Message from contact form').' [no_sync]',
							$var_list, $contact-&gt;email, $contact-&gt;name, $from, ($customer-&gt;id ? $customer-&gt;firstname.' '.$customer-&gt;lastname : ''),
									$fileAttachment) ||
								!Mail::Send($this-&gt;context-&gt;language-&gt;id, 'contact_form', $subject, $var_list, $from, null, $contact-&gt;email, $contact-&gt;name, $fileAttachment))
									$this-&gt;errors[] = Tools::displayError('An error occurred while sending the message.');
					}
				}
				
				if (count($this-&gt;errors) &gt; 1)
					array_unique($this-&gt;errors);
				else
					$this-&gt;context-&gt;smarty-&gt;assign('confirmation', 1);
			}
		}
	}

}


</pre>
<p>Inside this file, locate the following block of code:</p>
<pre class="brush: php; title: ; notranslate">

if ((int)$id_customer_thread)
{
	$ct = new CustomerThread($id_customer_thread);
	$ct-&gt;status = 'open';
	$ct-&gt;id_lang = (int)$this-&gt;context-&gt;language-&gt;id;
	$ct-&gt;id_contact = (int)($id_contact);
	if ($id_order = (int)Tools::getValue('id_order'))
		$ct-&gt;id_order = $id_order;
	if ($id_product = (int)Tools::getValue('id_product'))
		$ct-&gt;id_product = $id_product;
	$ct-&gt;update();
}
else
{
	$ct = new CustomerThread();
	if (isset($customer-&gt;id))
		$ct-&gt;id_customer = (int)($customer-&gt;id);
	$ct-&gt;id_shop = (int)$this-&gt;context-&gt;shop-&gt;id;
	if ($id_order = (int)Tools::getValue('id_order'))
		$ct-&gt;id_order = $id_order;
	if ($id_product = (int)Tools::getValue('id_product'))
		$ct-&gt;id_product = $id_product;
	$ct-&gt;id_contact = (int)($id_contact);
	$ct-&gt;id_lang = (int)$this-&gt;context-&gt;language-&gt;id;
	$ct-&gt;email = $from;
	$ct-&gt;status = 'open';
	$ct-&gt;token = Tools::passwdGen(12);
	$ct-&gt;add();
}

</pre>
<p>This is responsible for creating new threads, or update current ones. Thus, the first block will update an existing customer thread, whilst the &#8220;else&#8221; one creates a new one. So, let&#8217;s tell the object it has an extrafield in both cases:</p>
<pre class="brush: php; title: ; notranslate">

if ((int)$id_customer_thread)
{
	$ct = new CustomerThread($id_customer_thread);
	$ct-&gt;status = 'open';
	$ct-&gt;id_lang = (int)$this-&gt;context-&gt;language-&gt;id;
	$ct-&gt;id_contact = (int)($id_contact);
	if ($id_order = (int)Tools::getValue('id_order'))
		$ct-&gt;id_order = $id_order;
	if ($id_product = (int)Tools::getValue('id_product'))
		$ct-&gt;id_product = $id_product;
	$ct-&gt;extrafield = Tools::getValue('extrafield');
	$ct-&gt;update();
}
else
{
	$ct = new CustomerThread();
	if (isset($customer-&gt;id))
		$ct-&gt;id_customer = (int)($customer-&gt;id);
	$ct-&gt;id_shop = (int)$this-&gt;context-&gt;shop-&gt;id;
	if ($id_order = (int)Tools::getValue('id_order'))
		$ct-&gt;id_order = $id_order;
	if ($id_product = (int)Tools::getValue('id_product'))
		$ct-&gt;id_product = $id_product;
	$ct-&gt;id_contact = (int)($id_contact);
	$ct-&gt;id_lang = (int)$this-&gt;context-&gt;language-&gt;id;
	$ct-&gt;email = $from;
	$ct-&gt;status = 'open';
	$ct-&gt;token = Tools::passwdGen(12);
	$ct-&gt;extrafield = Tools::getValue('extrafield');
	$ct-&gt;add();
}

</pre>
<p>As you can see, we added <strong>$ct->extrafield = Tools::getValue(&#8216;extrafield&#8217;);</strong> to both cases, just before the entries are inserted or updated.</p>
<p>As a last step, go to <em>cache/</em> in your root folder, and delete <strong>class_index.php</strong> so that our changes take place. Now do a quick test run. If everything went smoothly, you should se the new value appear in the database.</p>
<div class="separator"></div>
<h2>Step 3 &#8211; Adding email variables and back office texts</h2>
<p>We&#8217;re almost there! The system is already working, but it needs to be fine-tuned. First, in the very same <strong>ContactController</strong>, locate this block of code:</p>
<pre class="brush: php; title: ; notranslate">

$var_list = array(
				'{order_name}' =&gt; '-',
				'{attached_file}' =&gt; '-',
				'{message}' =&gt; Tools::nl2br(stripslashes($message)),
				'{email}' =&gt;  $from,

			);

</pre>
<p>These are the variables assigned to both the emails which will be sent out (to the customer and store owner). Let&#8217;s add our variable there!</p>
<pre class="brush: php; title: ; notranslate">

$var_list = array(
				'{order_name}' =&gt; '-',
				'{attached_file}' =&gt; '-',
				'{message}' =&gt; Tools::nl2br(stripslashes($message)),
				'{email}' =&gt;  $from,
				'{extrafield}' =&gt;  (isset($ct) &amp;&amp; $ct-&gt;extrafield) ? $ct-&gt;extrafield : ''
			);

</pre>
<p><strong>Note:</strong> as you can see, we are first checking that the $ct variable is set, as this will not happen if a customer thread already exists!</p>
<p>Lastly, let&#8217;s open up the 2 email templates being sent out: <strong>contact</strong> and <strong>contact_form</strong>. You can find them in the <em>mails/</em> folder, inside one of the subfolder named as your shop&#8217;s languages&#8217; ISOs. FInd a suitable place for the new field and add</p>
<pre class="brush: xml; title: ; notranslate">
Extrafield: &lt;strong&gt;{extrafield}&lt;/strong&gt;
</pre>
<p>Again, run a quick test run to ensure everything works!</p>
<p><img src="http://nemops.com/wp-content/uploads/2013/07/email_with_new_field.jpg" alt="email_with_new_field" width="573" height="261" class="aligncenter size-full wp-image-1449" /></p>
<p>&nbsp;</p>
<p>Now, as a really last step, we will add the field to the back office as well. Again, following the maintainability principle, we will not directly modify the core files, but use overrides.</p>
<p>Go to your admin folder, then <em>themes\default\template\controllers\customer_threads</em>, and copy <strong>message.tpl</strong>. Now back to <em>override/controllers/admin/templates</em>, create a new folder names exactly <strong>customer_threads</strong> and paste message.tpl inside.</p>
<p>As always, feel free to choose any spot to add the new content. I will add it right before this:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
		&lt;dl&gt;
			&lt;dt&gt;{l s='Thread ID:'}&lt;/dt&gt;
			&lt;dd&gt;{$message.id_customer_thread}&lt;/dd&gt;
		&lt;/dl&gt;

</pre>
<p>So, before that, add</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
		&lt;dl&gt;
			&lt;dt&gt;{l s='Extrafield:'}&lt;/dt&gt;
			&lt;dd&gt;{$message.extrafield}&lt;/dd&gt;
		&lt;/dl&gt;

</pre>
<p>Save &#038; reach the admin screen, you should see the new text field appearing!</p>
<div class="separator"></div>
<h2>Conclusion</h2>
<p>As you can see, a lot needs to be done for a simple addition. However, after doing it the first time it will be like second nature! Therefore, next time you&#8217;ll need to add an extra field to the contact form, you&#8217;ll already have most things settled.</p>
<p>The post <a rel="nofollow" href="http://nemops.com/adding-new-fields-to-prestashop-contact-form/">Adding new fields to the Prestashop contact form</a> appeared first on <a rel="nofollow" href="http://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nemops.com/adding-new-fields-to-prestashop-contact-form/feed/</wfw:commentRss>
		<slash:comments>72</slash:comments>
		</item>
	</channel>
</rss>
