2011-12-09 21:47:12 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2012-08-14 18:05:45 +00:00
|
|
|
* Order details
|
|
|
|
*
|
|
|
|
* @author WooThemes
|
|
|
|
* @package WooCommerce/Templates
|
2013-03-10 16:24:04 +00:00
|
|
|
* @version 2.0.3
|
2011-12-09 21:47:12 +00:00
|
|
|
*/
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2012-10-15 10:57:58 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
|
|
|
2012-02-03 16:17:35 +00:00
|
|
|
global $woocommerce;
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2012-01-27 16:38:39 +00:00
|
|
|
$order = new WC_Order( $order_id );
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
2012-10-16 09:45:33 +00:00
|
|
|
<h2><?php _e( 'Order Details', 'woocommerce' ); ?></h2>
|
2012-02-10 05:51:31 +00:00
|
|
|
<table class="shop_table order_details">
|
2011-12-09 21:47:12 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2012-10-16 09:45:33 +00:00
|
|
|
<th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th>
|
2012-12-19 18:43:29 +00:00
|
|
|
<th class="product-total"><?php _e( 'Total', 'woocommerce' ); ?></th>
|
2011-12-09 21:47:12 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tfoot>
|
2012-08-14 18:05:45 +00:00
|
|
|
<?php
|
2012-07-11 18:32:00 +00:00
|
|
|
if ( $totals = $order->get_order_item_totals() ) foreach ( $totals as $total ) :
|
2012-01-04 23:01:47 +00:00
|
|
|
?>
|
|
|
|
<tr>
|
2012-12-19 18:43:29 +00:00
|
|
|
<th scope="row"><?php echo $total['label']; ?></th>
|
2012-07-11 18:32:00 +00:00
|
|
|
<td><?php echo $total['value']; ?></td>
|
2012-01-04 23:01:47 +00:00
|
|
|
</tr>
|
2012-08-14 18:05:45 +00:00
|
|
|
<?php
|
|
|
|
endforeach;
|
2012-01-04 23:01:47 +00:00
|
|
|
?>
|
2011-12-09 21:47:12 +00:00
|
|
|
</tfoot>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
2013-03-10 16:24:04 +00:00
|
|
|
if (sizeof($order->get_items())>0) {
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2013-03-10 16:24:04 +00:00
|
|
|
foreach($order->get_items() as $item) {
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2012-11-21 18:07:45 +00:00
|
|
|
$_product = get_product( $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
|
2011-12-09 21:47:12 +00:00
|
|
|
|
|
|
|
echo '
|
2013-03-18 10:17:25 +00:00
|
|
|
<tr class = "' . esc_attr( apply_filters( 'woocommerce_order_table_item_class', 'order_table_item', $item, $order ) ) . '">
|
|
|
|
<td class="product-name">' .
|
|
|
|
apply_filters( 'woocommerce_order_table_product_title', '<a href="' . get_permalink( $item['product_id'] ) . '">' . $item['name'] . '</a>', $item ) . ' ' .
|
|
|
|
apply_filters( 'woocommerce_order_table_item_quantity', '<strong class="product-quantity">× ' . $item['qty'] . '</strong>', $item );
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2012-08-15 17:08:42 +00:00
|
|
|
$item_meta = new WC_Order_Item_Meta( $item['item_meta'] );
|
2011-12-09 21:47:12 +00:00
|
|
|
$item_meta->display();
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2013-03-10 16:24:04 +00:00
|
|
|
if ( $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted() ) {
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2012-12-05 16:13:08 +00:00
|
|
|
$download_file_urls = $order->get_downloadable_file_urls( $item['product_id'], $item['variation_id'], $item );
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2013-03-10 16:24:04 +00:00
|
|
|
$i = 0;
|
|
|
|
$links = array();
|
|
|
|
|
|
|
|
foreach ( $download_file_urls as $file_url => $download_file_url ) {
|
|
|
|
|
|
|
|
$links[] = '<small><a href="' . $download_file_url . '">' . sprintf( __( 'Download file%s', 'woocommerce' ), ( count( $download_file_urls ) > 1 ? ' ' . ( $i + 1 ) . ': ' : ': ' ) ) . basename( $file_url ) . '</a></small>';
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo implode( '<br/>', $links );
|
|
|
|
}
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2012-12-19 18:43:29 +00:00
|
|
|
echo '</td><td class="product-total">' . $order->get_formatted_line_subtotal( $item ) . '</td></tr>';
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2012-02-27 17:05:26 +00:00
|
|
|
// Show any purchase notes
|
2013-03-10 16:24:04 +00:00
|
|
|
if ($order->status=='completed' || $order->status=='processing') {
|
|
|
|
if ($purchase_note = get_post_meta( $_product->id, '_purchase_note', true))
|
2012-02-27 17:05:26 +00:00
|
|
|
echo '<tr class="product-purchase-note"><td colspan="3">' . apply_filters('the_content', $purchase_note) . '</td></tr>';
|
2013-03-10 16:24:04 +00:00
|
|
|
}
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2013-03-10 16:24:04 +00:00
|
|
|
}
|
|
|
|
}
|
2012-02-15 14:01:32 +00:00
|
|
|
|
2012-02-16 09:30:34 +00:00
|
|
|
do_action( 'woocommerce_order_items_table', $order );
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2012-03-15 12:15:22 +00:00
|
|
|
<?php if ( get_option('woocommerce_allow_customers_to_reorder') == 'yes' && $order->status=='completed' ) : ?>
|
2012-03-15 00:25:51 +00:00
|
|
|
<p class="order-again">
|
2012-10-16 09:45:33 +00:00
|
|
|
<a href="<?php echo esc_url( $woocommerce->nonce_url( 'order_again', add_query_arg( 'order_again', $order->id, add_query_arg( 'order', $order->id, get_permalink( woocommerce_get_page_id( 'view_order' ) ) ) ) ) ); ?>" class="button"><?php _e( 'Order Again', 'woocommerce' ); ?></a>
|
2012-03-15 00:25:51 +00:00
|
|
|
</p>
|
|
|
|
<?php endif; ?>
|
2012-03-14 13:44:51 +00:00
|
|
|
|
2012-06-15 12:22:51 +00:00
|
|
|
<?php do_action( 'woocommerce_order_details_after_order_table', $order ); ?>
|
|
|
|
|
2011-12-09 21:47:12 +00:00
|
|
|
<header>
|
2012-10-16 09:45:33 +00:00
|
|
|
<h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2>
|
2011-12-09 21:47:12 +00:00
|
|
|
</header>
|
2012-02-10 05:54:21 +00:00
|
|
|
<dl class="customer_details">
|
2011-12-09 21:47:12 +00:00
|
|
|
<?php
|
2012-10-16 09:45:33 +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>
|
|
|
|
|
2012-03-02 12:41:32 +00:00
|
|
|
<?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?>
|
|
|
|
|
2011-12-09 21:47:12 +00:00
|
|
|
<div class="col2-set addresses">
|
|
|
|
|
|
|
|
<div class="col-1">
|
|
|
|
|
2012-03-02 12:41:32 +00:00
|
|
|
<?php endif; ?>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2011-12-09 21:47:12 +00:00
|
|
|
<header class="title">
|
2012-10-16 09:45:33 +00:00
|
|
|
<h3><?php _e( 'Billing Address', 'woocommerce' ); ?></h3>
|
2011-12-09 21:47:12 +00:00
|
|
|
</header>
|
|
|
|
<address><p>
|
|
|
|
<?php
|
2012-10-16 09:45:33 +00:00
|
|
|
if (!$order->get_formatted_billing_address()) _e( 'N/A', 'woocommerce' ); else echo $order->get_formatted_billing_address();
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
|
|
|
</p></address>
|
|
|
|
|
2012-03-02 12:41:32 +00:00
|
|
|
<?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?>
|
|
|
|
|
2011-12-09 21:47:12 +00:00
|
|
|
</div><!-- /.col-1 -->
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2011-12-09 21:47:12 +00:00
|
|
|
<div class="col-2">
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2011-12-09 21:47:12 +00:00
|
|
|
<header class="title">
|
2012-10-16 09:45:33 +00:00
|
|
|
<h3><?php _e( 'Shipping Address', 'woocommerce' ); ?></h3>
|
2011-12-09 21:47:12 +00:00
|
|
|
</header>
|
|
|
|
<address><p>
|
|
|
|
<?php
|
2012-10-16 09:45:33 +00:00
|
|
|
if (!$order->get_formatted_shipping_address()) _e( 'N/A', 'woocommerce' ); else echo $order->get_formatted_shipping_address();
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
|
|
|
</p></address>
|
|
|
|
|
|
|
|
</div><!-- /.col-2 -->
|
|
|
|
|
|
|
|
</div><!-- /.col2-set -->
|
|
|
|
|
2012-03-02 12:41:32 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
|
2013-03-18 05:38:22 +00:00
|
|
|
<div class="clear"></div>
|