Jump to content

Formulaire de contact n'envoie pas l'id de la commande


Recommended Posts

Bonjour,

 

Lorsque l'on rempli le formulaire de contact et que l'on saisit le numéro de commande dans le champs prévu pour, celui-ci n'est pas envoyé par mail.

De même lorsque l'on est connecté et que l'on choisi le numéro de commande et/ou le produit concerné dans a liste déroulante, ceux ci ne sont pas envoyé par mail.

Je suppose qu'il y a des variables à passer dans les traductions des mails mais quelles variables ?

 

Merci par avance

 

PS j'utilise la version 1.4.7.3 de prestashop

Link to comment
Share on other sites

  • 2 weeks later...

Pas de réponses, je suis étonné d'être seul avec ce problème, merci quand même je vais encore faire quelques essais avant de supprimer ce champs définitivement, mieux vaut ne pas mettre de camps numéro de commande que d'en mettre un que l'on ne reçoit pas.

Link to comment
Share on other sites

  • 2 weeks later...

Bonjour,

 

J'ai rencontré le même problème et je confirme que ce bug est présent sur la version 1.4.8.2 de Prestashop.

 

Je peux vous proposer une solution asssez simple.

Il suffit tout d'habord d'ouvrir le fichier controllers/ContactController.php

Ensuite, de rechercher le code suivant (je ne peux pas vous fournir les numéros de ligne ayant fait de trop nombreuses modifs)

 

