Jump to content

[SOLVED]Message in order confirmation? {message}


Recommended Posts

Hi guys, can I ask you please  just simple thing - if customer put note during order process I need this note to be seen in order confirmation. I have put there this {message} but all what I see is only this word but not what customer put there.

 

Where could be issue?

 

Hi guys, can I ask you please  just simple thing - if customer put note during order process I need this note to be seen in order confirmation. I have put there this {message} but all what I see is only this word but not what customer put there.

 

Where could be issue?

Edited by domorodecmezilidmi (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 5 months later...

Hi Christopher,

the solution above works just fine in Prestashop 1.6.

Did you change order_conf.html template in your theme (themes/your-theme/email)? That's the only problem I can think of right now. 

 

Can you share what have you tried so far?

Link to comment
Share on other sites

  • 10 months later...

Hi, i still have problem with {message} template var in Prestashop 1.6.

 

In classes/PaymentModule.php I added:

$customer_message = $order->getFirstMessage();
'{message}' => $customer_message

and in /themes/my_theme/mails/ i put {message} tag.

And it still doesn't work. I am getting mails with not parsed {message} tag.

 

Link to comment
Share on other sites

  • 4 months later...

You can do it by using the PaymentModule.php  class located in  ./classes

 

Search for this sentence :   // Order is reloaded because the status just changed


// Order is reloaded because the status just changed
$order = new Order($order->id);
//add this
$customer_message_nka=nl2br($order->getFirstMessage());

And in the data array add your message:

$data = array(
						'{firstname}' => $this->context->customer->firstname,
						'{lastname}' => $this->context->customer->lastname,
						'{email}' => $this->context->customer->email,
						'{delivery_block_txt}' => $this->_getFormatedAddress($delivery, "\n"),
						'{invoice_block_txt}' => $this->_getFormatedAddress($invoice, "\n"),
						'{delivery_block_html}' => $this->_getFormatedAddress($delivery, '<br />', array(
							'firstname'	=> '<span style="font-weight:bold;">%s</span>',
							'lastname'	=> '<span style="font-weight:bold;">%s</span>'
						)),
						'{invoice_block_html}' => $this->_getFormatedAddress($invoice, '<br />', array(
								'firstname'	=> '<span style="font-weight:bold;">%s</span>',
								'lastname'	=> '<span style="font-weight:bold;">%s</span>'
						)),
						'{delivery_company}' => $delivery->company,							
                                        '{message}'=>$customer_message_nka,	
// the array continue. But just add 	'{message}'=>$customer_message_nka,

And use {message}  in themes/your_theme_name/mails/en/order_conf.html  

 

Did you read my post? You you repeated the same what I wrote...

Link to comment
Share on other sites

×
×
  • Create New...