Zen Cart Logo
Forums / General Questions / How is $ORDER_TOTALS translated into HTML email?

How is $ORDER_TOTALS translated into HTML email?

Locked

Views: 1,537

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
7 Jun 2008, 11:38 AM
#1
cochlear avatar

cochlear

Zen Follower

Join Date:
Apr 2007
Location:
Sydney
Posts:
110
Plugin Contributions:
0

How is $ORDER_TOTALS translated into HTML email?

I can understand how ZC translates the language file texts into HTML emails. It's literally word for word.

But how about things like the order total? On a web page the order totals are aligned to the right, and the same in the email, so it seems that certain style information gets carried across too? Or is the right alignment hard coded into the checkout confirmation email?

I'm asking this because I'm having trouble with formatting the order total in the checkout confirmaiton email. So knowing how it works may help me find a solution. Thanks!

7 Jun 2008, 3:43 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,694
Plugin Contributions:
56

Re: How is $ORDER_TOTALS translated into HTML email?

If you look at email/email_template_checkout.html, look at the top of the file; there is a bunch of styling. Then look down to the body of the email, and it says

<div class="order-detail-area">$ORDER_TOTALS</div>

just change this class to something you like better that you've coded at the top.

You probably don't want to restyle order-detail-area because this is used for other fields.

Good luck,
Scott

8 Jun 2008, 12:33 PM
#3
cochlear avatar

cochlear

Zen Follower

Join Date:
Apr 2007
Location:
Sydney
Posts:
110
Plugin Contributions:
0

Re: How is $ORDER_TOTALS translated into HTML email?

Scott thanks for your reply.

I've tested maybe 100 emails this weekend, and I'm pretty sure the right alignment of the order totals is caused by something extrinsic to the html template.

If you remove everything in the template, I mean all the other placeholders, all the styles, except the order total placeholder, the html email that the customer receives, will still have the order totals flushed to the right side. The text email doesn't do that. So that's why I think it's caused by something extrinsic.

10 Jun 2008, 5:26 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: How is $ORDER_TOTALS translated into HTML email?

/includes/classes/order.php```
//order totals area
$html_ot .= '<td class="order-totals-text" align="right" width="100%">' . ' ' . '</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>';

10 Jun 2008, 10:38 AM
#5
cochlear avatar

cochlear

Zen Follower

Join Date:
Apr 2007
Location:
Sydney
Posts:
110
Plugin Contributions:
0

Re: How is $ORDER_TOTALS translated into HTML email?

DrByte you are a saviour! :D