2011-12-09 21:47:12 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2012-08-14 18:05:45 +00:00
|
|
|
* Order details
|
|
|
|
*
|
2014-11-12 16:17:53 +00:00
|
|
|
* @author WooThemes
|
|
|
|
* @package WooCommerce/Templates
|
2015-01-17 22:21:11 +00:00
|
|
|
* @version 2.3.0
|
2011-12-09 21:47:12 +00:00
|
|
|
*/
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2014-09-22 16:31:03 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit; // Exit if accessed directly
|
|
|
|
}
|
2012-10-15 10:57:58 +00:00
|
|
|
|
2014-08-15 12:29:21 +00:00
|
|
|
$order = wc_get_order( $order_id );
|
2014-09-22 16:31:03 +00:00
|
|
|
|
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>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
2013-06-17 11:21:06 +00:00
|
|
|
if ( sizeof( $order->get_items() ) > 0 ) {
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2014-09-18 16:10:56 +00:00
|
|
|
foreach( $order->get_items() as $item_id => $item ) {
|
2013-06-17 11:21:06 +00:00
|
|
|
$_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
|
2014-02-24 15:14:32 +00:00
|
|
|
$item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product );
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
|
|
|
|
?>
|
|
|
|
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
|
|
|
|
<td class="product-name">
|
|
|
|
<?php
|
|
|
|
if ( $_product && ! $_product->is_visible() )
|
|
|
|
echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item );
|
|
|
|
else
|
|
|
|
echo apply_filters( 'woocommerce_order_item_name', sprintf( '<a href="%s">%s</a>', get_permalink( $item['product_id'] ), $item['name'] ), $item );
|
|
|
|
|
|
|
|
echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '× %s', $item['qty'] ) . '</strong>', $item );
|
2013-06-14 11:21:34 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
// allow other plugins to add additional product information here
|
|
|
|
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order );
|
2013-06-14 11:21:34 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
$item_meta->display();
|
2014-09-18 16:10:56 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
if ( $_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted() ) {
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
$download_files = $order->get_item_downloads( $item );
|
|
|
|
$i = 0;
|
|
|
|
$links = array();
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
foreach ( $download_files as $download_id => $file ) {
|
|
|
|
$i++;
|
2013-04-07 18:13:47 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
$links[] = '<small><a href="' . esc_url( $file['download_url'] ) . '">' . sprintf( __( 'Download file%s', 'woocommerce' ), ( count( $download_files ) > 1 ? ' ' . $i . ': ' : ': ' ) ) . esc_html( $file['name'] ) . '</a></small>';
|
|
|
|
}
|
2013-09-20 16:01:09 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
echo '<br/>' . implode( '<br/>', $links );
|
2013-06-17 11:21:06 +00:00
|
|
|
}
|
2013-03-10 16:24:04 +00:00
|
|
|
|
2014-12-05 07:22:09 +00:00
|
|
|
// allow other plugins to add additional product information here
|
|
|
|
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order );
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<td class="product-total">
|
|
|
|
<?php echo $order->get_formatted_line_subtotal( $item ); ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
2013-03-10 16:24:04 +00:00
|
|
|
|
2014-06-03 09:45:33 +00:00
|
|
|
if ( $order->has_status( array( 'completed', 'processing' ) ) && ( $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) ) {
|
2013-06-17 11:21:06 +00:00
|
|
|
?>
|
|
|
|
<tr class="product-purchase-note">
|
2014-10-21 07:09:20 +00:00
|
|
|
<td colspan="3"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td>
|
2013-06-17 11:21:06 +00:00
|
|
|
</tr>
|
|
|
|
<?php
|
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>
|
2014-07-11 01:50:51 +00:00
|
|
|
<tfoot>
|
|
|
|
<?php
|
2015-01-18 03:13:24 +00:00
|
|
|
$has_refund = false;
|
|
|
|
|
|
|
|
if ( $order->get_total_refunded() !== NULL ) {
|
|
|
|
$has_refund = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $totals = $order->get_order_item_totals() ) foreach ( $totals as $key => $total ) :
|
|
|
|
$value = $total['value'];
|
|
|
|
|
|
|
|
// check for refund
|
|
|
|
if ( $has_refund && $key === 'order_total' ) {
|
|
|
|
$value = '<del>' . strip_tags( $order->get_formatted_order_total() ) . '</del> <ins>' . wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_order_currency() ) ) . '</ins>';
|
|
|
|
}
|
2014-07-11 01:50:51 +00:00
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php echo $total['label']; ?></th>
|
2015-01-18 03:13:24 +00:00
|
|
|
<td><?php echo $value; ?></td>
|
2014-07-11 01:50:51 +00:00
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
2014-10-14 09:13:24 +00:00
|
|
|
|
2015-01-17 22:21:11 +00:00
|
|
|
// check for refund
|
2015-01-18 03:13:24 +00:00
|
|
|
if ( $has_refund ) {
|
2015-01-17 22:21:11 +00:00
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php _e( 'Refunded:', 'woocommerce' ); ?></th>
|
|
|
|
<td>-<?php echo wc_price( $order->get_total_refunded(), array( 'currency' => $order->get_order_currency() ) ); ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check for customer note
|
|
|
|
if ( '' != $order->customer_note ) {
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php _e( 'Note:', 'woocommerce' ); ?></th>
|
|
|
|
<td><?php echo wptexturize( $order->customer_note ); ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
2014-10-14 09:13:24 +00:00
|
|
|
?>
|
2014-07-11 01:50:51 +00:00
|
|
|
</tfoot>
|
2011-12-09 21:47:12 +00:00
|
|
|
</table>
|
|
|
|
|
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>
|
2014-10-16 16:00:56 +00:00
|
|
|
<table class="shop_table shop_table_responsive customer_details">
|
2011-12-09 21:47:12 +00:00
|
|
|
<?php
|
2014-10-16 16:00:56 +00:00
|
|
|
if ( $order->billing_email ) echo '<tr><th>' . __( 'Email:', 'woocommerce' ) . '</th><td data-title="' . __( 'Email', 'woocommerce' ) . '">' . $order->billing_email . '</td></tr>';
|
|
|
|
if ( $order->billing_phone ) echo '<tr><th>' . __( 'Telephone:', 'woocommerce' ) . '</th><td data-title="' . __( 'Telephone', 'woocommerce' ) . '">' . $order->billing_phone . '</td></tr>';
|
2013-10-25 10:54:49 +00:00
|
|
|
|
|
|
|
// Additional customer details hook
|
|
|
|
do_action( 'woocommerce_order_details_after_customer_details', $order );
|
2011-12-09 21:47:12 +00:00
|
|
|
?>
|
2014-10-16 16:00:56 +00:00
|
|
|
</table>
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2014-05-28 19:22:17 +00:00
|
|
|
<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?>
|
2012-03-02 12:41:32 +00:00
|
|
|
|
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>
|
2014-08-05 22:18:07 +00:00
|
|
|
<address>
|
2011-12-09 21:47:12 +00:00
|
|
|
<?php
|
2014-01-15 05:53:37 +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
|
|
|
?>
|
2014-08-05 22:18:07 +00:00
|
|
|
</address>
|
2011-12-09 21:47:12 +00:00
|
|
|
|
2014-05-28 19:22:17 +00:00
|
|
|
<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?>
|
2012-03-02 12:41:32 +00:00
|
|
|
|
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>
|
2014-08-05 22:18:07 +00:00
|
|
|
<address>
|
2011-12-09 21:47:12 +00:00
|
|
|
<?php
|
2014-01-15 05:53:37 +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
|
|
|
?>
|
2014-08-05 22:18:07 +00:00
|
|
|
</address>
|
2011-12-09 21:47:12 +00:00
|
|
|
|
|
|
|
</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>
|