If anyone is trying to modify their X-Cart to be xhtml or clean coded, you might want to start with this invoice template that I created.
This has been tested on 4.0.14-4.0.16, and it will display awesome on the print invoice screen as well.
Template Preview:
http://img209.imageshack.us/my.php?image=invoicescreenshot0vh.jpg
http://img209.imageshack.us/img209/72/invoicescreenshot0vh.jpg
Location: skin/mail/html/order_invoice.tpl
Code:
{* $Id: order_invoice.tpl,v 1.14.2.15 2005/08/09 10:51:37 max Exp $ *}
{if $customer ne ''}{assign var="_userinfo" value=$customer}{else}{assign var="_userinfo" value=$userinfo}{/if}
{config_load file="$skin_config"}
{if $is_nomail ne 'Y'}
{literal}
<STYLE type="text/css">
body {
MARGIN-TOP: 10px;
FONT-SIZE: 12px;
MARGIN-LEFT: 10px;
FONT-FAMILY: arial,helvetica,sans-serif
}
td {
FONT-SIZE: 12px;
FONT-FAMILY: arial,helvetica,sans-serif
}
th {
FONT-SIZE: 13px;
FONT-FAMILY: arial,helvetica,sans-serif
}
h1 {
FONT-SIZE: 20px
}
#orderDetailsTable {
border: 3px solid #FFFFFF;
background-color: #f5edd6;
}
#orderDetailsTable th {
color: #FFFFFF;
background-color: #8d7299;
font-weight: bold;
font-size: 14px;
}
#orderDetailsTable tr {
border: 1px solid #FFFFFF;
}
#orderDetailsTable td {
vertical-align: top;
}
td.order1 {
background-color: #8d7299;
color: #FFFFFF;
}
</STYLE>
{/literal}
{/if}
<div align="center"><table>
<tr><td colspan="2" align="center"><font style="FONT-SIZE: 22px">{$lng.lbl_invoice|upper}</font>
</td></tr>
<tr><td valign="top"><table cellSpacing="0" cellPadding="3" width="215px" id="orderDetailsTable">
<tr><th height="20px">Company Information</th></tr>
<tr><td>{$config.Company.company_name}
</td></tr>
<tr><td>{$config.Company.location_address}, {$config.Company.location_city}
{$config.Company.location_zipcode}, {$config.Company.location_state_name}
</td></tr>
{if $config.Company.company_phone}<tr><td>{$lng.lbl_phone}: {$config.Company.company_phone}</td></tr>{/if}
{if $config.Company.company_phone_2}<tr><td>{$lng.lbl_phone_2_title}: {$config.Company.company_phone_2}</td></tr>{/if}
{if $config.Company.company_fax}<tr><td>{$lng.lbl_fax}: {$config.Company.company_fax}</td></tr>{/if}
{if $config.Company.orders_department}<tr><td>{$lng.lbl_email}: {$config.Company.orders_department}</td></tr>{/if}
</table>
<table cellSpacing="0" cellPadding="3" width="215px" id="orderDetailsTable">
<tr>
<th colspan="2" height="20px">{$lng.lbl_billing_address}</th>
</tr>
{if $_userinfo.default_fields.firstname}
<tr>
<td>{$lng.lbl_first_name}: </td>
<td>{$order.b_firstname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.lastname}
<tr>
<td>{$lng.lbl_last_name}: </td>
<td>{$order.b_lastname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.b_address}
<tr>
<td>{$lng.lbl_address}: </td>
<td>{$order.b_address}
{$order.b_address_2}</td>
</tr>
{/if}
{if $_userinfo.default_fields.b_city}
<tr>
<td>{$lng.lbl_city}: </td>
<td>{$order.b_city}</td>
</tr>
{/if}
{if $_userinfo.default_fields.b_county && $config.General.use_counties eq 'Y'}
<tr>
<td>{$lng.lbl_county}: </td>
<td>{$order.b_countyname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.b_state}
<tr>
<td>{$lng.lbl_state}: </td>
<td>{$order.b_statename}</td>
</tr>
{/if}
{if $_userinfo.default_fields.b_country}
<tr>
<td>{$lng.lbl_country}: </td>
<td>{$order.b_countryname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.b_zipcode}
<tr>
<td>{$lng.lbl_zip_code}: </td>
<td>{$order.b_zipcode}</td>
</tr>
{/if}
{foreach from=$_userinfo.additional_fields item=v}
{if $v.section eq 'B'}
<tr>
<td>{$v.title}:</td>
<td>{$v.value}</td>
</tr>
{/if}
{/foreach}
</table></td><td valign="top"><table cellSpacing="0" cellPadding="3" width="215px" id="orderDetailsTable">
<tr><th height="20px">Order Information</th></tr>
<tr><td>{$lng.lbl_date}: {$order.date|date_format:$config.Appearance.datetime_format}</td></tr>
<tr><td>{$lng.lbl_order_id}: #{$order.orderid}</td></tr>
<tr><td>{$lng.lbl_order_status}: {include file="main/order_status.tpl" status=$order.status mode="static"}</td></tr>
<tr><td>{$lng.lbl_payment_method}:
{$order.payment_method}</td></tr>
<tr><td>{$lng.lbl_delivery}:
{$order.shipping|trademark|default:$lng.txt_not_available}
{if $order.applied_taxes}
{foreach from=$order.applied_taxes key=tax_name item=tax}
{$tax.regnumber}</td></tr>
{/foreach}
{/if}
</table>
<table cellSpacing="0" cellPadding="3" width="215px" id="orderDetailsTable">
<tr>
<th colspan="2" height="20px">{$lng.lbl_shipping_address}</th>
</tr>
{if $_userinfo.default_fields.firstname}
<tr>
<td>{$lng.lbl_first_name}: </td>
<td>{$order.s_firstname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.lastname}
<tr>
<td>{$lng.lbl_last_name}: </td>
<td>{$order.s_lastname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.s_address}
<tr>
<td>{$lng.lbl_address}: </td>
<td>{$order.s_address}
{$order.s_address_2}</td>
</tr>
{/if}
{if $_userinfo.default_fields.s_city}
<tr>
<td>{$lng.lbl_city}: </td>
<td>{$order.s_city}</td>
</tr>
{/if}
{if $_userinfo.default_fields.s_county && $config.General.use_counties eq 'Y'}
<tr>
<td>{$lng.lbl_county}: </td>
<td>{$order.s_countyname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.s_state}
<tr>
<td>{$lng.lbl_state}: </td>
<td>{$order.s_statename}</td>
</tr>
{/if}
{if $_userinfo.default_fields.s_country}
<tr>
<td>{$lng.lbl_country}: </td>
<td>{$order.s_countryname}</td>
</tr>
{/if}
{if $_userinfo.default_fields.s_zipcode}
<tr>
<td>{$lng.lbl_zip_code}: </td>
<td>{$order.s_zipcode}</td>
</tr>
{/if}
{foreach from=$_userinfo.additional_fields item=v}
{if $v.section eq 'S'}
<tr>
<td>{$v.title}:</td>
<td>{$v.value}</td>
</tr>
{/if}
{/foreach}
</table></td></tr>
<tr><td valign="top"></td><td valign="top"></td></tr>
</table>
<table cellSpacing="0" cellPadding="3" width="90%" border="0">
{assign var="is_header" value=""}
{foreach from=$_userinfo.additional_fields item=v}
{if $v.section eq 'A'}
{if $is_header eq ''}
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td width="45%" height="25">{$lng.lbl_additional_information}</td>
<td colspan="2" width="55%"></td>
</tr>
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="90%" border="0">
{assign var="is_header" value="E"}
{/if}
<tr valign="top">
<td>{$v.title}</td>
<td>{$v.value}</td>
</tr>
{/if}
{/foreach}
{if $is_header eq 'E'}
</table></td>
<td colspan="2" width="55%"></td>
</tr>
{/if}
{if $config.Email.show_cc_info eq "Y" and $show_order_details eq "Y"}
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td width="45%" height="25">{$lng.lbl_order_payment_details}</td>
<td colspan="2" width="55%"></td>
</tr>
<tr>
<td colspan="3">{$order.details|replace:"\n":"
"}</td>
</tr>
{/if}
{if $order.netbanx_reference}
<tr>
<td colspan="3">NetBanx Reference: {$order.netbanx_reference}</td>
</tr>
{/if}
</table>
{include file="mail/html/order_data.tpl"}
{if $active_modules.Anti_Fraud eq '' && $show_order_details eq "Y" && ($usertype eq 'A' || ($usertype eq 'P' && $active_modules.Simple_Mode))}
{$lng.txt_warning_antifraud_disabled}</p>
{/if}
{$lng.txt_thank_you_for_purchase}
</div>