2011-12-09 21:47:12 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Order Details
|
|
|
|
*/
|
|
|
|
|
|
|
|
global $woocommerce, $order_id;
|
|
|
|
|
2012-01-10 15:11:06 +00:00
|
|
|
$order = new woocommerce_order( $order_id );
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
2012-01-05 11:31:22 +00:00
|
|
|
<h2><?php _e('Order Details', 'woocommerce'); ?></h2>
|
2011-12-09 21:47:12 +00:00
|
|
|
<table class="shop_table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2012-01-05 11:31:22 +00:00
|
|
|
<th><?php _e('Product', 'woocommerce'); ?></th>
|
|
|
|
<th><?php _e('Qty', 'woocommerce'); ?></th>
|
|
|
|
<th><?php _e('Totals', 'woocommerce'); ?></th>
|
2011-12-09 21:47:12 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tfoot>
|
2012-01-04 23:01:47 +00:00
|
|
|
<?php
|
|
|
|
if ($totals = $order->get_order_item_totals()) foreach ($totals as $label => $value) :
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<th scope="row" colspan="2"><?php echo $label; ?></th>
|
|
|
|
<td><?php echo $value; ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
?>
|
2011-12-09 21:47:12 +00:00
|
|
|
</tfoot>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
if (sizeof($order->items)>0) :
|
|
|
|
|
|
|
|
foreach($order->items as $item) :
|
|
|
|
|
|
|
|
if (isset($item['variation_id']) && $item['variation_id'] > 0) :
|
2012-01-10 15:11:06 +00:00
|
|
|
$_product = new woocommerce_product_variation( $item['variation_id'] );
|
2011-12-09 21:47:12 +00:00
|
|
|
else :
|
2012-01-10 15:11:06 +00:00
|
|
|
$_product = new woocommerce_product( $item['id'] );
|
2011-12-09 21:47:12 +00:00
|
|
|
endif;
|
|
|
|
|
|
|
|
echo '
|
|
|
|
<tr>
|
|
|
|
<td class="product-name">'.$item['name'];
|
|
|
|
|
2012-01-10 15:11:06 +00:00
|
|
|
$item_meta = new order_item_meta( $item['item_meta'] );
|
2011-12-09 21:47:12 +00:00
|
|
|
$item_meta->display();
|
2011-12-19 17:50:41 +00:00
|
|
|
|
|
|
|
if ($_product->exists && $_product->is_downloadable() && $order->status=='completed') :
|
|
|
|
|
2012-01-05 11:31:22 +00:00
|
|
|
echo '<br/><small><a href="' . $order->get_downloadable_file_url( $item['id'], $item['variation_id'] ) . '">' . __('Download file →', 'woocommerce') . '</a></small>';
|
2011-12-19 17:50:41 +00:00
|
|
|
|
|
|
|
endif;
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2012-01-04 23:01:47 +00:00
|
|
|
echo '</td><td>'.$item['qty'].'</td><td>' . $order->get_item_subtotal($item) . '</td></tr>';
|
2011-12-09 21:47:12 +00:00
|
|
|
|
|
|
|
endforeach;
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<header>
|
2012-01-05 11:31:22 +00:00
|
|
|
<h2><?php _e('Customer details', 'woocommerce'); ?></h2>
|
2011-12-09 21:47:12 +00:00
|
|
|
</header>
|
|
|
|
<dl>
|
|
|
|
<?php
|
2012-01-05 11:31:22 +00:00
|
|
|
if ($order->billing_email) echo '<dt>'.__('Email:', 'woocommerce').'</dt><dd>'.$order->billing_email.'</dd>';
|
|
|
|
if ($order->billing_phone) echo '<dt>'.__('Telephone:', 'woocommerce').'</dt><dd>'.$order->billing_phone.'</dd>';
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
<div class="col2-set addresses">
|
|
|
|
|
|
|
|
<div class="col-1">
|
|
|
|
|
|
|
|
<header class="title">
|
2012-01-05 11:31:22 +00:00
|
|
|
<h3><?php _e('Billing Address', 'woocommerce'); ?></h3>
|
2011-12-09 21:47:12 +00:00
|
|
|
</header>
|
|
|
|
<address><p>
|
|
|
|
<?php
|
2012-01-05 11:31:22 +00:00
|
|
|
if (!$order->formatted_billing_address) _e('N/A', 'woocommerce'); else echo $order->formatted_billing_address;
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
|
|
|
</p></address>
|
|
|
|
|
|
|
|
</div><!-- /.col-1 -->
|
2011-12-21 16:03:45 +00:00
|
|
|
|
2011-12-09 21:47:12 +00:00
|
|
|
<div class="col-2">
|
|
|
|
|
|
|
|
<header class="title">
|
2012-01-05 11:31:22 +00:00
|
|
|
<h3><?php _e('Shipping Address', 'woocommerce'); ?></h3>
|
2011-12-09 21:47:12 +00:00
|
|
|
</header>
|
|
|
|
<address><p>
|
|
|
|
<?php
|
2012-01-05 11:31:22 +00:00
|
|
|
if (!$order->formatted_shipping_address) _e('N/A', 'woocommerce'); else echo $order->formatted_shipping_address;
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
|
|
|
</p></address>
|
|
|
|
|
|
|
|
</div><!-- /.col-2 -->
|
|
|
|
|
|
|
|
</div><!-- /.col2-set -->
|
|
|
|
|
|
|
|
<div class="clear"></div>
|