-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview-delivery.php
More file actions
138 lines (119 loc) · 5.06 KB
/
view-delivery.php
File metadata and controls
138 lines (119 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
/**
* 배송송장
*
* @version 1.0.0
* @package Planet8/Delivery_Tracking
* @category Templates
* @author gaegoms (gaegoms@gmail.com)
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$script = "
var wooshipping_delivery = {
init: function() {
$( '.wooshipping-delivery-tracking-trigger' ).on( 'click', this.open_tracking_popup );
$( '.wooshipping-delivery-receive-confirmation' ).on( 'click', this.confirmation );
},
open_tracking_popup: function(e) {
e.preventDefault();
var url = $( this ).data( 'href' );
var options = 'width=640, height=480, resizable=yes, scrollbars=yes, status=no;';
window.open( url, 'wooshipping-delivery', options );
},
confirmation: function() {
if ( confirm( '".__( 'Send receive confirmation. Are you sure?', PL_DELIVERY_LANG ) . "' ) ) {
location.href = '?set-receive-confirmation=' + $( this ).data( 'delivery' );
}
}
}.init();";
wc_enqueue_js( $script );
?>
<?php do_action( 'wooshipping_delivery_before_delivery_tracking' ); ?>
<h2>Shipping tracking</h2>
<div class="shop_table shipping-table-mobile">
<div class="tracking-table-head">
<div class="product-name">Product</div>
<div class="company-name"> </div>
<div class="tracking-no"> </div>
<div class="shipping-date"> </div>
<th> </th>
</div>
<div class="tracking-table-body">
<?php foreach ( $delivery->get_items() as $item_id => $item ) : ?>
<?php
$company_id = ! empty( $item['company_id'] ) ? $item['company_id'] : '';
$tracking_no = ! empty( $item['tracking_no'] ) ? $item['tracking_no'] : '';
$shipping_date = ! empty( $item['shipping_date'] ) ? $item['shipping_date'] : '';
$receipt_date = ! empty( $item['receipt_date'] ) ? $item['receipt_date'] : '';
?>
<?php if ( pl_get_delivery_company_name( $company_id ) === '미확인' ) { ?>
<?php $company = 'Preparing';
} else {
$company = pl_get_delivery_company_name( $company_id );
} ?>
<div class="tracking-table-list delivery-<?php echo $item_id; ?>">
<div class="tracking-content--product-name product-name"><a href="<?php echo get_permalink( $item['product_id'] ); ?>"><?php echo wp_trim_words( $item['name'], 26 ); ?></a> × <?php echo $item['qty']; ?></div>
<div class="company-no-date-receive">
<div class="tracking-content-wrapper tracking-content-wrapper--company-name">
<div class="tracking-content-label">Company</div>
<div class="tracking-content tracking-content--company-name"><?php echo $company; ?></div>
</div>
<div class="tracking-content-wrapper tracking-content-wrapper--tracking-no">
<div class="tracking-content-label">Shipping #</div>
<div class="tracking-content tracking-content--tracking-no">
<a href="#" data-href="<?php echo pl_get_delivery_tracking_url( $company_id, $tracking_no); ?>" class="wooshipping-delivery-tracking-trigger"><?php echo $tracking_no; ?></a>
</div>
</div>
<div class="tracking-content-wrapper tracking-content-wrapper--date">
<div class="tracking-content-label">Shipping date</div>
<div class="tracking-content shipping-date"><?php echo $shipping_date; ?></div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<table class="shop_table shipping-table-desktop">
<thead>
<tr>
<th class="product-name">Product</th>
<th class="company-name">Company</th>
<th class="tracking-no">Shipping#</th>
<th class="shipping-date">Date</th>
<!-- <th>Recieve</th> -->
</tr>
</thead>
<tbody>
<?php foreach ( $delivery->get_items() as $item_id => $item ) : ?>
<?php
$company_id = ! empty( $item['company_id'] ) ? $item['company_id'] : '';
$tracking_no = ! empty( $item['tracking_no'] ) ? $item['tracking_no'] : '';
$shipping_date = ! empty( $item['shipping_date'] ) ? $item['shipping_date'] : '';
$receipt_date = ! empty( $item['receipt_date'] ) ? $item['receipt_date'] : '';
?>
<tr class="delivery-<?php echo $item_id; ?>">
<td class="product-name"><a href="<?php echo get_permalink( $item['product_id'] ); ?>"><?php echo wp_trim_words( $item['name'], 26 ); ?></a> × <?php echo $item['qty']; ?></td>
<td class="company-name"><?php echo pl_get_delivery_company_name( $company_id ); ?></td>
<td class="tracking-no">
<a href="#" data-href="<?php echo pl_get_delivery_tracking_url( $company_id, $tracking_no); ?>" class="wooshipping-delivery-tracking-trigger"><?php echo $tracking_no; ?></a>
</td>
<td class="shipping-date"><?php echo $shipping_date; ?></td>
<!-- <td>
<?php
if ( ! empty( $shipping_date ) ) {
if ( ! empty( $receipt_date ) ) {
echo '<span title="' . $receipt_date . '">' . $receipt_date . '</span>';
} else {
echo '<a class="wooshipping-delivery-receive-confirmation button" data-delivery="' . $item_id . '">' . __( 'Receive Confirmation', PL_DELIVERY_LANG ) . '</a>';
}
}
?>
</td> -->
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p class="tracking-extra-description">+ If you click shipping number, you can check your shipping tracking more detail.</p>
<?php do_action( 'wooshipping_delivery_after_delivery_tracking' ); ?>