WooCommerce Checkout Manager - Version 6.1.6

Version Description

Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WooCommerce Checkout Manager
Version 6.1.6
Comparing to
See all releases

Code changes from version 6.1.4 to 6.1.6

includes/view/frontend/class-wooccm-fields-i18n.php CHANGED
@@ -3,12 +3,11 @@
3
  class WOOCCM_Fields_i18n {
4
 
5
  protected static $_instance;
6
- protected static $domain = 'woocommerce';
7
 
8
  public function __construct() {
9
  add_action( 'init', array( $this, 'init_polylang' ) );
10
  add_action( 'admin_init', array( $this, 'init_wpml' ) );
11
- // add_filter( 'wooccm_checkout_field_filter', array( $this, 'translate_field' ) );
12
  }
13
 
14
  function init_polylang() {
@@ -110,6 +109,55 @@ class WOOCCM_Fields_i18n {
110
  }
111
  }
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  public static function instance() {
114
  if ( is_null( self::$_instance ) ) {
115
  self::$_instance = new self();
3
  class WOOCCM_Fields_i18n {
4
 
5
  protected static $_instance;
 
6
 
7
  public function __construct() {
8
  add_action( 'init', array( $this, 'init_polylang' ) );
9
  add_action( 'admin_init', array( $this, 'init_wpml' ) );
10
+ add_filter( 'wooccm_checkout_field_filter', array( $this, 'translate_field' ) );
11
  }
12
 
13
  function init_polylang() {
109
  }
110
  }
111
 
112
+
113
+
114
+ public function i18n( $string ) {
115
+
116
+ if ( function_exists( 'icl_t' ) ) {
117
+ return icl_t( 'woocommerce-checkout-manager', $string, $string );
118
+ } elseif ( function_exists( 'pll__' ) ) {
119
+ return pll__( $string );
120
+ }
121
+
122
+ return esc_html__( $string, 'woocommerce' );
123
+ }
124
+
125
+
126
+ public function translate( $value ) {
127
+ if ( ! empty( $value ) ) {
128
+
129
+ if ( is_array( $value ) ) {
130
+ foreach ( $value as $key => $name ) {
131
+ if ( is_string( $name ) ) {
132
+ $value[ $key ] = $this->i18n( $name );
133
+ }
134
+ }
135
+ }
136
+
137
+ if ( is_string( $value ) ) {
138
+ $value = $this->i18n( $value );
139
+ }
140
+ }
141
+
142
+ return $value;
143
+ }
144
+
145
+
146
+ public function translate_field( $field ) {
147
+ // ii18n
148
+ // -----------------------------------------------------------------------
149
+
150
+ if ( ! empty( $field['label'] ) ) {
151
+ $field['label'] = $this->translate( $field['label'] );
152
+ }
153
+
154
+ if ( ! empty( $field['placeholder'] ) ) {
155
+ $field['placeholder'] = $this->translate( $field['placeholder'] );
156
+ }
157
+
158
+ return $field;
159
+ }
160
+
161
  public static function instance() {
162
  if ( is_null( self::$_instance ) ) {
163
  self::$_instance = new self();
includes/view/frontend/class-wooccm-fields-register.php CHANGED
@@ -14,23 +14,27 @@ class WOOCCM_Fields_Register {
14
 
15
  // Billing fields
16
  // -----------------------------------------------------------------------
17
- // add_filter( 'woocommerce_billing_fields', array( $this, 'add_billing_fields' ), 999 );
18
  add_filter( 'woocommerce_checkout_fields', array( $this, 'add_billing_fields_beta' ), 999 );
19
 
20
  // Shipping fields
21
  // -----------------------------------------------------------------------
22
- // There is an issue when the Settings -> Shipping -> Hide shipping costs. Until an address is entered is activated
23
- // add_filter( 'woocommerce_shipping_fields', array( $this, 'add_shipping_fields' ), 999 );
24
  add_filter( 'woocommerce_checkout_fields', array( $this, 'add_shipping_fields_beta' ), 999 );
25
 
26
  // Additional fields
27
  // -----------------------------------------------------------------------
28
  add_filter( 'woocommerce_checkout_fields', array( $this, 'add_additional_fields' ), 999 );
29
 
 
 
 
 
 
30
  // My account
 
31
  // woocommerce 4.2 issue, the shipping and billing fields not working on my account when required field is empty
32
  // temporary fix excluding required fields in my account
33
- // add_filter('woocommerce_address_to_edit', array($this, 'add_my_account_fields'), 10, 2);
 
34
  }
35
 
36
  public static function instance() {
@@ -40,11 +44,6 @@ class WOOCCM_Fields_Register {
40
  return self::$_instance;
41
  }
42
 
43
- // public function add_billing_fields( $fields ) {
44
- // $wooccm_fields = WOOCCM()->billing->get_fields();
45
- // return array_merge( $fields, $wooccm_fields );
46
- // }
47
-
48
  public function add_billing_fields_beta( $fields ) {
49
  if ( ! isset( $fields['billing'] ) ) {
50
  return $fields;
@@ -65,11 +64,6 @@ class WOOCCM_Fields_Register {
65
  return $fields;
66
  }
67
 
68
- // public function add_shipping_fields( $fields ) {
69
- // $wooccm_fields = WOOCCM()->shipping->get_fields();
70
- // return array_merge( $fields, $wooccm_fields );
71
- // }
72
-
73
  public function add_shipping_fields_beta( $fields ) {
74
  if ( ! isset( $fields['shipping'] ) ) {
75
  return $fields;
@@ -102,7 +96,8 @@ class WOOCCM_Fields_Register {
102
  return $fields;
103
  }
104
 
105
- public function add_my_account_fields( $defaults, $load_address ) {
 
106
 
107
  if ( isset( WOOCCM()->$load_address ) ) {
108
 
@@ -130,24 +125,23 @@ class WOOCCM_Fields_Register {
130
  }
131
 
132
  return $defaults;
133
- }
134
-
135
- // public function add_keys( $fields ) {
136
- // $frontend_fields = array();
137
 
138
- // foreach ( $fields as $field_id => $field ) {
139
- // if ( ! empty( $field['key'] ) ) {
140
- // $frontend_fields[ $field['key'] ] = $field;
141
-
142
- // Preveser empty keys to revemo the core fields in the array_merge of the add_billing_fields|add_shipping_fields|add_additional_fields
143
- // if ( ! empty( $field['disabled'] ) ) {
144
- // $frontend_fields[ $field['key'] ] = null;
145
- // }
146
- // }
147
- // }
148
 
149
- // return $frontend_fields;
150
- // }
 
 
 
 
 
151
 
152
  public function add_keys( $fields ) {
153
  $frontend_fields = array();
14
 
15
  // Billing fields
16
  // -----------------------------------------------------------------------
 
17
  add_filter( 'woocommerce_checkout_fields', array( $this, 'add_billing_fields_beta' ), 999 );
18
 
19
  // Shipping fields
20
  // -----------------------------------------------------------------------
 
 
21
  add_filter( 'woocommerce_checkout_fields', array( $this, 'add_shipping_fields_beta' ), 999 );
22
 
23
  // Additional fields
24
  // -----------------------------------------------------------------------
25
  add_filter( 'woocommerce_checkout_fields', array( $this, 'add_additional_fields' ), 999 );
26
 
27
+ // Account beta
28
+ // -----------------------------------------------------------------------
29
+ add_filter( 'woocommerce_billing_fields', array( $this, 'add_account_billing_fields_beta' ), 999 );
30
+ add_filter( 'woocommerce_shipping_fields', array( $this, 'add_account_shipping_fields_beta' ), 999 );
31
+
32
  // My account
33
+ /*
34
  // woocommerce 4.2 issue, the shipping and billing fields not working on my account when required field is empty
35
  // temporary fix excluding required fields in my account
36
+ add_filter('woocommerce_address_to_edit', array($this, 'add_my_account_fields'), 10, 2);
37
+ */
38
  }
39
 
40
  public static function instance() {
44
  return self::$_instance;
45
  }
46
 
 
 
 
 
 
47
  public function add_billing_fields_beta( $fields ) {
48
  if ( ! isset( $fields['billing'] ) ) {
49
  return $fields;
64
  return $fields;
65
  }
66
 
 
 
 
 
 
67
  public function add_shipping_fields_beta( $fields ) {
68
  if ( ! isset( $fields['shipping'] ) ) {
69
  return $fields;
96
  return $fields;
97
  }
98
 
99
+ /*
100
+ public function add_my_account_fields( $defaults, $load_address ) {
101
 
102
  if ( isset( WOOCCM()->$load_address ) ) {
103
 
125
  }
126
 
127
  return $defaults;
128
+ } */
 
 
 
129
 
130
+ public function add_account_billing_fields_beta( $fields ) {
131
+ if ( ! is_account_page() ) {
132
+ return $fields;
133
+ }
134
+ $wooccm_fields = WOOCCM()->billing->get_fields();
135
+ return array_merge( $fields, $wooccm_fields );
136
+ }
 
 
 
137
 
138
+ public function add_account_shipping_fields_beta( $fields ) {
139
+ if ( ! is_account_page() ) {
140
+ return $fields;
141
+ }
142
+ $wooccm_fields = WOOCCM()->shipping->get_fields();
143
+ return array_merge( $fields, $wooccm_fields );
144
+ }
145
 
146
  public function add_keys( $fields ) {
147
  $frontend_fields = array();
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: checkout field editor, woocommerce checkout field editor, checkout manager
5
  Requires at least: 4.9
6
  Tested up to: 6.0.1
7
  Requires PHP: 5.6
8
- Stable tag: 6.1.4
9
  WC requires at least: 3.1.0
10
  WC tested up to: 6.7
11
  License: GPLv3
@@ -149,6 +149,12 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
149
 
150
  == Changelog ==
151
 
 
 
 
 
 
 
152
  = 6.1.4
153
  * Fix. string translations
154
 
@@ -164,8 +170,8 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
164
 
165
  = 6.1.0
166
  * Fix. WooCommerce Checkout force shipping address
167
- * Fix. WooCommerce Checkout WPML compatbility
168
- * New. WooCommerce Checkout Polylang compatbility
169
 
170
  = 6.0.9
171
  * Fix. WooCommerce Checkout required fields save
@@ -275,7 +281,7 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
275
  * Fix: php error
276
 
277
  = 5.4.0 =
278
- * Fix: WooCommerce compatbility
279
 
280
  = 5.3.9 =
281
  * Fix: address fields trigger shipping total change
@@ -288,7 +294,7 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
288
  * Fix: shipping address forced label click disabled
289
 
290
  = 5.3.6 =
291
- * Fix: WooCommerce compatbility
292
 
293
  = 5.3.5 =
294
  * Fix: select options order
@@ -349,10 +355,10 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
349
  * Fix: php errors
350
 
351
  = 5.1.7 =
352
- * Fix: premium compatbility
353
 
354
  = 5.1.6 =
355
- * Fix: premium compatbility
356
 
357
  = 5.1.5 =
358
  * Fix: undefined getDay
@@ -372,7 +378,7 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
372
 
373
  = 5.1.0 =
374
  * Fix: billing & shipping duplicated in order
375
- * Fix: php compatbility
376
 
377
  = 5.0.9 =
378
  * Fix: woocommerce checkout manager edit billing & shipping
@@ -721,7 +727,7 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
721
  * Changed: Cleaned up the code across the Plugin
722
 
723
  = 4.1.2.1 =
724
- * Fixed: WooCommerce 3.0 compatbility in wooccm_add_payment_method_to_new_order()
725
 
726
  = 4.1.2 =
727
  * Fixed: Show required indicator for Billing/Shipping Address 2
5
  Requires at least: 4.9
6
  Tested up to: 6.0.1
7
  Requires PHP: 5.6
8
+ Stable tag: 6.1.6
9
  WC requires at least: 3.1.0
10
  WC tested up to: 6.7
11
  License: GPLv3
149
 
150
  == Changelog ==
151
 
152
+ = 6.1.6
153
+ * Fix. WooCommerce Account fields
154
+
155
+ = 6.1.5
156
+ * Fix. WPML compatibility
157
+
158
  = 6.1.4
159
  * Fix. string translations
160
 
170
 
171
  = 6.1.0
172
  * Fix. WooCommerce Checkout force shipping address
173
+ * Fix. WooCommerce Checkout WPML compatibility
174
+ * New. WooCommerce Checkout Polylang compatibility
175
 
176
  = 6.0.9
177
  * Fix. WooCommerce Checkout required fields save
281
  * Fix: php error
282
 
283
  = 5.4.0 =
284
+ * Fix: WooCommerce compatibility
285
 
286
  = 5.3.9 =
287
  * Fix: address fields trigger shipping total change
294
  * Fix: shipping address forced label click disabled
295
 
296
  = 5.3.6 =
297
+ * Fix: WooCommerce compatibility
298
 
299
  = 5.3.5 =
300
  * Fix: select options order
355
  * Fix: php errors
356
 
357
  = 5.1.7 =
358
+ * Fix: premium compatibility
359
 
360
  = 5.1.6 =
361
+ * Fix: premium compatibility
362
 
363
  = 5.1.5 =
364
  * Fix: undefined getDay
378
 
379
  = 5.1.0 =
380
  * Fix: billing & shipping duplicated in order
381
+ * Fix: php compatibility
382
 
383
  = 5.0.9 =
384
  * Fix: woocommerce checkout manager edit billing & shipping
727
  * Changed: Cleaned up the code across the Plugin
728
 
729
  = 4.1.2.1 =
730
+ * Fixed: WooCommerce 3.0 compatibility in wooccm_add_payment_method_to_new_order()
731
 
732
  = 4.1.2 =
733
  * Fixed: Show required indicator for Billing/Shipping Address 2
woocommerce-checkout-manager.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Checkout Fields Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
7
- * Version: 6.1.4
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -20,7 +20,7 @@ if ( ! defined( 'WOOCCM_PLUGIN_NAME' ) ) {
20
  define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
21
  }
22
  if ( ! defined( 'WOOCCM_PLUGIN_VERSION' ) ) {
23
- define( 'WOOCCM_PLUGIN_VERSION', '6.1.4' );
24
  }
25
  if ( ! defined( 'WOOCCM_PLUGIN_FILE' ) ) {
26
  define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
4
  * Plugin Name: Checkout Fields Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
7
+ * Version: 6.1.6
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
20
  define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
21
  }
22
  if ( ! defined( 'WOOCCM_PLUGIN_VERSION' ) ) {
23
+ define( 'WOOCCM_PLUGIN_VERSION', '6.1.6' );
24
  }
25
  if ( ! defined( 'WOOCCM_PLUGIN_FILE' ) ) {
26
  define( 'WOOCCM_PLUGIN_FILE', __FILE__ );