Forums / General Questions / Adding order details to status update email

Adding order details to status update email

Locked

Views: 1,951

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
20 May 2008, 1:10 AM
#1
nosnappyname avatar

nosnappyname

New Zenner

Join Date:
May 2008
Posts:
18
Plugin Contributions:
0

Adding order details to status update email

My client wants to include the details shown on the order confirmation email (products, sub-total, shipping tax and total) to each email sent as a result of a status update.

Any ideas which table I should use and if there is some code I can model a solution on?

20 May 2008, 1:22 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Adding order details to status update email

You will have to look towards the files that recall the order in the admin side and copy the snippits that you need

Zen-Venom Get Bitten

3 Jun 2008, 3:47 AM
#3
haasplay avatar

haasplay

New Zenner

Join Date:
Sep 2006
Posts:
27
Plugin Contributions:
1

Re: Adding order details to status update email

I am need of this as well and have made some progress but have hit a roadblock... wondering if anyone can help me out.

in admin/orders.php I have changed

$order_updated = false;

        $check_status = $db->Execute("select customers_name, customers_email_address, orders_status,

                                      date_purchased from " . TABLE_ORDERS . "

                                      where orders_id = '" . (int)$oID . "'");
```to

$order_updated = false;

    $check_status = $db->Execute("select o.customers_name, o.customers_email_address, o.delivery_name, o.delivery_company, o.delivery_street_address, o.delivery_suburb, o.delivery_city, o.delivery_postcode, o.delivery_state, o.delivery_country, o.orders_status,

                                  op.products_name, op.products_price,
                                  o.date_purchased 
                                  from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op
                                  where o.orders_id = op.orders_id 

                                  and o.orders_id = '" . (int)$oID . "'");

$message = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" .

      EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" .

      EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" .

      EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .

      strip_tags($notify_comments) .

      EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) .

      EMAIL_TEXT_STATUS_PLEASE_REPLY;
to:

$message = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" .

      EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" .

      EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" .

      EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .

      strip_tags($notify_comments) .

      EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) .
      EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . $check_status->fields['delivery_name'] . "\n" . $check_status->fields['delivery_street_address'] . "\n"  . $check_status->fields['delivery_city'] . "," .  $check_status->fields['delivery_state'] . " " . $check_status->fields['delivery_postcode'] . "\n" . $check_status->fields['delivery_country'] . "\n" . $check_status->fields['delivery_suburb'] . "\n" .

      EMAIL_TEXT_COMPANY . $check_status->fields['delivery_company'] . "\n\n" .
      EMAIL_TEXT_PRODUCTS_ORDERED . "\n" . $check_status->fields['products_name'] . "  " . $check_status->fields['products_price'] . "\n\n" .
      EMAIL_TEXT_STATUS_PLEASE_REPLY;

<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr class="dataTableRow">' . "\n" . ' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name']; if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) { for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) { echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])); if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $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']) . ')'; if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE; echo '</i></small></nobr>'; } } echo ' </td>' . "\n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top">' . zen_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format($order->products[$i]['onetime_charges'], true, $order->info['currency'], $order->info['currency_value']) : '') . '</strong></td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format(zen_add_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) : '') . '</strong></td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format($order->products[$i]['onetime_charges'], true, $order->info['currency'], $order->info['currency_value']) : '') . '</strong></td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format(zen_add_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) : '') . '</strong></td>' . "\n"; echo ' </tr>' . "\n"; } ?>