PluginProbe
PostNL for WooCommerce / 4.0.1
PostNL for WooCommerce v4.0.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 / migration / wcpn-upgrade-migration-v3-0-4.php

wcpn-upgrade-migration-v3-0-4.php in PostNL for WooCommerce 4.0.1, at migration/wcpn-upgrade-migration-v3-0-4.php

39 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (! defined('ABSPATH')) {
4 exit;
5 }
6
7 if (class_exists('WCPN_Upgrade_Migration_v3_0_4')) {
8 return new WCPN_Upgrade_Migration_v3_0_4();
9 }
10
11 /**
12 * Migrates pre v3.0.4 settings
13 */
14 class WCPN_Upgrade_Migration_v3_0_4
15 {
16 public function __construct()
17 {
18 $old_settings = get_option('woocommerce_postnl_checkout_settings');
19 $new_settings = $old_settings;
20
21 // Add/replace new settings
22 $new_settings['use_split_address_fields'] = '1';
23
24 // Rename signed to signature for consistency
25 $new_settings['signature_enabled'] = $old_settings['signed_enabled'];
26 $new_settings['signature_title'] = $old_settings['signed_title'];
27 $new_settings['signature_fee'] = $old_settings['signed_fee'];
28
29 // Remove old settings
30 unset($new_settings['signed_enabled']);
31 unset($new_settings['signed_title']);
32 unset($new_settings['signed_fee']);
33
34 update_option('woocommerce_postnl_checkout_settings', $new_settings);
35 }
36 }
37
38 new WCPN_Upgrade_Migration_v3_0_4();
39