Jump to content

Order confirmation mail: How to separate attribute using line break instead of comma


thabisomak

Recommended Posts

Hi Guys

 

I have have around 7 different attributes for the products in my store. The order confirmation email currently displays all the attributes on one line separated by commas. I would like to change this to list each attribute on a new line. 

 

Can anyone help me achieve this?

 

I'm running Prestashop 1.6.1.10

 

Thanks

Link to comment
Share on other sites

The attributes are seperated in a foreach-function. You can replace the seperator "," with "\n" for a linebreak.

Thanks for your response.

 

I have tried to locate the separator in PaymentsModule.php and I cannot find it. 

Am I maybe looking in the wrong place?

Link to comment
Share on other sites

Thanks for your response.

 

I have tried to locate the separator in PaymentsModule.php and I cannot find it. 

Am I maybe looking in the wrong place?

$customization_text .= $text['name'].': '.$text['value'].'<br />';

in classes/PaymentModule.php in Line 478 you have the '<br />' tag, this makes sure, that html-mails get a linebreak. Try adding a "\n" for textmails, so it has to look like:

$customization_text .= $text['name'].': '.$text['value'].'<br />\n';

Not tested, but this should do the trick.

Link to comment
Share on other sites

$customization_text .= $text['name'].': '.$text['value'].'<br />';

in classes/PaymentModule.php in Line 478 you have the '<br />' tag, this makes sure, that html-mails get a linebreak. Try adding a "\n" for textmails, so it has to look like:

$customization_text .= $text['name'].': '.$text['value'].'<br />\n';

Not tested, but this should do the trick.

 

 

Unfortunately this doesn't work.

It refers to the product 'Customization' rather than the Attributes.

Link to comment
Share on other sites

 

well, there is just 1 more output for the product attributes in 464:

'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''),

Try this:

'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'].'\n'. : ''),

 

This gives an HTTP ERROR 500 message when loading the checkout page.

Link to comment
Share on other sites

This gives an HTTP ERROR 500 message when loading the checkout page.

 

Okay this was a result of the second dot after the . '\n'

 

I edited the code as below. All it did was place the text \n at the end of the list of attributes.

  1. 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'].'\n' : ''),
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...