Mail::Send((int)self::$cookie->id_lang, 'contact' 

 

C'est cette fonction qui permet l'envoi de l'email aux contacts concernés.

Il faut ajouter aux paramêtre de cette fonction l'affectation des 2 variables concernées (id_order & id_product)

Cela se fait au niveau du tableau associatif de la manière suivante:

array('{company}' => $company,
'{name}' => $name,
  '{email}' => $from,
  '{id_order}' => $id_order,
  '{id_product}' => $id_product,
  '{message}' => stripslashes($message)),

 

Juste avant cette fonction il faut récupérer les valeurs postées en ajoutant ce code:

 

$id_order = Tools::getValue('id_order');
$id_product = Tools::getValue('id_product');

 

 

Ensuite il faut ouvrir le template du mail pour y ajouter nos 2 variables => mails/fr/contact.html

 

Numéro de commande: {id_order}
Référence Produit: {id_product}

 

Ne maitrisant pas encore parfaitement Prestashop, je ne garrantie pas que cette solution soit optimisée, mais elle a le mérite de fonctionner.

 

J'espère que ce Post vous aura permis de rétablir les numéros de commande & produits à votre formulaire.

 

Pour info, j'ai trouvé de l'aide via le tutoriel suivant: http://www.devoox.com/prestashop-nouveaux-champs-page-contact.html car j'avai besoin de personnaliser le formulaire de contact de mon client.

Edited by ous92 (see edit history)
Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

Salut à tous, 

 

Je remonte le post parce que j'ai un gros souci

 

Impossible à faire fonctionner. 

 

J'ai pourtant tout fait correctement mais ça ne fonctionne pas. 

 

D'où peut venir l'erreur ?

 

Voici le mail que je reçoit : 

 

Commande N° : {id_order} Produit : {id_product}   Adresse électronique : essai26716553@hotmail.fr

Message:

essai 
Link to comment
Share on other sites

J'ai eu ce soucis les prestashopeurs !

 

Je l'ai resolu en revoyant mes modules dont un nécessitait un overide manuel.

Donc je vous conseil de revoir le PDF, DOC, TXT souvent present dans les fichiers source des modules non natifs.

Link to comment
Share on other sites

Au cas où si quelqu'un voit quelque chose qui cloche dans mes fichiers parce que je vais me pendre tellement je déprime à force de chercher et de tomber régulièrement sur les mêmes pages que j'ai lues en long, en large et en travers !

 

ContactController.php :

<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2011 PrestaShop SA
*  @version  Release: $Revision: 7197 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

class ContactControllerCore extends FrontController
{
	public $php_self = 'contact-form.php';
	public $ssl = true;

	public function preProcess()
	{
		parent::preProcess();

		if (self::$cookie->isLogged())
		{
			self::$smarty->assign('isLogged', 1);
			$customer = new Customer((int)(self::$cookie->id_customer));
			if (!Validate::isLoadedObject($customer))
				die(Tools::displayError('Customer not found'));
			$products = array();
			$orders = array();
			$getOrders = Db::getInstance()->ExecuteS('
				SELECT id_order
				FROM '._DB_PREFIX_.'orders
				WHERE id_customer = '.(int)$customer->id.' ORDER BY date_add');
			foreach ($getOrders as $row)
			{
				$order = new Order($row['id_order']);
				$date = explode(' ', $order->date_add);
				$orders[$row['id_order']] = Tools::displayDate($date[0], self::$cookie->id_lang);
				$tmp = $order->getProducts();
				foreach ($tmp as $key => $val)
					$products[$val['product_id']] = $val['product_name'];
			}

			$orderList = '';
			foreach ($orders as $key => $val)
				$orderList .= '<option value="'.$key.'" '.((int)(Tools::getValue('id_order')) == $key ? 'selected' : '').' >'.$key.' -- '.$val.'</option>';
			$orderedProductList = '';

			foreach ($products as $key => $val)
				$orderedProductList .= '<option value="'.$key.'" '.((int)(Tools::getValue('id_product')) == $key ? 'selected' : '').' >'.$val.'</option>';
			self::$smarty->assign('orderList', $orderList);
			self::$smarty->assign('orderedProductList', $orderedProductList);
		}

		if (Tools::isSubmit('submitMessage'))
		{
			$fileAttachment = NULL;
			if (isset($_FILES['fileUpload']['name']) AND !empty($_FILES['fileUpload']['name']) AND !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::htmlentitiesUTF8(Tools::getValue('message'));
			if (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from))
				$this->errors[] = Tools::displayError('Invalid e-mail address');
			elseif (!($message = nl2br2($message)))
				$this->errors[] = Tools::displayError('Message cannot be blank');
			elseif (!Validate::isCleanHtml($message))
				$this->errors[] = Tools::displayError('Invalid message');
			elseif (!($id_contact = (int)(Tools::getValue('id_contact'))) OR !(Validate::isLoadedObject($contact = new Contact((int)($id_contact), (int)(self::$cookie->id_lang)))))
				$this->errors[] = Tools::displayError('Please select a subject on the list.');
			elseif (!empty($_FILES['fileUpload']['name']) AND $_FILES['fileUpload']['error'] != 0)
				$this->errors[] = Tools::displayError('An error occurred during the file upload');
			elseif (!empty($_FILES['fileUpload']['name']) AND !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) AND !in_array(substr($_FILES['fileUpload']['name'], -5), $extension))
				$this->errors[] = Tools::displayError('Bad file extension');
			else
			{
				if ((int)(self::$cookie->id_customer))
					$customer = new Customer((int)(self::$cookie->id_customer));
				else
				{
					$customer = new Customer();
					$customer->getByEmail($from);
				}

				$contact = new Contact($id_contact, self::$cookie->id_lang);

				if (!((
						$id_customer_thread = (int)Tools::getValue('id_customer_thread')
						AND (int)Db::getInstance()->getValue('
						SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm
						WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND token = \''.pSQL(Tools::getValue('token')).'\'')
					) OR (
						$id_customer_thread = (int)Db::getInstance()->getValue('
						SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm
						WHERE cm.email = \''.pSQL($from).'\' AND cm.id_order = '.(int)(Tools::getValue('id_order')).'')
					)))
				{
					$fields = Db::getInstance()->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 ('.
						($customer->id ? 'id_customer = '.(int)($customer->id).' OR ' : '').'
						id_order = '.(int)(Tools::getValue('id_order')).')');
					$score = 0;
					foreach ($fields as $key => $row)
					{
						$tmp = 0;
						if ((int)$row['id_customer'] AND $row['id_customer'] != $customer->id AND $row['email'] != $from)
							continue;
						if ($row['id_order'] != 0 AND 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 AND $row['id_product'] ==  Tools::getValue('id_product'))
							$tmp += 2;
						if ($tmp >= 5 AND $tmp >= $score)
						{
							$score = $tmp;
							$id_customer_thread = $row['id_customer_thread'];
						}
					}
				}
				$old_message = Db::getInstance()->getValue('
					SELECT cm.message FROM '._DB_PREFIX_.'customer_message cm
					WHERE cm.id_customer_thread = '.(int)($id_customer_thread).'
					ORDER BY date_add DESC');
				if ($old_message == htmlentities($message, ENT_COMPAT, 'UTF-8'))
				{
					self::$smarty->assign('alreadySent', 1);
					$contact->email = '';
					$contact->customer_service = 0;
				}
				if (!empty($contact->email))
				{
					if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{company}' => $company, '{name}' => $name, '{email}' => $from, '{id_order}' => $id_order, '{id_product}' => $id_product, '{message}' => stripslashes($message)),
						AND Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from))
						self::$smarty->assign('confirmation', 1);
					else
						$this->errors[] = Tools::displayError('An error occurred while sending message.');
				}

				if ($contact->customer_service)
				{
					if ((int)$id_customer_thread)
					{
						$ct = new CustomerThread($id_customer_thread);
						$ct->status = 'open';
						$ct->id_lang = (int)self::$cookie->id_lang;
						$ct->id_contact = (int)($id_contact);
						if ($id_order = (int)Tools::getValue('id_order'))
							$ct->id_order = $id_order;
						if ($id_product = (int)Tools::getValue('id_product'))
							$ct->id_product = $id_product;
						$ct->update();
					}
					else
					{
						$ct = new CustomerThread();
						if (isset($customer->id))
							$ct->id_customer = (int)($customer->id);
						if ($id_order = (int)Tools::getValue('id_order'))
							$ct->id_order = $id_order;
						if ($id_product = (int)Tools::getValue('id_product'))
							$ct->id_product = $id_product;
						$ct->id_contact = (int)($id_contact);
						$ct->id_lang = (int)self::$cookie->id_lang;
						$ct->email = $from;
						$ct->status = 'open';
						$ct->token = Tools::passwdGen(12);
						$ct->add();
					}

					if ($ct->id)
					{
						$cm = new CustomerMessage();
						$cm->id_customer_thread = $ct->id;
						$cm->message = htmlentities($message, ENT_COMPAT, 'UTF-8');
						if (isset($filename) AND rename($_FILES['fileUpload']['tmp_name'], _PS_MODULE_DIR_.'../upload/'.$filename))
							$cm->file_name = $filename;
						$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
						$cm->user_agent = $_SERVER['HTTP_USER_AGENT'];
						if ($cm->add())
						{
							if (empty($contact->email))
								Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from);
							self::$smarty->assign('confirmation', 1);
						}
						else
							$this->errors[] = Tools::displayError('An error occurred while sending message.');
					}
					else
						$this->errors[] = Tools::displayError('An error occurred while sending message.');
				}
				if (count($this->errors) > 1)
					array_unique($this->errors);
			}
		}
	}

	public function setMedia()
	{
		parent::setMedia();
		Tools::addCSS(_THEME_CSS_DIR_.'contact-form.css');
	}

	public function process()
	{
		parent::process();

		$email = Tools::safeOutput(Tools::getValue('from', ((isset(self::$cookie) AND isset(self::$cookie->email) AND Validate::isEmail(self::$cookie->email)) ? self::$cookie->email : '')));
		self::$smarty->assign(array(
			'errors' => $this->errors,
			'email' => $email,
			'fileupload' => Configuration::get('PS_CUSTOMER_SERVICE_FILE_UPLOAD')
		));


		if ($id_customer_thread = (int)Tools::getValue('id_customer_thread') AND $token = Tools::getValue('token'))
		{
			$customerThread = Db::getInstance()->getRow('
			SELECT cm.* FROM '._DB_PREFIX_.'customer_thread cm
			WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND token = \''.pSQL($token).'\'');
			self::$smarty->assign('customerThread', $customerThread);
		}

		self::$smarty->assign(array('contacts' => Contact::getContacts((int)(self::$cookie->id_lang)),
		'message' => html_entity_decode(Tools::getValue('message'))
		));
	}

	public function displayContent()
	{
		$_POST = array_merge($_POST, $_GET);
		parent::displayContent();
		self::$smarty->display(_PS_THEME_DIR_.'contact-form.tpl');
	}
}

