Zen Cart Logo
Forums / General Questions / Problem with display of Order Confirmation emails

Problem with display of Order Confirmation emails

Views: 700

Results 1 to 9 of 9
1 Dec 2015, 7:00 PM
#1
djbeatnik avatar

djbeatnik

New Zenner

Join Date:
Oct 2015
Location:
Surrey, UK
Posts:
4
Plugin Contributions:
0

Problem with display of Order Confirmation emails

Hiya,

Any help would be greatly appreciated.

The styling is out on some Order Confirmation emails and random code is being inserted.

I have recently moved cart to a vps and had to amend files to get it going with higher php.

Thank you

Any ideas Dr Byte?

Zen Cart 1.3.7

Attachment 15838

2 Dec 2015, 1:32 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Problem with display of Order Confirmation emails

Zen Cart 1.3.7 really!!!!

It is time to upgrade from code that is vulnerable and 8 years old

2 Dec 2015, 3:48 PM
#3
djbeatnik avatar

djbeatnik

New Zenner

Join Date:
Oct 2015
Location:
Surrey, UK
Posts:
4
Plugin Contributions:
0

Re: Problem with display of Order Confirmation emails

I have so many addons otherwise I would, cart is only for customers with accounts, so no card transactions etc. But the notification emails are looking messy since php upgrade.

Zen Cart 1.3.7
PHP Version 5.4.45
MySQL 5.0.95

2 Dec 2015, 4:16 PM
#4
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Problem with display of Order Confirmation emails

it hardly looks random....

can i safely assume that this is an html email?

you have some html tags that are appearing as text. i would guess that you have a quoting problem going on...

2 Dec 2015, 4:48 PM
#5
djbeatnik avatar

djbeatnik

New Zenner

Join Date:
Oct 2015
Location:
Surrey, UK
Posts:
4
Plugin Contributions:
0

Re: Problem with display of Order Confirmation emails

Yeah, not random, from order.php, randomly displayed, and not in all emails, some are displayed correctly.
Quoting problem?
Thanks

2 Dec 2015, 8:31 PM
#6
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Problem with display of Order Confirmation emails

djbeatnik,
sorry if i was not being clear... looking at the order class i have something like this:

 $this->products_ordered .=  $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') . ' = ' .
                            $currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
                            ($this->products[$i]['onetime_charges'] !=0 ? "\n" . TEXT_ONETIME_CHARGES_EMAIL . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
                            $this->products_ordered_attributes . "\n";
      $this->products_ordered_html .=
	'<tr>' .
	'<td class="product-details" align="right" valign="top" width="30">' . $this->products[$i]['qty'] . ' x</td>' .
	'<td class="product-details" valign="top">' . $this->products[$i]['name'] . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') .
	'<nobr><small><em> '. $this->products_ordered_attributes .'</em></small></nobr></td>' .

i'm not sure if this is from 3.7 or not, but it looks close....

it looks like you may have a quote (either ' or ") in a product description (or some other field), which is then screwing up the variable: $this->products_ordered_html

i hope that makes sense and is helpful to you.

best.

3 Dec 2015, 9:44 PM
#7
djbeatnik avatar

djbeatnik

New Zenner

Join Date:
Oct 2015
Location:
Surrey, UK
Posts:
4
Plugin Contributions:
0

Re: Problem with display of Order Confirmation emails

Thanks, there are some single and double quotes in some of the descriptions, any idea on how to fix this without removing them?
Thanks again.

4 Dec 2015, 1:23 AM
#8
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Problem with display of Order Confirmation emails

djb,
i just want to summarize before we go:

  • you are having some "random" html code in order confirmation emails.
  • these emails are html emails.
  • some item descriptions contain single quotes and double quotes.
  • we think that the email problem is related to these quotes in the item descriptions.

the only reason why i reiterate this information, is that i'm still not 100% that is your problem it is entirely possible that the quotes are your problem and you are more sure than i am. i would hate to address something that is not, in fact, the source of your issue... and really it looks like the field $this->products_ordered_attributes is actually the problem field. but lets give it a whirl!

i would replace the following:

 $this->products_ordered_html .=
	'<tr>' .
	'<td class="product-details" align="right" valign="top" width="30">' . $this->products[$i]['qty'] . ' x</td>' .
	'<td class="product-details" valign="top">' . $this->products[$i]['name'] . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') .
	'<nobr><small><em> '. $this->products_ordered_attributes .'</em></small></nobr></td>' .

with

 $this->products_ordered_html = htmlspecialcharacters($this->products_ordered_html) .
	'<tr>' .
	'<td class="product-details" align="right" valign="top" width="30">' . $this->products[$i]['qty'] . ' x</td>' .
	'<td class="product-details" valign="top">' . $this->products[$i]['name'] . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') .
	'<nobr><small><em> '. $this->products_ordered_attributes .'</em></small></nobr></td>' .

you can read about the php function here:

http://php.net/manual/en/function.htmlspecialchars.php

the key is executing that function at the right place.

i hope that helps! good luck!

4 Dec 2015, 6:09 AM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Problem with display of Order Confirmation emails

we think that the email problem is related to these quotes in the item descriptions.
Or one can use escape characters for special characters in their html mark up
for double quotes it would be

" or  "

Others can be seen here
https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references