Jump to content

Formulario Contacto en CMS: Cómo Agregar campos


Recommended Posts

  • 6 months later...
  • 3 weeks later...

Deberias revisar pues, el contact form normal, y comprobar que el controlador del formulario que se encarga de ejecutarlo recoge los mismos valores que ahí se postean.

 

¿Es posible que lo hayais bajado y sea para alguna version vieja de ps? Suele pasar... no es normal que algo tan sencillo simplemente no vaya.

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

Aquí: http://www.prestasho...post__p__653131 tienes una mini guía básica creada por el usuario clearvuecyclones, que os servirá, para poder saber como añadir campos nuevos y que se reciben por correo en el formulario de contacto.

 

I have successfully added a name field to the contact form in PrestaShop 1.4.4.0. I edited these files:

----controllers\contactcontoller.php (this should go in the override\controllers folder when complete)

----mails\en\contact.txt

----mails\en\contact.html

----themes\yourtheme\contact-form.tpl

 

contact-form.tpl

<p class="text">
 <label for="name">{l s='Name'}</label>
 {if isset($customerThread.name)}
<input type="text" id="name" name="fromname" value="{$customerThread.name}" readonly="readonly" />
 {else}
<input type="text" id="name" name="fromname" value="{$name}" />
 {/if}
</p>

 

contactcontroller.php

Line 82: (validate Name field is filled in)

if (!($fromname = trim(Tools::getValue('fromname'))) OR (!($fromname = nl2br2($fromname))))
$this->errors[] = Tools::displayError('Contact Name cannot be blank');
elseif (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from))
$this->errors[] = Tools::displayError('Invalid e-mail address');

 

Line 156 (orig) (send fromName as array parm and as name in Mail header)

if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{email}' => $from, '{message}' => stripslashes($message),'{fromName}' => stripslashes($fromname)), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $fromname), $fileAttachment)

 

Line 208 (orig)

if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{email}' => $from, '{message}' => stripslashes($message),'{fromName}' => stripslashes($fromname)), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $fromname), $fileAttachment)

 

contact.html

Line 18

<TR>
<TD align=left>Name: <STRONG>{fromName}</STRONG> <BR></TD></TR>

 

contact.txt (added at Line 5)

Name: {fromName}

 

I hope this helps someone else.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...