1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Order tracking |
4
|
|
|
* |
5
|
|
|
* This template can be overridden by copying it to yourtheme/woocommerce/order/tracking.php. |
6
|
|
|
* |
7
|
|
|
* HOWEVER, on occasion WooCommerce will need to update template files and you |
8
|
|
|
* (the theme developer) will need to copy the new files to your theme to |
9
|
|
|
* maintain compatibility. We try to do this as little as possible, but it does |
10
|
|
|
* happen. When this occurs the version of the template file will be bumped and |
11
|
|
|
* the readme will list any important changes. |
12
|
|
|
* |
13
|
|
|
* @see https://docs.woothemes.com/document/template-structure/ |
14
|
|
|
* @author WooThemes |
15
|
|
|
* @package WooCommerce/Templates |
16
|
|
|
* @version 2.2.0 |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
if ( ! defined( 'ABSPATH' ) ) { |
20
|
|
|
exit; // Exit if accessed directly |
21
|
|
|
} |
22
|
|
|
?> |
23
|
|
|
|
24
|
|
|
<p class="order-info"><?php |
25
|
|
|
echo wp_kses_post( apply_filters( 'woocommerce_order_tracking_status', sprintf( |
26
|
|
|
__( 'Order #%1$s was placed on %2$s and is currently %3$s.', 'woocommerce' ), |
27
|
|
|
'<mark class="order-number">' . $order->get_order_number() . '</mark>', |
28
|
|
|
'<mark class="order-date">' . date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ) . '</mark>', |
29
|
|
|
'<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>' |
30
|
|
|
) ) ); |
31
|
|
|
?></p> |
32
|
|
|
|
33
|
|
|
<?php if ( $notes = $order->get_customer_order_notes() ) : ?> |
34
|
|
|
<h2><?php _e( 'Order Updates', 'woocommerce' ); ?></h2> |
35
|
|
|
<ol class="commentlist notes"> |
36
|
|
View Code Duplication |
<?php foreach ( $notes as $note ) : ?> |
|
|
|
|
37
|
|
|
<li class="comment note"> |
38
|
|
|
<div class="comment_container"> |
39
|
|
|
<div class="comment-text"> |
40
|
|
|
<p class="meta"><?php echo date_i18n( __( 'l jS \o\f F Y, h:ia', 'woocommerce' ), strtotime( $note->comment_date ) ); ?></p> |
41
|
|
|
<div class="description"> |
42
|
|
|
<?php echo wpautop( wptexturize( $note->comment_content ) ); ?> |
43
|
|
|
</div> |
44
|
|
|
<div class="clear"></div> |
45
|
|
|
</div> |
46
|
|
|
<div class="clear"></div> |
47
|
|
|
</div> |
48
|
|
|
</li> |
49
|
|
|
<?php endforeach; ?> |
50
|
|
|
</ol> |
51
|
|
|
<?php endif; ?> |
52
|
|
|
|
53
|
|
|
<?php do_action( 'woocommerce_view_order', $order->id ); ?> |
54
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.