Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    18
    Plugin Contributions
    0

    help question 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?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default 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. #3
    ccoff Guest

    nice article

    ilikeyourarticleverymuch。

  4. #4
    Join Date
    Sep 2006
    Posts
    27
    Plugin Contributions
    1

    Default 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

    Code:
    $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

    Code:
    $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 . "'");
    and further down changed

    Code:
    $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:

    Code:
    $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;
    This works if there is only one product in the order that has no attributes. Problem I am having is trying to insert this bit to get loop, quantities, attributes etc.:

    Code:
    <?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'] . '&nbsp;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>&nbsp;<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";
    
        }
    
    ?>
    Any tips on inserting this into the email would be greatly appreciated! Thanks!

 

 

Similar Threads

  1. v151 New Order Email Admin Update order status missing?
    By wrickspam in forum Managing Customers and Orders
    Replies: 1
    Last Post: 7 May 2014, 09:46 PM
  2. Order status update email
    By Glock1 in forum General Questions
    Replies: 4
    Last Post: 6 Jun 2012, 05:15 AM
  3. Change Email Subject of Status Update Messages e.g. Order Update XXXX
    By apemusic in forum Managing Customers and Orders
    Replies: 4
    Last Post: 13 Oct 2010, 08:42 AM
  4. Order Update Status- email
    By Veronika7747 in forum Managing Customers and Orders
    Replies: 5
    Last Post: 12 Jun 2010, 10:40 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