Fixed an issue with the packing slip not showing up and revamped the packing slip to actually be useful.

git-svn-id: http://svn.cleancode.org/svn/pickles@129 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
Josh Sherman 2009-06-10 02:26:14 +00:00
parent fd55affaf0
commit 64bfd5d448
2 changed files with 51 additions and 9 deletions

View file

@ -34,13 +34,13 @@ class store_admin_orders_save extends store_admin {
);
');
// Sends the message to the customer
if ($_REQUEST['email_customer'] == 'on') {
$sender = new store_admin_orders_send($this->config, $this->db, $this->mailer, $this->error);
$sender->send($status_id, $status, $shipping_id, $shipping_method, $_REQUEST['shipping_note']);
// Generates the email to the customer and the packing slip
$sender = new store_admin_orders_send($this->config, $this->db, $this->mailer, $this->error);
$this->packing_slip = $sender->packing_slip;
}
// Sends the message to the customer
$sender->send($status_id, $status, $shipping_id, $shipping_method, $_REQUEST['shipping_note']);
$this->packing_slip = $sender->packing_slip;
$this->setPublic('status', 'Success');
$this->setPublic('message', 'The order has been updated successfully.');

View file

@ -76,11 +76,15 @@ Order Summary
$total_items = 0;
$packing_slip_rows = null;
// Loops through products
foreach ($order['products'] as $product) {
$message .= "
{$product['quantity']} - [{$product['sku']}] {$product['name']} {$product['description']} @ \${$product['price']} each";
$packing_slip_rows .= "<tr><td class='center'>{$product['quantity']}</td><td class='center'>{$product['sku']}</td><td>{$product['name']} {$product['description']}</td></tr>";
$total_items += $product['quantity'];
}
@ -115,10 +119,48 @@ Fax: {$this->config->store->fax}
URL: {$this->config->store->url}
";
mail($_REQUEST['email'], $this->config->store->title . ' - Order #' . $_REQUEST['id'] . ' - ' . $status, $message, 'From: ' . $this->config->store->return_email);
mail('josh.sherman@gmail.com, dekin@ribbonnutrition.com', 'CC: ' . $this->config->store->title . ' - Order #' . $_REQUEST['id'] . ' - ' . $status, $message, 'From: ' . $this->config->store->return_email);
if ($_REQUEST['email_customer'] == 'on') {
mail($_REQUEST['email'], $this->config->store->title . ' - Order #' . $_REQUEST['id'] . ' - ' . $status, $message, 'From: ' . $this->config->store->return_email);
mail('josh.sherman@gmail.com, dekin@ribbonnutrition.com', 'CC: ' . $this->config->store->title . ' - Order #' . $_REQUEST['id'] . ' - ' . $status, $message, 'From: ' . $this->config->store->return_email);
}
$this->packing_slip = $message;
$this->packing_slip = str_replace("\n", "", "
<h2>{$this->config->store->title} &mdash; Packing Slip</h2>
<table class='packing-slip'>
<tr>
<td width='50%'>
<h3>*{$_REQUEST['tracking_number']}*</h3><br />
" . ($order['total_amount'] > 0 ? "
<b>BILL TO</b><br /><br />
" . (trim($order['billing_company']) != '' ? $order['billing_company'] . '<br />' : '') . "
{$order['billing_first_name']} {$order['billing_last_name']}<br />
{$order['billing_address1']}<br />
" . (trim($order['billing_address2']) != '' ? $order['billing_address2'] . '<br />' : '') . "
{$order['billing_city']}, {$order['billing_state']} {$order['billing_zip_code']}<br /><br />
{$order['billing_phone']}<br /><br />" : '') . "
</td>
<td width='50%'>
<h3>{$shipping_method}</h3><br />
<b>SHIP TO</b><br /><br />
" . (trim($order['shipping_company']) != '' ? $order['shipping_company'] . '<br />' : '') . "
{$order['shipping_first_name']} {$order['shipping_last_name']}<br />
{$order['shipping_address1']}<br />
" . (trim($order['shipping_address2']) != '' ? $order['shipping_address2'] . '<br />' : '') . "
{$order['shipping_city']}, {$order['shipping_state']} {$order['shipping_zip_code']}<br /><br />
{$order['shipping_phone']}<br /><br />
{$_REQUEST['email']}
</td>
</tr>
</table>
<table class='packing-slip'>
<tr>
<th class='center'>Qty</th>
<th class='center'>SKU</th>
<th>Product Name</th>
</tr>
{$packing_slip_rows}
</table>
");
$this->setPublic('status', 'Success');
$this->setPublic('message', 'The latest update has been successfully resent to the customer.');