PluginProbe
PostNL for WooCommerce / 4.4.1
PostNL for WooCommerce v4.4.1
5.9.12 5.9.11 5.9.10 5.9.9 5.9.8 5.9.7 5.9.6 trunk 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.1.4 3.1.5 3.1.6 3.1.7 4.0.0 4.0.1 4.0.2 4.3.2 4.3.3 4.4.0 4.4.1 All 72 releases
woo-postnl / includes / admin / views / html-order-track-trace-table.php

html-order-track-trace-table.php in PostNL for WooCommerce 4.4.1, at includes/admin/views/html-order-track-trace-table.php

75 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * This template is for the Track & Trace information in the PostNL meta box in a single order/
5 */
6
7 /**
8 * @var array $consignments
9 * @var int $order_id
10 * @var bool $downloadDisplay
11 */
12
13 $shipments = [];
14
15 try {
16 $shipments = WCPOST()->export->getShipmentData(array_keys($consignments), $order);
17 } catch (Exception $e) {
18 $message = $e->getMessage();
19 }
20
21 if (isset($message)) {
22 echo "<p>$message</p>";
23 }
24
25 /**
26 * Don't render the table if no shipments have been exported.
27 */
28 if (! count($shipments)) {
29 return;
30 }
31
32 ?>
33
34 <table class="wcpn__table--track-trace">
35 <thead>
36 <tr>
37 <th><?php _e("Track & Trace", "woocommerce-postnl"); ?></th>
38 <th><?php _e("Status", "woocommerce-postnl"); ?></th>
39 <th>&nbsp;</th>
40 </tr>
41 </thead>
42 <tbody>
43 <?php
44
45 foreach ($shipments as $shipment_id => $shipment):
46 $consignment = $shipments[$shipment_id];
47
48 ?>
49 <tr>
50 <td class="wcpn__order__track-trace">
51 <?php WCPOST_Admin::renderTrackTraceLink($shipment, $order_id); ?>
52 </td>
53 <td class="wcpn__order__status">
54 <?php WCPOST_Admin::renderStatus($shipment, $order_id) ?>
55 </td>
56 <td class="wcpn__td--create-label">
57 <?php
58 $action = WCPN_Export::EXPORT;
59 $getLabels = WCPN_Export::GET_LABELS;
60
61 $order = wc_get_order($order_id);
62 $returnShipmentId = $order->get_meta(WCPOST_Admin::META_RETURN_SHIPMENT_IDS);
63
64 WCPOST_Admin::renderAction(
65 admin_url("admin-ajax.php?action=$action&request=$getLabels&shipment_ids=$shipment_id&return_shipment_id=$returnShipmentId"),
66 __("Print PostNL label", "woocommerce-postnl"),
67 WCPOST()->plugin_url() . "/assets/img/postnl-print.png"
68 );
69 ?>
70 </td>
71 </tr>
72 <?php endforeach ?>
73 </tbody>
74 </table>
75