Zen Cart Logo
Forums / Managing Customers and Orders / Order Confirmation - how do I add line breaks between attributes?

Order Confirmation - how do I add line breaks between attributes?

Locked

Views: 4,746

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
8 Jun 2006, 10:44 PM
#1
sammyd avatar

sammyd

New Zenner

Join Date:
Oct 2005
Posts:
40
Plugin Contributions:
0

Order Confirmation - how do I add line breaks between attributes?

Hi Zenners

My Product details in Email Confirmations are all on one line there seems to be a </br> missing after each line (ver 1.3.0.1), i.e.
1 x Product one
Download 1 Download 2 Download 3

Instead of
1 x Product one
Download 1
Download 2
Download 3

which file to I change to put the break back in.

Thanks

18 Jun 2006, 7:35 AM
#2
sammyd avatar

sammyd

New Zenner

Join Date:
Oct 2005
Posts:
40
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Please can someone help, I just need to know where the file is
!

18 Jun 2006, 1:30 PM
#3
kim avatar

kim

Obaa-san

Join Date:
Jun 2003
Posts:
26,594
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

What is wrong with your order confirmation? The file is tpl_checkout_confirmation.php

18 Jun 2006, 8:02 PM
#4
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Order Confirmation - how do I add line breaks between attributes?

tpl_checkout_confirmation.php file.

tpl_checkout_confirmation_default.php file.

20 Jun 2006, 10:01 AM
#5
sammyd avatar

sammyd

New Zenner

Join Date:
Oct 2005
Posts:
40
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Thank you for the replies!

Here is the text (is this what you meant)

<div class="content-line"><strong>Products</strong></div> <div class="order-detail-area"><table class="product-details" border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td class="product-details" align="right" valign="top" width="30">1 x</td><td class="product-details" valign="top">Spring into Summer (SDKJUNE06) <nobr><small><em> Download 1 Win Zip Format Download 2 Win Zip Format Download 3 Win Zip Format Download 4 Win Zip Format</em></small></nobr></td><td class="product-details-num" valign="top" align="right">$0.00</td></tr></table></div>

When I look at text from an old confirmation (ver 1.2.7) there is a </br> after each attribute!

The coding has changed slightly in ver 1.3.0.1 tpl_checkout_confirmation_default.php - line 131 (I am guessing this is the code to change) but where to put the </br>.

Your help is much appreciated I know this is a small issue :D!

20 Jun 2006, 11:34 AM
#6
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Order Confirmation - how do I add line breaks between attributes?

I have to admit, it wasn't an obvious place to find it. Even I would of had a hard time if you haven't posted these codes above. :blink:

In your includes/classes/order.php file,

find:

'<nobr><small><em> '. $this->products_ordered_attributes .'</em></small></nobr></td>' .

replace with:

'<br /><small><em> '. $this->products_ordered_attributes .'</em></small><br /></td>' .

Which is, I believe, what you were looking for to do. :wink2:

21 Jun 2006, 11:59 AM
#7
sammyd avatar

sammyd

New Zenner

Join Date:
Oct 2005
Posts:
40
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Thank you so much, now the order confirmations are all nice and neat!

There is no way I would have ever looked for that code to change!

Your time and trouble is very much appreciated, many, many thanks!

:D

21 Jun 2006, 12:36 PM
#8
theoracle avatar

theoracle

Suspended

Join Date:
Aug 2004
Posts:
3,180
Plugin Contributions:
1

Re: Order Confirmation - how do I add line breaks between attributes?

Outstanding. Thanks for updating. :cool:

9 Oct 2006, 9:23 PM
#9
sprogy avatar

sprogy

New Zenner

Join Date:
Jan 2006
Posts:
37
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Pants... its not working for me.

I have:

</td>' . '<td class="product-details" valign="top">' . $this->products[$i]['name'] . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') . **'<br /><small><em> '. $this->products_ordered_attributes .'</em></small><br /></td>' .** '<td class="product-details-num" valign="top" align="right">' . $currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) . ($this->products[$i]['onetime_charges'] !=0 ? '</td></tr><tr><td class="product-details">' . TEXT_ONETIME_CHARGES_EMAIL . '</td>' .

and I'm still having no joy.

Any ideas?

15 Oct 2006, 11:41 AM
#10
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

It seems that only the HTML format of Order Confirmation show no line break.
And the one with Text format don't have this problem.

Had tried to add a <br /> to the file below and in the test the attruibute line show with line break.

the file to modifiy is:
includes/classes/order.php

NOTE:
This is the classes file and no override.
Don't forget to backup your files before and after any modifications.
You are at your own risk, anything wrong will cause troubles to your system.

For v1.3.5, at about line no. 829
For v1.3.0.2, at about line no. 806

Find the following line

$this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);

at the end of the line, before the ; add the follow: ```
[b] . '<br />'[/b]

Note: there is a leading space in the beginning

And read as follow:
```php
$this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']) . '<br />';
15 Oct 2006, 2:41 PM
#11
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Update!

Sorry, found that the first attribute is not wrapped, and only follow after the product name.

Please change the above code as follow.

$this->products_ordered_attributes .= "\n\t" . '<br />' . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);

The only change is put the <br /> to the begin of each attribute line and not the end.

16 May 2008, 1:57 AM
#12
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Hi everyone,

I have a problem that I have tracked down to this section of code.

I am using the Japanese version, in the email confirmation only the attributes appear as Unicode values. All other Japanese text is fine.

i was hoping someone might know why the attributes would be handled differently.. could it be this code?

      //clr 030714 changing to use values from $orders->products and adding call to zen_decode_specialchars()
      //        $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . $attributes_values->fields['products_options_values_name'];
      $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
19 May 2008, 4:37 AM
#13
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Anybody?

I've been trying to fix this for hours, it seems that
$this->products_ordered_attributes

is the only thing that is not encoded properly, anybody know how I can force this to appear correctly in the email?

19 May 2008, 9:30 AM
#14
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Order Confirmation - how do I add line breaks between attributes?

Finally, I got it. On line 870 in orders.php. Added:

$str1 = mb_convert_encoding( $this->products_ordered_attributes, "EUC-JP", "HTML-ENTITIES" );

Then on line 885, substituted: $str1

for:

$this->products_ordered_attributes