Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,838
    Plugin Contributions
    31

    Default [Done v1.5.0] minor email table error in orders.php

    in /includes/classes/order.php
    the code results in a missed starting <tr> tag and a final extra <tr> in the email.

    Suggested change from:
    Code:
        //order totals area
        $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>';
        for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
          $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
          $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>';
        }
    to:

    Code:
        //order totals area
        $html_ot .= '<tr><td class="order-totals-text" align="right" width="100%">' . '&nbsp;' . '</td> ' . "\n" . '<td class="order-totals-num" align="right" nowrap="nowrap">' . '---------' .'</td> </tr>' . "\n";
        for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
          $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
          $html_ot .= '<tr><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";
        }
    whether you get rid of the "nowrap" tags and put them in the css is another matter.
    Last edited by torvista; 14 May 2010 at 05:39 AM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: minor email table error in order.php

    Quote Originally Posted by torvista View Post
    whether you get rid of the "nowrap" tags and put them in the css is another matter.
    Email typically doesn't support most CSS usage, hence the choice to embed it into the HTML.

    However, the incorrect nesting is fixed in v1.5.0
    .

    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.

  3. #3
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default order totals area

    Hi,

    In the includes/classes/orders.php files there is a code for outputting the order totals in the order confirmation email. The coding is:

    $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>';
    for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
    $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>';
    }
    $html_msg['ORDER_TOTALS'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2"> ' . $html_ot . ' </table>';

    Now this gives a html output of:

    <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">$8.00</td> </tr>
    <tr><td class="order-totals-text" align="right" width="100%">Per Item Rates (Shipping to BS (145.00grams)):</td>
    <td class="order-totals-num" align="right" nowrap="nowrap">$3.30</td> </tr>
    <tr><td class="order-totals-text" align="right" width="100%">Total:</td>
    <td class="order-totals-num" align="right" nowrap="nowrap">$11.30</td> </tr>
    <tr> </table>

    Forgive me if i'm wrong, but there seems to be a missing <tr> before the first <td> tag. e.g.

    <table border="0" width="100%" cellspacing="0" cellpadding="2"> <TR><td class="order-totals-text" align="right" width="100%">&nbsp;</td>
    <td class="order-totals-num" align="right" nowrap="nowrap">---------</td> </tr>


    Therefore shouldn't the orders.php code be:

    $html_ot .= '<TR><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>';
    for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
    $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>';
    }
    $html_msg['ORDER_TOTALS'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2"> ' . $html_ot . ' </table>';

  4. #4
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: minor email table error in orders.php

    I tested the code suggested:

    PHP Code:
     //order totals area
        
    $html_ot .= '<tr><td class="order-totals-text" align="right" width="100%">' '&nbsp;' '</td> ' "\n" '<td class="order-totals-num" align="right" nowrap="nowrap">' '---------' .'</td> </tr>' "\n";
        for (
    $i=0$n=sizeof($order_totals); $i<$n$i++) {
          
    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' strip_tags($order_totals[$i]['text']) . "\n";
          
    $html_ot .= '<tr><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";
        } 
    And html emails now seem to work fine in hotmail, gmail, yahoo & windows live mail.

    Thanks guys!

 

 

Similar Threads

  1. v152 [Done v1.5.2] minor typo in option_name.php language file
    By torvista in forum Bug Reports
    Replies: 1
    Last Post: 4 Dec 2013, 08:19 PM
  2. Replies: 1
    Last Post: 17 Mar 2013, 10:16 PM
  3. Replies: 3
    Last Post: 30 Oct 2011, 06:53 AM
  4. Replies: 0
    Last Post: 16 Nov 2007, 11:35 PM

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