Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Oct 2010
    Location
    Shropshire
    Posts
    174
    Plugin Contributions
    0

    Default Confirmation email layout oddity

    When I view a confirmatin email using Outlook it looks OK. When I print it, or view in print-preview the layout is mashed - see attched screen grabs.
    It appears that the top part of the table expands to fill the page width, but the bottom part doesnt. This leaves the outline box incomplete and an odd line through the costs.

    Is this an outlook oddity - or perhaps a CSS problem?

    Anyone any ideas?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	email.jpg 
Views:	80 
Size:	24.8 KB 
ID:	9276   Click image for larger version. 

Name:	print_preview.jpg 
Views:	68 
Size:	15.7 KB 
ID:	9277  

  2. #2
    Join Date
    Oct 2010
    Location
    Shropshire
    Posts
    174
    Plugin Contributions
    0

    Default Re: Confirmation email layout oddity

    I used 'view source' to look at the email source code. I dumped this code into my html editor.
    I run Tidy - which reported a missing 'tr'
    (it also reports a missing 'title' in the 'head' section, and does not like the use of the deprecated 'nobr' structure )
    Code:
    <div class="order-detail-area">
    	<table border="0" width="100%" cellspacing="0" cellpadding="2">
    			<td class="order-totals-text" align="right" width="100%">&nbsp;</td> 
    			<td class="order-totals-num" align="right" nowrap="nowrap">---------</td> 
    		</tr>
    	<tr>
    		<td class="order-totals-text" align="right" width="100%">Sub-Total:</td> 
    		<td class="order-totals-num" align="right" nowrap="nowrap">&pound;5.25</td>
    	</tr>
    	<tr>
    		<td class="order-totals-text" align="right" width="100%">Free Shipping:</td> 
    		<td class="order-totals-num" align="right" nowrap="nowrap">&pound;0.00</td>
    	</tr>
    	<tr>
    		<td class="order-totals-text" align="right" width="100%">On-Line Booking Fee Refund:</td> 
    		<td class="order-totals-num" align="right" nowrap="nowrap">-&pound;0.25</td>
    	</tr>
    	<tr>
    		<td class="order-totals-text" align="right" width="100%">Total:</td> 
    		<td class="order-totals-num" align="right" nowrap="nowrap">&pound;5.00</td>
    	</tr>
    	<tr> 
    	</table>
    </div>
    the 'tr' is clearly missing at the immediately after 'table' - and then present immediately before '/table'

    so the string $PRODUCTS_DETAIL is malformed

    Now to find where that is generated - but have to go out for a while first

  3. #3
    Join Date
    Oct 2010
    Location
    Shropshire
    Posts
    174
    Plugin Contributions
    0

    Default Re: Confirmation email layout oddity

    OK - found it - I think

    In classes/orders.php line 972

    Code:
    $html_ot .= '<td class="order-totals-text" align="right" width="100%">' . '&nbsp;' . '</td> ' . "\n" . '<td class="order-totals-num" align="right" nowrap="nowrap">' . '---------' .'</td> </tr>' . "\n" . '<tr>';
    This is the first line - there is no opening 'tr', it is not part of the loop so cannot rely on the 'tr' added at the end of each loop line.

    The loop is also a problem - line 975 is the loop line
    Code:
          $html_ot .= '<td class="order-totals-text" align="right" width="100%">' . $order_totals[$i]['title'] . '</td> ' . "\n" . '<td class="order-totals-num" align="right" nowrap="nowrap">' .($order_totals[$i]['text']) .'</td> </tr>' . "\n" . '<tr>';
    This has an opening 'tr' at the end - ready for thenext line
    however - on the last line this leaves the 'tr' without a closing 'tr' before the '/table'

    I would change both of these 2 lines to be complete and closed 'tr' '/tr'. ie open the 'tr' at the beginning of the line and close it '/tr' at the end of the line - I'll just give it a try


    AHH - -
    well the 'tr' structure is now correct - but the print layout is still bad.

    the email html served still will not validate - no doctype, no title, 'nobr' deprecated - however thats unlikely to be the layou problem

  4. #4
    Join Date
    Oct 2010
    Location
    Shropshire
    Posts
    174
    Plugin Contributions
    0

    Default Re: Confirmation email layout oddity

    how about changing
    Code:
    <nobr>........</nobr>
    to
    Code:
    <span style="white-space:nowrap;">....</span>
    at least that is standards compliant
    Last edited by tsrplatelayer; 25 May 2011 at 04:56 PM.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Confirmation email layout oddity

    Quote Originally Posted by tsrplatelayer View Post
    how about changing
    Code:
    <nobr>........</nobr>
    to
    Code:
    <span style="white-space:nowrap;">....</span>
    at least that is standards compliant
    Email isn't standards compliant. You must essentially code for CSS1, or *maybe* CSS2. It's mostly Microsoft apps that are the least compliant. Lotsa articles available online to confirm this.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Confirmation email layout oddity

    Quote Originally Posted by tsrplatelayer View Post
    OK - found it - I think

    In classes/orders.php line 972

    Code:
    $html_ot .= '<td class="order-totals-text" align="right" width="100%">' . '&nbsp;' . '</td> ' . "\n" . '<td class="order-totals-num" align="right" nowrap="nowrap">' . '---------' .'</td> </tr>' . "\n" . '<tr>';
    This is the first line - there is no opening 'tr', it is not part of the loop so cannot rely on the 'tr' added at the end of each loop line.

    The loop is also a problem - line 975 is the loop line
    http://www.zen-cart.com/forum/showthread.php?t=155023
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Oct 2010
    Location
    Shropshire
    Posts
    174
    Plugin Contributions
    0

    Default Re: Confirmation email layout oddity

    OK - so I didnt invent the wheel - someone got there before me -


    Is this why the confirmation email still uses 'table' for layout - a deprecated practice?

    However - Just because microsoft cannot get it correct doesn't mean this app should get it wrong.

    I still have this strange layout oddity - it is probably another MS artifact - but as I dont have any other email prog I cant say

    which is why I wondered if anyone else had seen this effect

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Confirmation email layout oddity

    Quote Originally Posted by tsrplatelayer View Post
    Is this why the confirmation email still uses 'table' for layout - a deprecated practice?
    Yes. Unfortunately sometimes it's necessary to code for the lowest-common denominator.
    Quote Originally Posted by tsrplatelayer View Post
    However - Just because microsoft cannot get it correct doesn't mean this app should get it wrong.
    True. Feel free to change yours to be CSS5/HTML5 standards-compliant. You'll get a great warm fuzzy feeling. But your customers won't be able to read the emails.

    Or, you could contact all the email-client vendors and get them to upgrade their HTML engines and force updates out to all their users ASAP.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Oct 2010
    Location
    Shropshire
    Posts
    174
    Plugin Contributions
    0

    Default Re: Confirmation email layout oddity

    I have just verified that the layout problem is indeed an Outlook issue.

    By messing with the paper leftr/right margin settings (set to 2.3cm) in print-preview the display can be corrected and then prints correctly

    Also selecting 'other actions' 'view in browser' (which - of course - doesnt offer any options - just opens IE) and then print preview also displays/prints correctly. So clearly its an Outlook HTML engine issue.

    Dont suppose there's any point is a CSS for printing in the light of Dr Byte's comments.
    Last edited by tsrplatelayer; 25 May 2011 at 07:40 PM.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Confirmation email layout oddity

    probably not ... however, you might be able to force table column widths by fudging the html for those. Or if the <nobr> tags are causing "stretching", you could omit those and live with the unsightly wrapping that may follow.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. order confirmation email layout
    By piker in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Jan 2010, 02:03 AM
  2. Layout of attributes on Email Confirmation
    By giftmeister in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Feb 2009, 07:09 AM
  3. Checkout page layout oddity
    By ck-d in forum General Questions
    Replies: 2
    Last Post: 20 Oct 2008, 09:23 PM
  4. Editing The Layout Of The Order Confirmation Email
    By steve_ringuk in forum General Questions
    Replies: 1
    Last Post: 7 Feb 2008, 05:23 PM
  5. Email confirmation problem - layout & linebreaks
    By gustafr in forum General Questions
    Replies: 1
    Last Post: 16 Sep 2006, 04:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR