//added an if statement which determines whether the product has a model description.
//before, an ugly () appeared in the order invoice emails, where a product doesnt belong to a model.
if ($order->products[$i]['model'] != '')
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
else
$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}
$order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM
// lets start with the email confirmation
$email_order = '<head><style type="text/css">' .
'.dataTableHeadingRow { background-color: #8CA2D6; }' .
'.dataTableHeadingContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ffffff; font-weight: bold; }' .
'.dataTableRow { background-color: #F0F1F1; }' .
'.dataTableRowSelected { background-color: #DEE4E8; }' .
'.dataTableRowOver { background-color: #FFFFFF; cursor: pointer; cursor: hand; }' .
'.dataTableContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; }' .
'.main { font-family: Verdana, Arial, sans-serif; font-size: 12px; }' .
'</style></head>' .
'<html><body background="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . 'flowers.jpg" style="background-repeat: no-repeat; background-attachment: fixed; background-position: bottom right;">' .
'<!-- body_text //--><center>' .
'<table border="0" width="700px" cellspacing="0" cellpadding="2">' .
'<tr>' .
'<td><table border="0" width="100%" cellspacing="0" cellpadding="0">'.
'<tr>' .
'<td class="pageHeading" align="left">' .
tep_image(HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . 'smallTitle.gif', 'Sunny Kid', '230', '59') .
'</td>' .
'</tr>' .
'</table></td>' .
'</tr>' .
'<tr>' .
'<td><table width="100%" border="0" cellspacing="0" cellpadding="2">' .
'<tr>' .
'<td colspan="2">' . tep_draw_separator() . '</td>' .
'</tr>' .
'<tr>' .
'<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">' .
'<tr>' .
'<td class="main"><b>' . EMAIL_TEXT_BILLING_ADDRESS . '</b></td>' .
'</tr>' .
'<tr>' .
'<td class="main">' . tep_address_label($customer_id, $billto, 0, '', "<BR>") . '</td>' .
'</tr>' .
'</table></td>' .
'<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">' .
'<tr>' .
'<td class="main"><b>' . EMAIL_TEXT_DELIVERY_ADDRESS . '</b></td>' .
'</tr>' .
'<tr>' .
'<td class="main">' . tep_address_label($customer_id, $sendto, 0, '', "<BR>") . '</TD>' .
'</tr>' .
'</table></td>' .
'</tr>' .
'</table></td>' .
'</tr>' .
'<tr>' .
'<td>' . tep_draw_separator('pixel_trans.gif', '1', '10') . '</td>' .
'</tr>' .
'<tr>' .
'<td class="main">' . EMAIL_TEXT_INVOICE_URL . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . '">' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) .'</a></td>' .
'</tr>' .
'<tr>' .
'<td><table border="1" width="100%" cellspacing="0" cellpadding="2">' .
'<tr bgcolor=#8CA2D6 class="dataTableHeadingRow">' .
'<td colspan="2" class="dataTableHeadingContent"><font color="#ffffff"><b>' . EMAIL_TEXT_PRODUCTS . '</b></font></td>';
$email_order .= '<td align="right" class="dataTableHeadingContent"><font color="#ffffff"><b>' .
strip_tags($order_totals[sizeof($order_totals) - 1]['title']) . '</b></font></td>' .
'</tr>';
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
$email_order .= ' <tr class="dataTableRow">' .
' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' .
' <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
for ($j = 0; $j < $k; $j++) {
$email_order .= '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
if ($order->products[$i]['attributes'][$j]['price'] != '0') $email_order .= ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
$email_order .= '</i></small></nobr>';
}
}
$email_order .= ' </td>';
// model line removed ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>'
$email_order .= ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>';
$email_order .= ' </tr>';
}
$email_order .= ' </table></tr><tr><td>';
//the totals table
$email_order .= '<table border="0" cellspacing="0" cellpadding="2" align=right>';
for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$email_order .= '<td class="dataTableContent" align="right" valign="top">' . strip_tags($order_totals[$i]['title']) . '</td>';
$email_order .= '<td class="dataTableContent" align="right" valign="top">';
if ($i == $n - 1){
$email_order .= '<b>' . strip_tags($order_totals[$i]['text']) . '</b></td></tr>';}
else{
$email_order .= strip_tags($order_totals[$i]['text']) . '</td></tr>';}
}
$email_order .= '</table></tr><tr><td class="main">';
//remove the old style invoice /* STORE_NAME . */ "\n" .
/* EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
EMAIL_TEXT_INVOICE_URL . ' <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . '">' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "</a>\n" .
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
}
$email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
EMAIL_SEPARATOR . "\n" .
$products_ordered .
EMAIL_SEPARATOR . "\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";
}
if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}
$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
*/
$email_order .= '<b>' . EMAIL_TEXT_PAYMENT_METHOD . ':</b> ' . $$payment->title .
'</td></tr><tr><td class="main">';
if (is_object($$payment)) {
/* $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
EMAIL_SEPARATOR . "\n"; */
$payment_class = $$payment;
// $email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) {
$email_order .= $payment_class->email_footer . '</td></tr></table>';
}
}
Bookmarks