Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager - Version 2.4.14

Version Description

  • 2020-07-22 =
  • Fixed displaying empty address in user profile
Download this release

Release Info

Developer wpdesk
Plugin Icon wp plugin Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager
Version 2.4.14
Comparing to
See all releases

Code changes from version 2.4.13 to 2.4.14

classes/display-options.php CHANGED
@@ -121,6 +121,7 @@ class Flexible_Checkout_Fields_Disaplay_Options {
121
  $this->current_address_type = $address_type;
122
  WC()->countries->address_formats = '';
123
  $cf_fields = $this->getCheckoutFields( array(), $address_type );
 
124
  foreach ( $cf_fields as $field_key => $field ) {
125
  $fcf_field = new Flexible_Checkout_Fields_Field( $field, $this->plugin);
126
  if ( !isset( $address[$field['name']] ) ) {
@@ -135,8 +136,11 @@ class Flexible_Checkout_Fields_Disaplay_Options {
135
  }
136
 
137
  $meta_value = apply_filters( 'flexible_checkout_fields_user_meta_display_value', $meta_value, $field );
 
 
 
 
138
 
139
- $val .= $meta_value;
140
  $address[$field['name']] = $val;
141
  $address[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
142
  }
@@ -149,6 +153,23 @@ class Flexible_Checkout_Fields_Disaplay_Options {
149
  return $this->plugin->getCheckoutFields( $fields, $request_type );
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  /**
153
  * Append field to address format.
154
  *
121
  $this->current_address_type = $address_type;
122
  WC()->countries->address_formats = '';
123
  $cf_fields = $this->getCheckoutFields( array(), $address_type );
124
+ $is_empty_address = $this->check_if_address_is_empty ( $address );
125
  foreach ( $cf_fields as $field_key => $field ) {
126
  $fcf_field = new Flexible_Checkout_Fields_Field( $field, $this->plugin);
127
  if ( !isset( $address[$field['name']] ) ) {
136
  }
137
 
138
  $meta_value = apply_filters( 'flexible_checkout_fields_user_meta_display_value', $meta_value, $field );
139
+ $val .= $meta_value;
140
+ if ( $is_empty_address && ( $meta_value === '' ) ) {
141
+ $val = '';
142
+ }
143
 
 
144
  $address[$field['name']] = $val;
145
  $address[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
146
  }
153
  return $this->plugin->getCheckoutFields( $fields, $request_type );
154
  }
155
 
156
+ /**
157
+ * Checks if all values in address array are empty.
158
+ *
159
+ * @param string[] $address Array keys are field names and values are field values.
160
+ *
161
+ * @return bool Status if all values are empty string.
162
+ */
163
+ private function check_if_address_is_empty( array $address ) {
164
+ foreach ( $address as $field_key => $field_value ) {
165
+ if ( $field_value !== '' ) {
166
+ return false;
167
+ }
168
+ }
169
+
170
+ return true;
171
+ }
172
+
173
  /**
174
  * Append field to address format.
175
  *
flexible-checkout-fields.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Flexible Checkout Fields
4
  Plugin URI: https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/
5
  Description: Manage your WooCommerce checkout fields. Change order, labels, placeholders and add new fields.
6
- Version: 2.4.13
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
@@ -11,7 +11,7 @@
11
  Requires at least: 4.6
12
  Tested up to: 5.4.2
13
  WC requires at least: 3.8
14
- WC tested up to: 4.3
15
  Requires PHP: 5.6
16
 
17
  Copyright 2017 WP Desk Ltd.
@@ -39,7 +39,7 @@ if ( ! defined( 'ABSPATH' ) ) {
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
- $plugin_version = '2.4.13';
43
 
44
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
45
 
3
  Plugin Name: Flexible Checkout Fields
4
  Plugin URI: https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/
5
  Description: Manage your WooCommerce checkout fields. Change order, labels, placeholders and add new fields.
6
+ Version: 2.4.14
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
11
  Requires at least: 4.6
12
  Tested up to: 5.4.2
13
  WC requires at least: 3.8
14
+ WC tested up to: 4.4
15
  Requires PHP: 5.6
16
 
17
  Copyright 2017 WP Desk Ltd.
39
 
40
 
41
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
42
+ $plugin_version = '2.4.14';
43
 
44
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
45
 
lang/flexible-checkout-fields.pot CHANGED
@@ -7,8 +7,8 @@ msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "POT-Creation-Date: 2020-07-08T07:55:41+00:00\n"
11
- "PO-Revision-Date: 2020-07-08T07:55:41+00:00\n"
12
  "Language: \n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "POT-Creation-Date: 2020-07-22T21:41:12+00:00\n"
11
+ "PO-Revision-Date: 2020-07-22T21:41:12+00:00\n"
12
  "Language: \n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.wpdesk.net/flexible-checkout-fields-woocommerce/
5
  Tags: woocommerce checkout fields, woocommerce custom fields, woocommerce checkout manager, woocommerce checkout editor, woocommerce fields manager, woocommerce fields editor, woocommerce custom checkout fields, woocommerce checkout options, woocommerce checkout pro, woocommerce custom sections, woocommerce file upload
6
  Requires at least: 4.5
7
  Tested up to: 5.4.2
8
- Stable tag: 2.4.13
9
  Requires PHP: 5.6
10
  License: GPLv3 or later
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -187,6 +187,9 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
187
 
188
  == Changelog ==
189
 
 
 
 
190
  = 2.4.13 - 2020-07-08 =
191
  * Fixed SyntaxError in JavaScript
192
 
5
  Tags: woocommerce checkout fields, woocommerce custom fields, woocommerce checkout manager, woocommerce checkout editor, woocommerce fields manager, woocommerce fields editor, woocommerce custom checkout fields, woocommerce checkout options, woocommerce checkout pro, woocommerce custom sections, woocommerce file upload
6
  Requires at least: 4.5
7
  Tested up to: 5.4.2
8
+ Stable tag: 2.4.14
9
  Requires PHP: 5.6
10
  License: GPLv3 or later
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
187
 
188
  == Changelog ==
189
 
190
+ = 2.4.14 - 2020-07-22 =
191
+ * Fixed displaying empty address in user profile
192
+
193
  = 2.4.13 - 2020-07-08 =
194
  * Fixed SyntaxError in JavaScript
195
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit53035cc2ec6f1d8a855994cfe4f4a69f::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit53035cc2ec6f1d8a855994cfe4f4a69f
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit53035cc2ec6f1d8a855994cfe4f4a69f
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit53035cc2ec6f1d8a855994cfe4f4a69f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit53035cc2ec6f1d8a855994cfe4f4a69f', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit53035cc2ec6f1d8a855994cfe4f4a69f::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitbba39f5d6a23e65f3a64705cbb6d999f', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit53035cc2ec6f1d8a855994cfe4f4a69f
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
@@ -278,9 +278,9 @@ class ComposerStaticInit53035cc2ec6f1d8a855994cfe4f4a69f
278
  public static function getInitializer(ClassLoader $loader)
279
  {
280
  return \Closure::bind(function () use ($loader) {
281
- $loader->prefixLengthsPsr4 = ComposerStaticInit53035cc2ec6f1d8a855994cfe4f4a69f::$prefixLengthsPsr4;
282
- $loader->prefixDirsPsr4 = ComposerStaticInit53035cc2ec6f1d8a855994cfe4f4a69f::$prefixDirsPsr4;
283
- $loader->classMap = ComposerStaticInit53035cc2ec6f1d8a855994cfe4f4a69f::$classMap;
284
 
285
  }, null, ClassLoader::class);
286
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
278
  public static function getInitializer(ClassLoader $loader)
279
  {
280
  return \Closure::bind(function () use ($loader) {
281
+ $loader->prefixLengthsPsr4 = ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::$prefixLengthsPsr4;
282
+ $loader->prefixDirsPsr4 = ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::$prefixDirsPsr4;
283
+ $loader->classMap = ComposerStaticInitbba39f5d6a23e65f3a64705cbb6d999f::$classMap;
284
 
285
  }, null, ClassLoader::class);
286
  }