ruisonika Posted April 6, 2021 Share Posted April 6, 2021 (edited) Hello guys, By any chance does anybody knows how to add fistname and lastname in email generated by customer support. My store is with prestashop 1.6 and all customers are registered... in customer support email (contact-us) only gives customer email. Thanks in advance. Edited April 7, 2021 by ruisonika (see edit history) Link to comment Share on other sites More sharing options...
ruisonika Posted April 7, 2021 Author Share Posted April 7, 2021 Hello i found it and i wanna share for someone who needs it. In ContactController.php around 169 line after if ($contact->customer_service) { code inside and when it ends} here add the query you and for example let's find firstname. $var = (int)$customer->id; $sql = " SELECT firstname FROM ps_customer WHERE id_customer = $var "; $nome = Db::getInstance()->ExecuteS($sql); Then few lines down, if (!count($this->errors)) { $var_list = array( '{order_name}' => '-', '{attached_file}' => '-', '{message}' => Tools::nl2br(stripslashes($message)), '{email}' => $from, '{firstname}' => $nome, '{product_name}' => '', ); And in backoffice translate contact email and add the field {firstname} in the place you want. That's all! Link to comment Share on other sites More sharing options...
calgaryx Posted November 25, 2024 Share Posted November 25, 2024 Hi there. Where exactly is ContactController.php is located? I found one in /controllers/front/ContactController.php But i can not find those lines? Thanks ------------------------------------- class ContactControllerCore extends FrontController { /** @var string */ public $php_self = 'contact'; /** @var bool */ public $ssl = true; /** * Assign template vars related to page content. * * @see FrontController::initContent() */ public function initContent() { parent::initContent(); $this->setTemplate('contact'); } public function getBreadcrumbLinks() { $breadcrumb = parent::getBreadcrumbLinks(); $breadcrumb['links'][] = [ 'title' => $this->getTranslator()->trans('Contact us', [], 'Shop.Theme.Global'), 'url' => $this->context->link->getPageLink('contact'), ]; return $breadcrumb; } /** * {@inheritdoc} */ public function getCanonicalURL() { return $this->context->link->getPageLink('contact'); } } 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