PluginProbe
PostNL for WooCommerce / 4.4.0
PostNL for WooCommerce v4.4.0
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-return-shipment-options.php

html-order-return-shipment-options.php in PostNL for WooCommerce 4.4.0, at includes/admin/views/html-order-return-shipment-options.php

65 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment;
6
7 if (! defined('ABSPATH')) {
8 exit;
9 } // Exit if accessed directly
10
11 /**
12 * @var \WC_Order $order
13 * @var int $order_id
14 */
15
16 /** @noinspection PhpUnhandledExceptionInspection */
17 $orderSettings = new OrderSettings($order);
18
19 ?>
20 <table class="wcpn__settings-table" style="width: auto">
21 <tr>
22 <td>
23 <?php _e("Shipment type", "woocommerce-postnl") ?>:<br/> <small class="calculated_weight">
24 <?php printf(
25 __("calculated_order_weight", "woocommerce-postnl"),
26 wc_format_weight($orderSettings->getWeight())
27 ) ?>
28 </small>
29 </td>
30 <td>
31 <?php
32 $name = "postnl_options[{$order_id}][package_type]";
33 printf('<select name="%s" class="package_type">', $name);
34 foreach (WCPN_Data::getPackageTypesHuman() as $key => $label) {
35 $isReturnPackageType = in_array(
36 $key,
37 [
38 AbstractConsignment::PACKAGE_TYPE_PACKAGE_NAME,
39 AbstractConsignment::PACKAGE_TYPE_MAILBOX_NAME,
40 ]
41 );
42
43 if (! $isReturnPackageType) {
44 return;
45 }
46
47 printf(
48 '<option value="%s">%s</option>',
49 WCPN_Data::getPackageTypeId($key),
50 $label
51 );
52 }
53 echo '</select>';
54 ?>
55 </td>
56 </tr>
57 </table><br>
58 <?php if (! isset($skip_save)): ?>
59 <div class="wcpn__d--flex">
60 <a class="button save" data-order="<?php echo $order_id; ?>"><?php _e("Save", "woocommerce-postnl") ?>
61 <?php WCMYPA_Admin::renderSpinner() ?>
62 </a>
63 </div>
64 <?php endif ?>
65