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

Version Description

  • 2020-03-10 =
  • Added formatting for billing and shipping fields on pages and emails
Download this release

Release Info

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

Code changes from version 2.4.0 to 2.4.1

classes/class-flexible-checkout-fields-plugin.php CHANGED
@@ -304,11 +304,11 @@ class Flexible_Checkout_Fields_Plugin extends \FcfVendor\WPDesk\PluginBuilder\Pl
304
  }
305
 
306
  private function init_fields() {
307
- $this->fields['text'] = array(
308
  'name' => __( 'Single Line Text', 'flexible-checkout-fields' )
309
  );
310
 
311
- $this->fields['textarea'] = array(
312
  'name' => __( 'Paragraph Text', 'flexible-checkout-fields' )
313
  );
314
  }
@@ -513,10 +513,8 @@ class Flexible_Checkout_Fields_Plugin extends \FcfVendor\WPDesk\PluginBuilder\Pl
513
  if ( apply_filters( 'flexible_checkout_fields_condition', true, $field ) ) {
514
  if ( $field['visible'] == 0 or
515
  ( ( isset( $_GET['page'] ) && $_GET['page'] == 'inspire_checkout_fields_settings' ) && $field['visible'] == 1 ) || $field['name'] == 'billing_country' || $field['name'] == 'shipping_country' ) {
516
- $custom_field = false;
517
- if ( isset( $field['custom_field'] ) && $field['custom_field'] == 1 ) {
518
- $custom_field = true;
519
- }
520
  if ( isset( $fields[ $key ][ $field['name'] ] ) ) {
521
  $new[ $key ][ $field['name'] ] = $fields[ $key ][ $field['name'] ];
522
  } else {
@@ -589,6 +587,10 @@ class Flexible_Checkout_Fields_Plugin extends \FcfVendor\WPDesk\PluginBuilder\Pl
589
  }
590
 
591
  $new[ $key ][ $field['name'] ]['custom_attributes'] = apply_filters( 'flexible_checkout_fields_custom_attributes', $custom_attributes, $field );
 
 
 
 
592
  }
593
  }
594
  }
304
  }
305
 
306
  private function init_fields() {
307
+ $this->fields[ Flexible_Checkout_Fields_Field_Type::FIELD_TYPE_TEXT ] = array(
308
  'name' => __( 'Single Line Text', 'flexible-checkout-fields' )
309
  );
310
 
311
+ $this->fields[ Flexible_Checkout_Fields_Field_Type::FIELD_TYPE_TEXTAREA ] = array(
312
  'name' => __( 'Paragraph Text', 'flexible-checkout-fields' )
313
  );
314
  }
513
  if ( apply_filters( 'flexible_checkout_fields_condition', true, $field ) ) {
514
  if ( $field['visible'] == 0 or
515
  ( ( isset( $_GET['page'] ) && $_GET['page'] == 'inspire_checkout_fields_settings' ) && $field['visible'] == 1 ) || $field['name'] == 'billing_country' || $field['name'] == 'shipping_country' ) {
516
+ $fcf_field = new Flexible_Checkout_Fields_Field( $field, $this );
517
+ $custom_field = $fcf_field->is_custom_field();
 
 
518
  if ( isset( $fields[ $key ][ $field['name'] ] ) ) {
519
  $new[ $key ][ $field['name'] ] = $fields[ $key ][ $field['name'] ];
520
  } else {
587
  }
588
 
589
  $new[ $key ][ $field['name'] ]['custom_attributes'] = apply_filters( 'flexible_checkout_fields_custom_attributes', $custom_attributes, $field );
590
+
591
+ if ( '' !== $fcf_field->get_default() ) {
592
+ $new[ $key ][ $field['name'] ]['default'] = wpdesk__( $fcf_field->get_default(), 'flexible-checkout-fields' );
593
+ }
594
  }
595
  }
596
  }
