PluginProbe
PostNL for WooCommerce / 4.0.0
PostNL for WooCommerce v4.0.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-shipment-options.php

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

73 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use PostNL\WooCommerce\Includes\Admin\OrderSettingsRows;
4 use WPO\WC\PostNL\Entity\SettingsFieldArguments;
5
6 /**
7 * @var WC_Order $order
8 */
9
10 if (! defined('ABSPATH')) {
11 exit;
12 } // Exit if accessed directly
13
14 try {
15 $deliveryOptions = WCPOST_Admin::getDeliveryOptionsFromOrder($order);
16 } catch (Exception $e) {
17 return;
18 }
19
20 ?>
21 <div class="wcpn wcpn__shipment-options">
22 <table>
23 <?php
24
25 WCPOST_Admin::renderPickupLocation($deliveryOptions);
26
27 $optionRows = OrderSettingsRows::getOptionsRows($deliveryOptions, $order);
28 $optionRows = OrderSettingsRows::filterRowsByCountry($order->get_shipping_country(), $optionRows);
29
30 $namePrefix = WCPOST_Admin::SHIPMENT_OPTIONS_FORM_NAME . "[{$order->get_id()}]";
31
32 foreach ($optionRows as $optionRow) :
33 $class = new SettingsFieldArguments($optionRow, $namePrefix);
34
35 // Cast boolean values to the correct enabled/disabled values.
36 if (is_bool($optionRow["value"])) {
37 $optionRow["value"] = $optionRow["value"] ? WCPN_Settings_Data::ENABLED : WCPN_Settings_Data::DISABLED;
38 }
39
40 $class->setValue($optionRow["value"]);
41 ?>
42
43 <tr>
44 <td>
45 <label for="<?php echo $class->getName() ?>">
46 <?php echo $class->getArgument('label'); ?>
47 </label>
48 </td>
49 <td>
50 <?php
51 if (isset($optionRow['help_text'])) {
52 printf("<span class='ml-auto'>%s</span>", wc_help_tip($optionRow['help_text'], true));
53 }
54 ?>
55 </td>
56 <td>
57 <?php WCPN_Settings_Callbacks::renderField($class); ?>
58 </td>
59 </tr>
60 <?php endforeach; ?>
61 <tr>
62 <td colspan="2">
63 <div class="button wcpn__shipment-options__save">
64 <?php
65 _e("Save", "woocommerce-postnl");
66 WCPOST_Admin::renderSpinner();
67 ?>
68 </div>
69 </td>
70 </tr>
71 </table>
72 </div>
73