Jump to content

Show 'Company Name' in 'new order email' when B2B is enabled?


canelones

Recommended Posts

Prestashop 1.6


I enabled the B2B feature to allow the costumer to enter his Company Name. It works fine.


Now I need to show that "Company Name" in the "new order" email that the administrator receives when a new order is created.


What I have done do so far:


1 - In Localization/Translation/Email templates for my theme I edited the "new order" email and add the variable (token): {company} See the capture.


2- In Localization/Countries I edited the only enabled country (which is Spain) to add 'company' to Address format. See the capture.


Problem is that the email shows the text {company} instead of its value. e.x: Acme, Apple...


What am I missing here?


 


 


post-1123559-0-88333600-1464858326_thumb.jpeg

post-1123559-0-37341300-1464858331_thumb.jpeg

Link to comment
Share on other sites

In order to use parameters like {company} in your email template, you have prepare the parameter data that passed to the Mail::send().

You will need to modify the mailalert module to add the {company} to the parameter data array so that it will show up on your email.

Link to comment
Share on other sites

Try changing lines 344-345 of modules/mailalerts/mailalerts.php from:

		$template_vars = array(
			'{firstname}' => $customer->firstname,

to:

		$template_vars = array(
			'{company}' => $customer->company,
			'{firstname}' => $customer->firstname,
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...