contact-form.tpl :

{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2011 PrestaShop SA
*  @version  Release: $Revision: 1.4 $
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

{capture name=path}{l s='Contact'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}

<h1>{l s='Customer Service'} - {if isset($customerThread) && $customerThread}{l s='Your reply'}{else}{l s='Contact us'}{/if}</h1>

{if isset($confirmation)}
	<p>{l s='Your message has been successfully sent to our team.'}</p>
	<ul class="footer_links">
		<li><a href="{$base_dir}"><img class="icon" alt="" src="{$img_dir}icon/home.gif"/></a><a href="{$base_dir}">{l s='Home'}</a></li>
	</ul>
{elseif isset($alreadySent)}
	<p>{l s='Your message has already been sent.'}</p>
	<ul class="footer_links">
		<li><a href="{$base_dir}"><img class="icon" alt="" src="{$img_dir}icon/home.gif"/></a><a href="{$base_dir}">{l s='Home'}</a></li>
	</ul>
{else}
	<p class="bold">{l s='For questions about an order or for more information about our products'}.</p>
	{include file="$tpl_dir./errors.tpl"}
	<form action="{$request_uri|escape:'htmlall':'UTF-8'}" method="post" class="std" enctype="multipart/form-data">
		<fieldset>
			<h3>{l s='Send a message'}</h3>
			<p class="select">
				<label for="id_contact">{l s='Subject Heading'}</label>
			{if isset($customerThread.id_contact)}
				{foreach from=$contacts item=contact}
					{if $contact.id_contact == $customerThread.id_contact}
						<input type="text" id="contact_name" name="contact_name" value="{$contact.name|escape:'htmlall':'UTF-8'}" readonly="readonly" />
						<input type="hidden" name="id_contact" value="{$contact.id_contact}" />
					{/if}
				{/foreach}
			</p>
			{else}
				<select id="id_contact" name="id_contact" onchange="showElemFromSelect('id_contact', 'desc_contact')">
					<option value="0">{l s='-- Choose --'}</option>
				{foreach from=$contacts item=contact}
					<option value="{$contact.id_contact|intval}" {if isset($smarty.post.id_contact) && $smarty.post.id_contact == $contact.id_contact}selected="selected"{/if}>{$contact.name|escape:'htmlall':'UTF-8'}</option>
				{/foreach}
				</select>
			</p>
			<p id="desc_contact0" class="desc_contact"> </p>
				{foreach from=$contacts item=contact}
					<p id="desc_contact{$contact.id_contact|intval}" class="desc_contact" style="display:none;">
						<label> </label>{$contact.description|escape:'htmlall':'UTF-8'}
					</p>
				{/foreach}
			{/if}
			<p class="text">
				<label for="email">{l s='E-mail address'}</label>
				{if isset($customerThread.email)}
					<input type="text" id="email" name="from" value="{$customerThread.email}" readonly="readonly" />
				{else}
					<input type="text" id="email" name="from" value="{$email}" />
				{/if}
			</p>
			<p class="text">
				<label for="id_order">Commande N°</label>
				<input type="text" id="id_order" name="id_order" value="" />
			</p>
			<p class="text">
				<label for="id_product">Produit</label>
				<input type="text" id="id_product" name="id_product" value=""/>
			</p>
		{if !$PS_CATALOG_MODE}
			{if (!isset($customerThread.id_order) || $customerThread.id_order > 0)}
			<p class="text">
				<label for="id_order">{l s='Order ID'}</label>
				{if !isset($customerThread.id_order) && isset($isLogged) && $isLogged == 1}
					<select name="id_order" ><option value="0">{l s='-- Choose --'}</option>{$orderList}</select>
				{elseif !isset($customerThread.id_order) && !isset($isLogged)}
					<input type="text" name="id_order" id="id_order" value="{if isset($customerThread.id_order) && $customerThread.id_order > 0}{$customerThread.id_order|intval}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|intval}{/if}{/if}" />
				{elseif $customerThread.id_order > 0}
					<input type="text" name="id_order" id="id_order" value="{$customerThread.id_order|intval}" readonly="readonly" />
				{/if}
			</p>
			{/if}
			{if isset($isLogged) && $isLogged}
			<p class="text">
			<label for="id_product">{l s='Product'}</label>
				{if !isset($customerThread.id_product)}
					<select name="id_product" style="width:300px;"><option value="0">{l s='-- Choose --'}</option>{$orderedProductList}</select>
				{elseif $customerThread.id_product > 0}
					<input type="text" name="id_product" id="id_product" value="{$customerThread.id_product|intval}" readonly="readonly" />
				{/if}
			</p>
			{/if}
		{/if}
		{if $fileupload == 1}
			<p class="text">
			<label for="fileUpload">{l s='Attach File'}</label>
				<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
				<input type="file" name="fileUpload" id="fileUpload" />
			</p>
		{/if}
		<p class="textarea">
			<label for="message">{l s='Message'}</label>
			 <textarea id="message" name="message" rows="15" cols="20" style="width:340px;height:220px">{if isset($message)}{$message|escape:'htmlall':'UTF-8'|stripslashes}{/if}</textarea>
		</p>
		<p class="submit">
			<input type="submit" name="submitMessage" id="submitMessage" value="{l s='Send'}" class="button_large" onclick="$(this).hide();" />
		</p>
	</fieldset>
</form>
{/if}

contact.txt : 

Vous avez reçu un message de la part d'un client depuis votre boutique {shop_name}

Informations

Adresse électronique : {email}

Commande N° : {id_order}

Produit : {id_product}


Message

{message}

{shop_url}

Et contact.html : 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Message de {shop_name}</title>
</head>
<body>
	<table style="font-family:Verdana,sans-serif; font-size:12px; color:#0000aa; width: 550px;">
		<tr>
			<td align="left">
				<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
			</td>
		</tr>
		<tr><td> </td></tr>
		<tr>
			<td align="left" style="background-color:#0091fe; color:#FFF; font-size: 12px; font-weight:bold; padding: 0.5em 1em;">Vous avez reçu un message de la part d'un client depuis votre boutique {shop_name}</td>
		</tr>
		<tr><td>Commande N° : {id_order}</td></tr>
		<tr><td>Produit : {id_product}</td></tr>
		<tr><td> </td></tr>
		<tr>
			<td align="left">
				Adresse électronique : <a href="mailto:{email}"><b>{email}</b></a>
				<br><br>
				Message: 								<br /><br />								{message}
			</td>
		</tr>
		<tr><td> </td></tr>
		<tr>
			<td align="center" style="font-size:10px; border-top: 5px solid #D9DADE;">
				<a href="{shop_url}" style="color:#0091fe; font-weight:bold; text-decoration:none;">{shop_name} : Votre partenaire pour votre éducation canine !</a>
			</td>
		</tr>
	</table>
</body>
</html>
Link to comment
Share on other sites

  • 3 weeks later...

coucou

 

 je viens de faire un test le message est bien parti et j'ai bien reçu en tant que client l'email avec mon message

 

regarde en BO dans le SAV si tu as les données

 

commande  : 12345

produits  :33-automatique-munis-de-5-niveaux

Numéro de commande 54321

Message test formulaire de contact

tu peut supprimer les ligne 81 a 84 dans theme_ton_theme/contact-form.tpl

<p class="text">
<label for="id_order">Commande N°</label>
<input type="text" id="id_order" name="id_order" value="" />
</p> 

et donc en rédigeant ce message je remarque que tu as 2 fois le N° de commande dans le tpl

 

@++

 

Loulou66

 

Link to comment
Share on other sites

  • 3 weeks later...

Salut Loulou66, 

 

Désolé, je n'avais pas vu que tu m'avais répondu, je viens de le voir en voulant relancer le topic. 

 

Voici le mail que j'avais reçu dans ma boite de messagerie : 

 

Commande N° : {id_order} Produit : {id_product}   Adresse électronique : [email protected]

Message:

test formulaire de contact 

 

 

Ce qui est bizarre, c'est que j'ai bien reçu les numéro dans l'onglet SAV ! : 

 

Envoyé le 17-05-2014 20:18:25
Navigateur Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36
Commande numéro 52143 search.gif
Produit numéro 33 search.gif
 

Sujet Partenariat / RéférencementSAV / Support TechniqueService ClientsWebmaster

ID discussion 243
ID message 282
Message
test formulaire de contact

 

 

Je viens de supprimer les lignes comme tu me l'a suggéré et vient de faire des tests qui n'a pas résolu le problème. 

 

 

As-tu une autre piste ?

 

Merci de ton aide.  

Edited by fredekac (see edit history)
Link to comment
Share on other sites

coucou

 

coter clients il y a toujours 2 fois le numéro de commande( vides les caches smarty et navigateur peut être)

 

peut tu éditer ton post précédent et mettre des XXX dans l'adresse email pour que les robot ne récupère pas mon adresse stp :P

 

on va forcer le 2 variables dans la fonction submit

dans le ContactController.php

apres la ligne 155
if (!empty($contact->email))
{
ajoutes ces 2 lignes
$id_order =  Tools::getValue('id_order');
$id_product = Tools::getValue('id_product');					

@++

 

Loulou66

Link to comment
Share on other sites

  • 3 weeks later...

Mince, excuses-moi pour l'adresse, je pensait qu'elle était fictive. 

 

Je te remercie de ta réponse. 

 

Je ne comprend pas pourquoi il ne me préviens pas puisque je suis en Follow pourtant !

 

Je vais faire la manip ce WE et je te tiens au courant. 

Edited by fredekac (see edit history)
Link to comment
Share on other sites

Salut Loulou66, 

 

Alors j'ai bien modifié le fichier, vidé les donnes du navigateur, désactiver le cache et forcé la compilation puis fait un test... ça ne fonctionne pas  :(

 

De la ligne 154 à 160 du fichier ContactController.php j'ai : 

				if (!empty($contact->email))
				{
					$id_order =  Tools::getValue('id_order');
					$id_product = Tools::getValue('id_product');	
					if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment)
						AND Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from))
						self::$smarty->assign('confirmation', 1);

Edited by fredekac (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...