naoufels Posted April 19, 2013 Share Posted April 19, 2013 je suis debutant au prestashop 1.5.3 et je veux ajouter 4 nouvels champs au formulaire contact form , mais mon problème c'est que le contenu de ces 4 champs ne sont pas envoyés dans le mail. comment je peux récupérer ces 4 champs dans le mail ? j'ai ajouté les 4 champs dans ContactController.php : $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->errors[] = Tools::displayError('Invalid e-mail address'); else if (!$message) $this->errors[] = Tools::displayError('Message cannot be blank'); else if (!Validate::isCleanHtml($message)) $this->errors[] = Tools::displayError('Invalid message'); else if (!($id_contact = (int)(Tools::getValue('id_contact'))) || !(Validate::isLoadedObject($contact = new Contact($id_contact, $this->context->language->id)))) $this->errors[] = Tools::displayError('Please select a subject from the list.'); else if (!empty($_FILES['fileUpload']['name']) && $_FILES['fileUpload']['error'] != 0) $this->errors[] = Tools::displayError('An error occurred during the file upload'); else if (!empty($_FILES['fileUpload']['name']) && !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) && !in_array(substr($_FILES['fileUpload']['name'], -5), $extension)) $this->errors[] = Tools::displayError('Bad file extension'); ///////////////////////////////////////////////////////////////////////////////// la nouvelle partie ajouté /////// elseif (!($companyname = nl2br2(Tools::getValue('companyname')))) $errors[] = Tools::displayError('Comapny name cannot be blank'); elseif (!($contactperson = nl2br2(Tools::getValue('contactperson')))) $errors[] = Tools::displayError('Contact Person cannot be blank'); elseif (!($phonenumber = nl2br2(Tools::getValue('phonenumber')))) $errors[] = Tools::displayError('Phone Number cannot be blank'); elseif (!($country = nl2br2(Tools::getValue('country')))) $errors[] = Tools::displayError('Country cannot be blank'); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// else mais je ne sais pas où modifier d'autres pour que ces 4 valeurs seront prises au sein du mail. je serai reconnaissant pour votre aide. ContactController.php Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now