Jump to content

Contact Form Fields


SliderFlash

Recommended Posts

Hi,

sorry I misread the post.

Example of how to add a message to a template.

1. go to admin -> International -> Translations

2. Modify translations

Type of translation -> Email translations

Select the type of email content -> Body

Select your theme -> your theme

Select your language -> your language

3. find Core emails -> contact_form

4. edit -> add {message}

5. Repeat the process for all languages

obrazek.thumb.png.29e73ea40666dd0b1f6ea86f88b71ab5.png

6. go to ./modules/contactform/contactform.php

7. comment this line

$var_list['{message}'] = self::MESSAGE_PLACEHOLDER_FOR_OLDER_VERSION;

to

// $var_list['{message}'] = self::MESSAGE_PLACEHOLDER_FOR_OLDER_VERSION;

8. save

9. clear cache

Edited by prestashopfree.com (see edit history)
Link to comment
Share on other sites

Example of how to add the subject of the message to the template?

1. edit ./modules/contactform/contactform.php

2. find $var_list = [

$var_list = [
	'{firstname}' => '',
	'{lastname}' => '',
	'{order_name}' => '-',
	'{attached_file}' => '-',
	'{message}' => Tools::nl2br(Tools::htmlentitiesUTF8(Tools::stripslashes($message))),
	'{email}' =>  $from,
	'{product_name}' => '',
];

3. add after custom vars

$var_list = [
	'{firstname}' => '',
	'{lastname}' => '',
	'{order_name}' => '-',
	'{attached_file}' => '-',
	'{message}' => Tools::nl2br(Tools::htmlentitiesUTF8(Tools::stripslashes($message))),
	'{email}' =>  $from,
	'{product_name}' => '',
];

$subject = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'contact_lang WHERE id_lang = '.(int)$this->context->language->id.' AND id_subject = '.(int)$id_contact);

$var_list['{subject_name}'] = $subject['name'];
$var_list['{subject_description}'] = $subject['description'];

4. save

5. modify email template contact_form

6. add {subject_name} or {subject_description}

 

And this way you can play with the template and parameters indefinitely 😄

 

Edited by prestashopfree.com (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...