classes/display-options.php CHANGED
@@ -122,9 +122,10 @@ class Flexible_Checkout_Fields_Disaplay_Options {
122
  WC()->countries->address_formats = '';
123
  $cf_fields = $this->getCheckoutFields( array(), $address_type );
124
  foreach ( $cf_fields as $field_key => $field ) {
 
125
  if ( !isset( $address[$field['name']] ) ) {
126
  $val = '';
127
- if ( isset( $field['custom_field'] ) && $field['custom_field'] == 1 ) {
128
  $val .= strip_tags( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ) . ': ';
129
  }
130
 
@@ -140,6 +141,7 @@ class Flexible_Checkout_Fields_Disaplay_Options {
140
  $address[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
141
  }
142
  }
 
143
  return $address;
144
  }
145
 
@@ -162,19 +164,19 @@ class Flexible_Checkout_Fields_Disaplay_Options {
162
  ) {
163
  return $format;
164
  }
 
165
  if ( isset( $field['type'] ) && in_array( $field['type'], array( 'heading', 'info' ) ) ) {
166
  return $format;
167
  }
168
  if ( $this->is_field_displayable( $field ) ) {
169
  if ( $format != '' ) {
170
- $format .= "\n";
171
- }
172
- if ( $field['name'] === $this->current_address_type . '_last_name' || $field['name'] === $this->current_address_type . '_postcode' ) {
173
- unset($field['name']);
174
- }
175
- if ( isset( $field['name'] ) ) {
176
- $format .= '{' . $this->replace_only_first( $this->current_address_type . '_', '', $field['name'] . '}' );
177
  }
 
178
  }
179
 
180
  return $format;
@@ -200,12 +202,11 @@ class Flexible_Checkout_Fields_Disaplay_Options {
200
  ) {
201
  $default_format = '';
202
  foreach ( $fields as $field_key => $field ) {
203
-
204
  $default_format = $this->append_field_to_address_format( $default_format, $field_key, $field );
205
  }
206
  }
207
- $new_formats = array( 'default' => $default_format );
208
- return $new_formats;
209
  }
210
 
211
  private function is_field_displayable( $field ) {
@@ -279,16 +280,12 @@ class Flexible_Checkout_Fields_Disaplay_Options {
279
  }
280
 
281
  public function woocommerce_formatted_address_replacements( $fields, $args ) {
282
-
283
- $fields = $this->unset_not_correct_formatted_address_data( $fields );
284
  foreach ( $args as $arg_key => $arg ) {
285
  if ( !isset( $fields['{' . $arg_key . '}'] ) ) {
286
  $fields['{' . $arg_key . '}'] = $arg;
287
  }
288
- if ( isset( $fields['{postcode}'] ) ) {
289
- $fields['{postcode}'] = '';
290
- }
291
  }
 
292
  return $fields;
293
  }
294
 
@@ -298,28 +295,6 @@ class Flexible_Checkout_Fields_Disaplay_Options {
298
  return $this->woocommerce_order_formatted_address( $fields, $order, 'billing' );
299
  }
300
 
301
- /**
302
- * Display customer details in correct way
303
- *
304
- * @param array $fields
305
- *
306
- * @return array [{first_name} => James Cameron, {address} => Awesome Street]
307
- */
308
- private function unset_not_correct_formatted_address_data( $fields ) {
309
- if ( ! empty( $fields ) ) {
310
- if ( isset( $fields['{first_name}'] ) && isset( $fields['{last_name}'] ) ) {
311
- $fields['{first_name}'] .= ' ' . $fields['{last_name}'];
312
- unset($fields['{last_name}']);
313
- }
314
- if ( isset( $fields['{city}'] ) && isset( $fields['{postcode}'] ) ) {
315
- $fields['{city}'] .= ' ' . $fields['{postcode}'];
316
- unset($fields['{postcode}']);
317
- }
318
- }
319
-
320
- return $fields;
321
- }
322
-
323
  /**
324
  * Replaces field meta value using field options
325
  *
@@ -361,9 +336,12 @@ class Flexible_Checkout_Fields_Disaplay_Options {
361
 
362
  foreach ( $cf_fields as $field_key => $field ) {
363
  $val = wpdesk_get_order_meta( $order, '_' . $field_key, true );
 
364
  if ( (isset( $field['custom_field'] ) && $field['custom_field'] == '1')) {
365
-
366
- $val = strip_tags( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ) . ': ';
 
 
367
 
368
  $meta_value = wpdesk_get_order_meta( $order, '_' . $field_key, true );
369
 
@@ -380,8 +358,8 @@ class Flexible_Checkout_Fields_Disaplay_Options {
380
  $fields[$field['name']] = esc_html($val);
381
  $fields[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
382
  }
383
- return $fields;
384
 
 
385
  }
386
 
387
  /**
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']] ) ) {
127
  $val = '';
128
+ if ( $fcf_field->is_custom_field() && $fcf_field->get_display_on_option_show_label() === '1' ) {
129
  $val .= strip_tags( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ) . ': ';
130
  }
131
 
141
  $address[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
142
  }
143
  }
144
+
145
  return $address;
146
  }
147
 
164
  ) {
165
  return $format;
166
  }
167
+ $fcf_field = new Flexible_Checkout_Fields_Field( $field, $this->plugin );
168
  if ( isset( $field['type'] ) && in_array( $field['type'], array( 'heading', 'info' ) ) ) {
169
  return $format;
170
  }
171
  if ( $this->is_field_displayable( $field ) ) {
172
  if ( $format != '' ) {
173
+ if ( $fcf_field->get_display_on_option_new_line_before() === '1' ) {
174
+ $format .= "\n";
175
+ } else {
176
+ $format .= ' ';
177
+ }
 
 
178
  }
179
+ $format .= '{' . $this->replace_only_first( $this->current_address_type . '_', '', $field['name'] . '}' );
180
  }
181
 
182
  return $format;
202
  ) {
203
  $default_format = '';
204
  foreach ( $fields as $field_key => $field ) {
 
205
  $default_format = $this->append_field_to_address_format( $default_format, $field_key, $field );
206
  }
207
  }
208
+
209
+ return array( 'default' => $default_format );
210
  }
211
 
212
  private function is_field_displayable( $field ) {
280
  }
281
 
282
  public function woocommerce_formatted_address_replacements( $fields, $args ) {
 
 
283
  foreach ( $args as $arg_key => $arg ) {
284
  if ( !isset( $fields['{' . $arg_key . '}'] ) ) {
285
  $fields['{' . $arg_key . '}'] = $arg;
286
  }
 
 
 
287
  }
288
+
289
  return $fields;
290
  }
291
 
295
  return $this->woocommerce_order_formatted_address( $fields, $order, 'billing' );
296
  }
297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  /**
299
  * Replaces field meta value using field options
300
  *
336
 
337
  foreach ( $cf_fields as $field_key => $field ) {
338
  $val = wpdesk_get_order_meta( $order, '_' . $field_key, true );
339
+ $fcf_field = new Flexible_Checkout_Fields_Field( $field, $this->plugin );
340
  if ( (isset( $field['custom_field'] ) && $field['custom_field'] == '1')) {
341
+ $val = '';
342
+ if ( $fcf_field->is_custom_field() && $fcf_field->get_display_on_option_show_label() === '1' ) {
343
+ $val = strip_tags( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ) . ': ';
344
+ }
345
 
346
  $meta_value = wpdesk_get_order_meta( $order, '_' . $field_key, true );
347
 
358
  $fields[$field['name']] = esc_html($val);
359
  $fields[$this->replace_only_first( $address_type . '_', '', $field['name'] )] = $val;
360
  }
 
361
 
362
+ return $fields;
363
  }
364
 
365
  /**
classes/field-type.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Field type settings.
5
+ */
6
+ class Flexible_Checkout_Fields_Field_Type {
7
+
8
+ const FIELD_TYPE_TEXT = 'text';
9
+ const FIELD_TYPE_TEXTAREA = 'textarea';
10
+
11
+ /**
12
+ * Field type data.
13
+ *
14
+ * @var array
15
+ */
16
+ private $field_type_data;
17
+
18
+ public function __construct( array $field_type_data ) {
19
+ $this->field_type_data = $field_type_data;
20
+ }
21
+
22
+ /**
23
+ * .
24
+ *
25
+ * @return bool
26
+ */
27
+ public function has_options() {
28
+ return isset( $this->field_type_data['has_options'] ) && $this->field_type_data['has_options'];
29
+ }
30
+
31
+ /**
32
+ * .
33
+ *
34
+ * @return bool
35
+ */
36
+ public function has_default_value() {
37
+ return isset( $this->field_type_data['has_default_value'] ) && $this->field_type_data['has_default_value'];
38
+ }
39
+
40
+ }
classes/field.php CHANGED
@@ -1,17 +1,23 @@
1
  <?php
2
 
3
  /**
4
- * Class Flexible_Checkout_Fields_Field
5
  */
6
  class Flexible_Checkout_Fields_Field {
7
 
8
  const FIELD_TYPE = 'type';
9
  const FIELD_CUSTOM_FIELD = 'custom_field';
10
  const FIELD_VISIBLE = 'visible';
 
 
 
 
11
 
12
  const FIELD_TYPE_EXCLUDE_IN_ADMIN = 'exclude_in_admin';
13
  const FIELD_TYPE_EXCLUDE_FOR_USER = 'exclude_for_user';
14
 
 
 
15
  /**
16
  * Field data.
17
  *
@@ -37,6 +43,52 @@ class Flexible_Checkout_Fields_Field {
37
  $this->field_data = $field_data;
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  /**
41
  * Get field types from plugin.
42
  *
@@ -122,5 +174,61 @@ class Flexible_Checkout_Fields_Field {
122
  return false;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  }
1
  <?php
2
 
3
  /**
4
+ * Checkout field settings.
5
  */
6
  class Flexible_Checkout_Fields_Field {
7
 
8
  const FIELD_TYPE = 'type';
9
  const FIELD_CUSTOM_FIELD = 'custom_field';
10
  const FIELD_VISIBLE = 'visible';
11
+ const FIELD_DEFAULT = 'default';
12
+
13
+ const FIELD_DISPLAY_ON_OPTION_NEW_LINE_BEFORE = 'display_on_option_new_line_before';
14
+ const FIELD_DISPLAY_ON_OPTION_SHOW_LABEL = 'display_on_option_show_label';
15
 
16
  const FIELD_TYPE_EXCLUDE_IN_ADMIN = 'exclude_in_admin';
17
  const FIELD_TYPE_EXCLUDE_FOR_USER = 'exclude_for_user';
18
 
19
+ const DEFAULT_FIELD_TYPE = Flexible_Checkout_Fields_Field_Type::FIELD_TYPE_TEXT;
20
+
21
  /**
22
  * Field data.
23
  *
43
  $this->field_data = $field_data;
44
  }
45
 
46
+ /**
47
+ * @param array $field_data Field data.
48
+ * @param array $field_settings .
49
+ * @param Flexible_Checkout_Fields_Plugin $plugin Plugin.
50
+ *
51
+ * @return Flexible_Checkout_Fields_Field
52
+ */
53
+ public static function create_with_settings( $field_data, $field_settings, $plugin ) {
54
+ $fcf_field = new self( $field_data, $plugin );
55
+ $fcf_field->add_field_settings( $field_settings );
56
+ return $fcf_field;
57
+ }
58
+
59
+ /**
60
+ * Add settings to field.
61
+ *
62
+ * @param array $field_settings .
63
+ */
64
+ public function add_field_settings( array $field_settings ) {
65
+ foreach ( $field_settings as $key => $setting ) {
66
+ $this->field_data[ $key ] = $setting;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Get field setting.
72
+ *
73
+ * @param string $setting_name .
74
+ * @param null|string|array $default_value .
75
+ *
76
+ * @return array|string|null
77
+ */
78
+ public function get_field_setting( $setting_name, $default_value = null ) {
79
+ if ( $setting_name === self::FIELD_DISPLAY_ON_OPTION_SHOW_LABEL ) {
80
+ return $this->get_display_on_option_show_label();
81
+ }
82
+ if ( $setting_name === self::FIELD_DISPLAY_ON_OPTION_NEW_LINE_BEFORE ) {
83
+ return $this->get_display_on_option_new_line_before();
84
+ }
85
+ if ( isset( $this->field_data[ $setting_name ] ) ) {
86
+ return $this->field_data[ $setting_name ];
87
+ } else {
88
+ return $default_value;
89
+ }
90
+ }
91
+
92
  /**
93
  * Get field types from plugin.
94
  *
174
  return false;
175
  }
176
 
177
+ /**
178
+ * .
179
+ *
180
+ * @return string
181
+ */
182
+ public function get_display_on_option_new_line_before() {
183
+ if ( isset( $this->field_data[ self::FIELD_DISPLAY_ON_OPTION_NEW_LINE_BEFORE ] ) ) {
184
+ return $this->field_data[ self::FIELD_DISPLAY_ON_OPTION_NEW_LINE_BEFORE ];
185
+ } else {
186
+ return '1';
187
+ }
188
+ }
189
+
190
+ /**
191
+ * .
192
+ *
193
+ * @return string
194
+ */
195
+ public function get_display_on_option_show_label() {
196
+ if ( isset( $this->field_data[ self::FIELD_DISPLAY_ON_OPTION_SHOW_LABEL ] ) ) {
197
+ return $this->field_data[ self::FIELD_DISPLAY_ON_OPTION_SHOW_LABEL ];
198
+ } else {
199
+ if ( $this->is_custom_field() ) {
200
+ return '1';
201
+ } else {
202
+ return '0';
203
+ }
204
+ }
205
+ }
206
+
207
+ /**
208
+ * Set field type.
209
+ *
210
+ * @param string $type .
211
+ */
212
+ public function set_type( $type ) {
213
+ $this->field_data[ self::FIELD_TYPE ] = $type;
214
+ }
215
+
216
+ /**
217
+ * Get field type.
218
+ *
219
+ * @return string
220
+ */
221
+ public function get_type() {
222
+ return isset( $this->field_data[ self::FIELD_TYPE ] ) ? $this->field_data[ self::FIELD_TYPE ] : self::DEFAULT_FIELD_TYPE;
223
+ }
224
+
225
+ /**
226
+ * Get default value.
227
+ *
228
+ * @return string
229
+ */
230
+ public function get_default() {
231
+ return isset( $this->field_data[ self::FIELD_DEFAULT ] ) ? $this->field_data[ self::FIELD_DEFAULT ] : '';
232
+ }
233
 
234
  }
classes/settings.php CHANGED
@@ -51,6 +51,9 @@
51
  if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
52
  pll_register_string( $field['placeholder'], $field['placeholder'], __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
53
  }
 
 
 
54
  if ( isset( $field['type'] ) && isset( $checkout_field_type[$field['type']]['has_options'] ) && $checkout_field_type[$field['type']]['has_options'] ) {
55
  $array_options = explode("\n", $field['option']);
56
  if ( !empty( $array_options ) ){
@@ -82,6 +85,9 @@
82
  if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
83
  icl_register_string( 'flexible-checkout-fields', $field['placeholder'], $field['placeholder'], false, $icl_language_code );
84
  }
 
 
 
85
  if ( isset( $field['type'] ) && isset( $checkout_field_type[$field['type']]['has_options'] ) && $checkout_field_type[$field['type']]['has_options'] ) {
86
  $array_options = explode("\n", $field['option']);
87
  if ( !empty( $array_options ) ){
@@ -317,12 +323,17 @@
317
  if ( empty( $field['label'] ) ) {
318
  $field['label'] = '';
319
  } else {
320
- $field['label'] = wp_unslash( $field['label'] );
321
  }
322
  if ( empty( $field['placeholder'] ) ) {
323
  $field['placeholder'] = '';
324
  } else {
325
- $field['placeholder'] = wp_unslash( $field['placeholder'] );
 
 
 
 
 
326
  }
327
  } else {
328
  $field = wp_unslash( $field );
51
  if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
52
  pll_register_string( $field['placeholder'], $field['placeholder'], __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
53
  }
54
+ if ( isset( $field['default'] ) && $field['default'] != '' ) {
55
+ pll_register_string( $field['default'], $field['default'], __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
56
+ }
57
  if ( isset( $field['type'] ) && isset( $checkout_field_type[$field['type']]['has_options'] ) && $checkout_field_type[$field['type']]['has_options'] ) {
58
  $array_options = explode("\n", $field['option']);
59
  if ( !empty( $array_options ) ){
85
  if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
86
  icl_register_string( 'flexible-checkout-fields', $field['placeholder'], $field['placeholder'], false, $icl_language_code );
87
  }
88
+ if ( isset( $field['default'] ) && $field['default'] != '' ) {
89
+ icl_register_string( 'flexible-checkout-fields', $field['default'], $field['default'], false, $icl_language_code );
90
+ }
91
  if ( isset( $field['type'] ) && isset( $checkout_field_type[$field['type']]['has_options'] ) && $checkout_field_type[$field['type']]['has_options'] ) {
92
  $array_options = explode("\n", $field['option']);
93
  if ( !empty( $array_options ) ){
323
  if ( empty( $field['label'] ) ) {
324
  $field['label'] = '';
325
  } else {
326
+ $field['label'] = sanitize_textarea_field( wp_unslash( $field['label'] ) );
327
  }
328
  if ( empty( $field['placeholder'] ) ) {
329
  $field['placeholder'] = '';
330
  } else {
331
+ $field['placeholder'] = sanitize_text_field( wp_unslash( $field['placeholder'] ) );
332
+ }
333
+ if ( empty( $field['default'] ) ) {
334
+ $field['default'] = '';
335
+ } else {
336
+ $field['default'] = sanitize_text_field( wp_unslash( $field['default'] ) );
337
  }
338
  } else {
339
  $field = wp_unslash( $field );
classes/views/settings-fields.php CHANGED
@@ -8,10 +8,15 @@ $settings = get_option( 'inspire_checkout_fields_settings' );
8
  $checkout_field_type = $args['plugin']->get_fields();
9
 
10
  $fields_display_on = array(
11
- 'thank_you' => array( 'label' => __( 'Thank You Page', 'flexible-checkout-fields' ) ),
12
- 'address' => array( 'label' => __( 'My Account - address', 'flexible-checkout-fields' ) ),
13
- 'order' => array( 'label' => __( 'My Account - order', 'flexible-checkout-fields' ) ),
14
- 'emails' => array( 'label' => __( 'Emails', 'flexible-checkout-fields' ) ),
 
 
 
 
 
15
  );
16
 
17
  $plugin = $args['plugin'];
@@ -157,15 +162,23 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
157
  }
158
  $field_required = ( ! empty( $settings[ $key ][ $name ]['required'] ) && $settings[ $key ][ $name ]['required'] == '1' ) || ( isset( $field['required'] ) && $field['required'] == 1 && empty( $settings[ $key ][ $name ]['required'] ) );
159
  $field_visible = empty( $settings[ $key ][ $name ]['visible'] );
160
- //$is_custom_field = ! empty( $settings[ $key ][ $name ]['custom_field'] ) and $settings[ $key ][ $name ]['custom_field'] == 1;
161
- $is_custom_field = ! empty( $field['custom_field'] ) && $field['custom_field'] == 1;
162
  $field_type = 'text';
163
  if ( isset( $field['type'] ) ) {
164
  $field_type = $field['type'];
165
  }
166
- if ( $is_custom_field && empty( $settings[ $key ][ $name ]['type'] ) ) {
167
- $settings[ $key ][ $name ]['type'] = 'text';
 
 
 
 
 
168
  }
 
 
 
 
 
169
  ?>
170
  <li
171
  class="field-item menu-item<?php if ( ! $field_visible ): ?> field-hidden<?php endif; ?> fcf-field-<?php echo esc_attr($field_type); ?>"
@@ -366,15 +379,13 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
366
  </div>
367
 
368
  <?php if ( $is_custom_field ): ?>
369
-
370
  <?php
371
  $required = '';
372
- if ( isset( $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] ) && $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] ) {
373
  $required = ' required';
374
  }
375
  ?>
376
- <div class="element-option<?php if ( isset( $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] ) && $checkout_field_type[ $settings[ $key ][ $name ]['type'] ]['has_options'] )
377
- echo " show" ?>">
378
  <label for="option_<?php echo esc_attr($name); ?>"><?php _e( 'Options', 'flexible-checkout-fields' ) ?></label>
379
 
380
  <textarea class="field_option"
@@ -386,6 +397,29 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
386
  </div>
387
  <?php endif; ?>
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  <?php if ( $is_custom_field ): ?>
390
  <?php do_action( 'flexible_checkout_fields_settings_html', $key, $name, $settings ); ?>
391
  <div class="field_type">
@@ -468,6 +502,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
468
 
469
 
470
  <div class="field-settings-tab-container field-settings-display-options" style="display:none;">
 
471
 
472
  <?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
473
  <?php if ( $display_on_field_key == 'address' && !in_array( $key, array( 'billing', 'shipping' ) ) ) continue; ?>
@@ -497,6 +532,33 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
497
  </div>
498
  <?php endforeach; ?>
499
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
500
  </div>
501
 
502
  <?php do_action( 'flexible_checkout_fields_field_tabs_content', $key, $name, $field, $settings ); ?>
@@ -714,6 +776,29 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
714
  html += ' <p class="description"><?php echo __( 'For Post Code validation works only with country.', 'flexible-checkout-fields' ); ?></p>';
715
  html += '</div>';
716
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
717
  <?php do_action( 'flexible_checkout_fields_settings_js_html' ); ?>
718
 
719
  html += '<div class="field_type">';
@@ -736,6 +821,7 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
736
  html += '</div>';
737
 
738
  html += '<div class="field-settings-tab-container field-settings-display-options" style="display:none;">';
 
739
 
740
  <?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
741
  <?php if ( $display_on_field_key === 'address' && !in_array( $current_tab, array( 'fields_billing', 'fields_shipping' ) ) ) continue; ?>
@@ -748,6 +834,20 @@ $validation_options = $this->plugin->field_validation->get_validation_options( $
748
  html += '</div>';
749
  <?php endforeach; ?>
750
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
751
  html += '</div>';
752
 
753
  <?php do_action( 'flexible_checkout_fields_field_tabs_content_js' ); ?>
8
  $checkout_field_type = $args['plugin']->get_fields();
9
 
10
  $fields_display_on = array(
11
+ 'thank_you' => array( 'label' => __( 'Thank You Page', 'flexible-checkout-fields' ) ),
12
+ 'address' => array( 'label' => __( 'My Account - address', 'flexible-checkout-fields' ) ),
13
+ 'order' => array( 'label' => __( 'My Account - order', 'flexible-checkout-fields' ) ),
14
+ 'emails' => array( 'label' => __( 'Emails', 'flexible-checkout-fields' ) ),
15
+ );
16
+
17
+ $fields_display_on_options = array(
18
+ 'new_line_before' => array( 'label' => __( 'Display field in a new line', 'flexible-checkout-fields' ), 'custom_fields_only' => false ),
19
+ 'show_label' => array( 'label' => __( 'Show field label', 'flexible-checkout-fields' ), 'custom_fields_only' => true ),
20
  );
21
 
22
  $plugin = $args['plugin'];
162
  }
163
  $field_required = ( ! empty( $settings[ $key ][ $name ]['required'] ) && $settings[ $key ][ $name ]['required'] == '1' ) || ( isset( $field['required'] ) && $field['required'] == 1 && empty( $settings[ $key ][ $name ]['required'] ) );
164
  $field_visible = empty( $settings[ $key ][ $name ]['visible'] );
 
 
165
  $field_type = 'text';
166
  if ( isset( $field['type'] ) ) {
167
  $field_type = $field['type'];
168
  }
169
+ $fcf_field = Flexible_Checkout_Fields_Field::create_with_settings( $field, $settings[ $key ][ $name ], $plugin );
170
+ $is_custom_field = $fcf_field->is_custom_field();
171
+ if ( $is_custom_field ) {
172
+ if ( empty( $settings[ $key ][ $name ]['type'] ) ) {
173
+ $settings[ $key ][ $name ]['type'] = Flexible_Checkout_Fields_Field_Type::FIELD_TYPE_TEXT;
174
+ $fcf_field->set_type( Flexible_Checkout_Fields_Field_Type::FIELD_TYPE_TEXT );
175
+ }
176
  }
177
+ if ( isset( $checkout_field_type[ $fcf_field->get_type() ] ) ) {
178
+ $fcf_field_type = new Flexible_Checkout_Fields_Field_Type( $checkout_field_type[ $fcf_field->get_type() ] );
179
+ } else {
180
+ $fcf_field_type = null;
181
+ }
182
  ?>
183
  <li
184
  class="field-item menu-item<?php if ( ! $field_visible ): ?> field-hidden<?php endif; ?> fcf-field-<?php echo esc_attr($field_type); ?>"
379
  </div>
380
 
381
  <?php if ( $is_custom_field ): ?>
 
382
  <?php
383
  $required = '';
384
+ if ( $fcf_field_type && $fcf_field_type->has_options() ) {
385
  $required = ' required';
386
  }
387
  ?>
388
+ <div class="element-option<?php if ( $fcf_field_type && $fcf_field_type->has_options() ) echo " show" ?>">
 
389
  <label for="option_<?php echo esc_attr($name); ?>"><?php _e( 'Options', 'flexible-checkout-fields' ) ?></label>
390
 
391
  <textarea class="field_option"
397
  </div>
398
  <?php endif; ?>
399
 
400
+ <?php if ( $is_custom_field ): ?>
401
+ <?php if ( $fcf_field_type->has_default_value() ): ?>
402
+ <div class="default">
403
+ <label for="default_<?php echo esc_attr($name); ?>"><?php _e( 'Default value', 'flexible-checkout-fields' ) ?></label>
404
+
405
+ <input class="default" id="default_<?php echo esc_attr($name); ?>"
406
+ type="text"
407
+ name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][default]"
408
+ value="<?php echo esc_attr( $fcf_field->get_default() ); ?>"
409
+ data-qa-id="default"
410
+ />
411
+ <p class="description"><?php _e( 'For checkbox enter <strong>Yes</strong> if should be checked by default.', 'flexible-checkout-fields' ); ?></p>
412
+ </div>
413
+ <?php else : ?>
414
+ <input class="default" id="default_<?php echo esc_attr($name); ?>"
415
+ type="hidden"
416
+ name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][default]"
417
+ value="<?php echo esc_attr( $fcf_field->get_default() ); ?>"
418
+ data-qa-id="default"
419
+ />
420
+ <?php endif; ?>
421
+ <?php endif; ?>
422
+
423
  <?php if ( $is_custom_field ): ?>
424
  <?php do_action( 'flexible_checkout_fields_settings_html', $key, $name, $settings ); ?>
425
  <div class="field_type">
502
 
503
 
504
  <div class="field-settings-tab-container field-settings-display-options" style="display:none;">
505
+ <p><strong><?php _e( 'Pages/emails', 'flexible-checkout-fields' ) ?></strong></p>
506
 
507
  <?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
508
  <?php if ( $display_on_field_key == 'address' && !in_array( $key, array( 'billing', 'shipping' ) ) ) continue; ?>
532
  </div>
533
  <?php endforeach; ?>
534
 
535
+ <?php if ( in_array( $key, array( 'billing', 'shipping' ) ) ) : ?>
536
+ <p><strong><?php _e( 'Formatting on pages/emails', 'flexible-checkout-fields' ) ?></strong></p>
537
+
538
+ <?php foreach ( $fields_display_on_options as $display_on_field_key => $display_on_field ) : ?>
539
+ <?php if ( $display_on_field['custom_fields_only'] && ! $fcf_field->is_custom_field() ) continue; ?>
540
+ <div class="fcf-display-on-<?php echo esc_attr( $display_on_field_key ); ?>">
541
+ <?php
542
+ $field_name = 'display_on_option_' . $display_on_field_key;
543
+ $checked = $fcf_field->get_field_setting( $field_name ) === '0' ? '' : 'checked';
544
+ ?>
545
+ <input type="hidden"
546
+ name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][<?php echo $field_name; ?>]"
547
+ value="0"/>
548
+
549
+ <label>
550
+ <input class="field_required"
551
+ type="checkbox"
552
+ name="inspire_checkout_fields[settings][<?php echo esc_attr($key) ?>][<?php echo esc_attr($name) ?>][<?php echo $field_name; ?>]"
553
+ value="1" <?php echo $checked; ?>
554
+ data-qa-id="field-display-on-address"
555
+ />
556
+ <?php echo $display_on_field['label']; ?>
557
+ </label>
558
+ </div>
559
+ <?php endforeach; ?>
560
+ <?php endif; ?>
561
+
562
  </div>
563
 
564
  <?php do_action( 'flexible_checkout_fields_field_tabs_content', $key, $name, $field, $settings ); ?>
776
  html += ' <p class="description"><?php echo __( 'For Post Code validation works only with country.', 'flexible-checkout-fields' ); ?></p>';
777
  html += '</div>';
778
 
779
+ let default_value_input_type = 'hidden';
780
+ if ( fcf_field_type[field_type].has_default_value !== undefined && fcf_field_type[field_type].has_default_value ) {
781
+ html += '<div class="default">';
782
+ html += ' <label for="default_' + field_slug + '"><?php _e( 'Default value',
783
+ 'flexible-checkout-fields' ) ?></label>';
784
+ html += ' <input class="default" id="default_' + field_slug + '"';
785
+ html += ' type="text"';
786
+ html += ' name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][default]"';
787
+ html += ' value=""';
788
+ html += ' data-qa-id="default"';
789
+ html += ' />';
790
+ html += ' <p class="description"><?php _e( 'For checkbox enter <strong>Yes</strong> if should by checked by default.',
791
+ 'flexible-checkout-fields' ); ?></p>';
792
+ html += '</div>';
793
+ } else {
794
+ html += ' <input class="default" id="default_' + field_slug + '"';
795
+ html += ' type="hidden"';
796
+ html += ' name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][default]"';
797
+ html += ' value=""';
798
+ html += ' data-qa-id="default"';
799
+ html += ' />';
800
+ }
801
+
802
  <?php do_action( 'flexible_checkout_fields_settings_js_html' ); ?>
803
 
804
  html += '<div class="field_type">';
821
  html += '</div>';
822
 
823
  html += '<div class="field-settings-tab-container field-settings-display-options" style="display:none;">';
824
+ html += '<p><strong><?php _e( 'Formatting on pages/emails', 'flexible-checkout-fields' ) ?></strong></p>';
825
 
826
  <?php foreach ( $fields_display_on as $display_on_field_key => $display_on_field ) : ?>
827
  <?php if ( $display_on_field_key === 'address' && !in_array( $current_tab, array( 'fields_billing', 'fields_shipping' ) ) ) continue; ?>
834
  html += '</div>';
835
  <?php endforeach; ?>
836
 
837
+ <?php if ( in_array( $current_tab, array( 'fields_billing', 'fields_shipping' ) ) ) : ?>
838
+ html += '<hr />';
839
+ html += '<p><strong><?php _e( 'Pages/emails', 'flexible-checkout-fields' ) ?></strong></p>';
840
+ <?php foreach ( $fields_display_on_options as $display_on_field_key => $display_on_field ) : ?>
841
+ html += '<div class=" fcf-display-on-option-<?php echo esc_attr($display_on_field_key); ?>">';
842
+ html += '<input type="hidden" name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][display_on_option_<?php echo esc_attr($display_on_field_key); ?>]" value="0"/>';
843
+ html += '<label>';
844
+ html += '<input class="field_required" type="checkbox" name="inspire_checkout_fields[settings][' + field_section + '][' + field_slug + '][display_on_option_<?php echo esc_attr($display_on_field_key); ?>]" value="1" checked data-qa-id="field-display-on-address" />';
845
+ html += '<?php echo esc_attr($display_on_field['label']); ?>';
846
+ html += '</label>';
847
+ html += '</div>';
848
+ <?php endforeach; ?>
849
+ <?php endif; ?>
850
+
851
  html += '</div>';
852
 
853
  <?php do_action( 'flexible_checkout_fields_field_tabs_content_js' ); ?>
composer.lock CHANGED
@@ -462,16 +462,16 @@
462
  },
463
  {
464
  "name": "composer/composer",
465
- "version": "1.9.3",
466
  "source": {
467
  "type": "git",
468
  "url": "https://github.com/composer/composer.git",
469
- "reference": "1291a16ce3f48bfdeca39d64fca4875098af4d7b"
470
  },
471
  "dist": {
472
  "type": "zip",
473
- "url": "https://api.github.com/repos/composer/composer/zipball/1291a16ce3f48bfdeca39d64fca4875098af4d7b",
474
- "reference": "1291a16ce3f48bfdeca39d64fca4875098af4d7b",
475
  "shasum": ""
476
  },
477
  "require": {
@@ -484,17 +484,17 @@
484
  "psr/log": "^1.0",
485
  "seld/jsonlint": "^1.4",
486
  "seld/phar-utils": "^1.0",
487
- "symfony/console": "^2.7 || ^3.0 || ^4.0",
488
- "symfony/filesystem": "^2.7 || ^3.0 || ^4.0",
489
- "symfony/finder": "^2.7 || ^3.0 || ^4.0",
490
- "symfony/process": "^2.7 || ^3.0 || ^4.0"
491
  },
492
  "conflict": {
493
  "symfony/console": "2.8.38"
494
  },
495
  "require-dev": {
496
- "phpunit/phpunit": "^4.8.35 || ^5.7",
497
- "phpunit/phpunit-mock-objects": "^2.3 || ^3.0"
498
  },
499
  "suggest": {
500
  "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
@@ -507,7 +507,7 @@
507
  "type": "library",
508
  "extra": {
509
  "branch-alias": {
510
- "dev-master": "1.9-dev"
511
  }
512
  },
513
  "autoload": {
@@ -538,7 +538,7 @@
538
  "dependency",
539
  "package"
540
  ],
541
- "time": "2020-02-04T11:58:49+00:00"
542
  },
543
  {
544
  "name": "composer/semver",
@@ -7042,16 +7042,16 @@
7042
  },
7043
  {
7044
  "name": "wpdesk/wp-codeception",
7045
- "version": "1.4.15",
7046
  "source": {
7047
  "type": "git",
7048
  "url": "https://gitlab.com/wpdesk/wp-codeception.git",
7049
- "reference": "bef3b7eeb1aaf371914c8aa6da6ae133a71cb237"
7050
  },
7051
  "dist": {
7052
  "type": "zip",
7053
- "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-codeception/repository/archive.zip?sha=bef3b7eeb1aaf371914c8aa6da6ae133a71cb237",
7054
- "reference": "bef3b7eeb1aaf371914c8aa6da6ae133a71cb237",
7055
  "shasum": ""
7056
  },
7057
  "require": {
@@ -7097,7 +7097,7 @@
7097
  "codeception",
7098
  "wordpress"
7099
  ],
7100
- "time": "2020-02-25T09:56:49+00:00"
7101
  },
7102
  {
7103
  "name": "wpdesk/wp-logs",
462
  },
463
  {
464
  "name": "composer/composer",
465
+ "version": "1.10.0",
466
  "source": {
467
  "type": "git",
468
  "url": "https://github.com/composer/composer.git",
469
+ "reference": "472c917b2a083ec7d2fa25c55fd099d1300e2515"
470
  },
471
  "dist": {
472
  "type": "zip",
473
+ "url": "https://api.github.com/repos/composer/composer/zipball/472c917b2a083ec7d2fa25c55fd099d1300e2515",
474
+ "reference": "472c917b2a083ec7d2fa25c55fd099d1300e2515",
475
  "shasum": ""
476
  },
477
  "require": {
484
  "psr/log": "^1.0",
485
  "seld/jsonlint": "^1.4",
486
  "seld/phar-utils": "^1.0",
487
+ "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0",
488
+ "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0",
489
+ "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0",
490
+ "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0"
491
  },
492
  "conflict": {
493
  "symfony/console": "2.8.38"
494
  },
495
  "require-dev": {
496
+ "phpspec/prophecy": "^1.10",
497
+ "symfony/phpunit-bridge": "^3.4"
498
  },
499
  "suggest": {
500
  "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
507
  "type": "library",
508
  "extra": {
509
  "branch-alias": {
510
+ "dev-master": "1.10-dev"
511
  }
512
  },
513
  "autoload": {
538
  "dependency",
539
  "package"
540
  ],
541
+ "time": "2020-03-10T13:08:05+00:00"
542
  },
543
  {
544
  "name": "composer/semver",
7042
  },
7043
  {
7044
  "name": "wpdesk/wp-codeception",
7045
+ "version": "1.4.16",
7046
  "source": {
7047
  "type": "git",
7048
  "url": "https://gitlab.com/wpdesk/wp-codeception.git",
7049
+ "reference": "13a0ba8905bd27d2229a06162bf14ae3d9414f40"
7050
  },
7051
  "dist": {
7052
  "type": "zip",
7053
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-codeception/repository/archive.zip?sha=13a0ba8905bd27d2229a06162bf14ae3d9414f40",
7054
+ "reference": "13a0ba8905bd27d2229a06162bf14ae3d9414f40",
7055
  "shasum": ""
7056
  },
7057
  "require": {
7097
  "codeception",
7098
  "wordpress"
7099
  ],
7100
+ "time": "2020-03-07T21:34:01+00:00"
7101
  },
7102
  {
7103
  "name": "wpdesk/wp-logs",
flexible-checkout-fields.php CHANGED
@@ -3,15 +3,15 @@
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.0
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
10
  Domain Path: /lang/
11
  Requires at least: 4.6
12
  Tested up to: 5.3.2
13
- WC requires at least: 3.1.0
14
- WC tested up to: 3.9.3
15
  Requires PHP: 5.6
16
 
17
  Copyright 2017 WP Desk Ltd.
@@ -37,8 +37,8 @@ if ( ! defined( 'ABSPATH' ) ) {
37
 
38
 
39
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
40
- $plugin_version = '2.4.0';
41
- $plugin_release_timestamp = '2020-03-06 16:53';
42
 
43
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
44
 
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.1
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
10
  Domain Path: /lang/
11
  Requires at least: 4.6
12
  Tested up to: 5.3.2
13
+ WC requires at least: 3.6.0
14
+ WC tested up to: 4.0.0
15
  Requires PHP: 5.6
16
 
17
  Copyright 2017 WP Desk Ltd.
37
 
38
 
39
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
40
+ $plugin_version = '2.4.1';
41
+ $plugin_release_timestamp = '2020-03-12 10:31';
42
 
43
  define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
44
 
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Flexible Checkout Fields for WooCommerce ===
2
 
3
- Contributors: wpdesk,dyszczo,grola,potreb
4
  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.3.2
8
- Stable tag: 2.4.0
9
  Requires PHP: 5.6
10
  License: GPLv3 or later
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -193,6 +193,9 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
193
 
194
  == Changelog ==
195
 
 
 
 
196
  = 2.4.0 - 2020-03-06 =
197
  * Added additional request sanitization
198
  * Tweaked remote calling css files
1
  === Flexible Checkout Fields for WooCommerce ===
2
 
3
+ Contributors: wpdesk,dyszczo,grola,piotrpo,dwukropek,marcinkolanko
4
  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.3.2
8
+ Stable tag: 2.4.1
9
  Requires PHP: 5.6
10
  License: GPLv3 or later
11
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
193
 
194
  == Changelog ==
195
 
196
+ = 2.4.1 - 2020-03-10 =
197
+ * Added formatting for billing and shipping fields on pages and emails
198
+
199
  = 2.4.0 - 2020-03-06 =
200
  * Added additional request sanitization
201
  * Tweaked remote calling css files
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit74dfe271bcd624105a31c1687a00b316::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit2855f39e43c1d84c7a6c1c01a736e101::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -232,6 +232,7 @@ return array(
232
  'Flexible_Checkout_Fields_Disaplay_Options' => $baseDir . '/classes/display-options.php',
233
  'Flexible_Checkout_Fields_Field' => $baseDir . '/classes/field.php',
234
  'Flexible_Checkout_Fields_Field_Options' => $baseDir . '/classes/field-options.php',
 
235
  'Flexible_Checkout_Fields_Field_Validation' => $baseDir . '/classes/filed-validation.php',
236
  'Flexible_Checkout_Fields_Myaccount_Edit_Address' => $baseDir . '/classes/myaccount-edit-address.php',
237
  'Flexible_Checkout_Fields_Myaccount_Field_Processor' => $baseDir . '/classes/myaccount-filed-processor.php',
232
  'Flexible_Checkout_Fields_Disaplay_Options' => $baseDir . '/classes/display-options.php',
233
  'Flexible_Checkout_Fields_Field' => $baseDir . '/classes/field.php',
234
  'Flexible_Checkout_Fields_Field_Options' => $baseDir . '/classes/field-options.php',
235
+ 'Flexible_Checkout_Fields_Field_Type' => $baseDir . '/classes/field-type.php',
236
  'Flexible_Checkout_Fields_Field_Validation' => $baseDir . '/classes/filed-validation.php',
237
  'Flexible_Checkout_Fields_Myaccount_Edit_Address' => $baseDir . '/classes/myaccount-edit-address.php',
238
  'Flexible_Checkout_Fields_Myaccount_Field_Processor' => $baseDir . '/classes/myaccount-filed-processor.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit74dfe271bcd624105a31c1687a00b316
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit74dfe271bcd624105a31c1687a00b316
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit74dfe271bcd624105a31c1687a00b316', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit74dfe271bcd624105a31c1687a00b316', '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\ComposerStaticInit74dfe271bcd624105a31c1687a00b316::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 ComposerAutoloaderInit2855f39e43c1d84c7a6c1c01a736e101
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit2855f39e43c1d84c7a6c1c01a736e101', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit2855f39e43c1d84c7a6c1c01a736e101', '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\ComposerStaticInit2855f39e43c1d84c7a6c1c01a736e101::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 ComposerStaticInit74dfe271bcd624105a31c1687a00b316
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
@@ -247,6 +247,7 @@ class ComposerStaticInit74dfe271bcd624105a31c1687a00b316
247
  'Flexible_Checkout_Fields_Disaplay_Options' => __DIR__ . '/../..' . '/classes/display-options.php',
248
  'Flexible_Checkout_Fields_Field' => __DIR__ . '/../..' . '/classes/field.php',
249
  'Flexible_Checkout_Fields_Field_Options' => __DIR__ . '/../..' . '/classes/field-options.php',
 
250
  'Flexible_Checkout_Fields_Field_Validation' => __DIR__ . '/../..' . '/classes/filed-validation.php',
251
  'Flexible_Checkout_Fields_Myaccount_Edit_Address' => __DIR__ . '/../..' . '/classes/myaccount-edit-address.php',
252
  'Flexible_Checkout_Fields_Myaccount_Field_Processor' => __DIR__ . '/../..' . '/classes/myaccount-filed-processor.php',
@@ -275,9 +276,9 @@ class ComposerStaticInit74dfe271bcd624105a31c1687a00b316
275
  public static function getInitializer(ClassLoader $loader)
276
  {
277
  return \Closure::bind(function () use ($loader) {
278
- $loader->prefixLengthsPsr4 = ComposerStaticInit74dfe271bcd624105a31c1687a00b316::$prefixLengthsPsr4;
279
- $loader->prefixDirsPsr4 = ComposerStaticInit74dfe271bcd624105a31c1687a00b316::$prefixDirsPsr4;
280
- $loader->classMap = ComposerStaticInit74dfe271bcd624105a31c1687a00b316::$classMap;
281
 
282
  }, null, ClassLoader::class);
283
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit2855f39e43c1d84c7a6c1c01a736e101
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
247
  'Flexible_Checkout_Fields_Disaplay_Options' => __DIR__ . '/../..' . '/classes/display-options.php',
248
  'Flexible_Checkout_Fields_Field' => __DIR__ . '/../..' . '/classes/field.php',
249
  'Flexible_Checkout_Fields_Field_Options' => __DIR__ . '/../..' . '/classes/field-options.php',
250
+ 'Flexible_Checkout_Fields_Field_Type' => __DIR__ . '/../..' . '/classes/field-type.php',
251
  'Flexible_Checkout_Fields_Field_Validation' => __DIR__ . '/../..' . '/classes/filed-validation.php',
252
  'Flexible_Checkout_Fields_Myaccount_Edit_Address' => __DIR__ . '/../..' . '/classes/myaccount-edit-address.php',
253
  'Flexible_Checkout_Fields_Myaccount_Field_Processor' => __DIR__ . '/../..' . '/classes/myaccount-filed-processor.php',
276
  public static function getInitializer(ClassLoader $loader)
277
  {
278
  return \Closure::bind(function () use ($loader) {
279
+ $loader->prefixLengthsPsr4 = ComposerStaticInit2855f39e43c1d84c7a6c1c01a736e101::$prefixLengthsPsr4;
280
+ $loader->prefixDirsPsr4 = ComposerStaticInit2855f39e43c1d84c7a6c1c01a736e101::$prefixDirsPsr4;
281
+ $loader->classMap = ComposerStaticInit2855f39e43c1d84c7a6c1c01a736e101::$classMap;
282
 
283
  }, null, ClassLoader::class);
284
  }