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 / compatibility / class-ce-compatibility.php

class-ce-compatibility.php in PostNL for WooCommerce 4.4.1, at includes/compatibility/class-ce-compatibility.php

35 lines 1023 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPO\WC\PostNL\Compatibility;
4
5 use WC_Order;
6 use WPO\WC\PostNL\Compatibility\Order as WCX_Order;
7
8 /**
9 * Class for compatibility with the ChannelEngine plugin.
10 *
11 * @see https://wordpress.org/plugins/channelengine-woocommerce
12 * @see https://github.com/channelengine/woocommerce
13 * @package WPO\WC\PostNL\Compatibility
14 */
15 class WCPN_ChannelEngine_Compatibility
16 {
17 /**
18 * Add the created Track & Trace code and set shipping method to postnl in ChannelEngine's meta data
19 *
20 * @param WC_Order $order
21 * @param $data
22 */
23 public static function updateMetaOnExport(WC_Order $order, $data)
24 {
25 if (! class_exists('Channel_Engine') || WCX_Order::has_meta($order, "_shipping_ce_track_and_trace")) {
26 return;
27 }
28
29 WCX_Order::update_meta_data($order, "_shipping_ce_track_and_trace", $data);
30
31 // Todo: Check if this has to be changed
32 WCX_Order::update_meta_data($order, "_shipping_ce_shipping_method", "PostNL");
33 }
34 }
35