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

Version Description

  • 2016-10-07 =
  • Added support for fields conditional logic based on products and categories (available in the PRO version)
  • Added option to reset section settings
  • Added better support for third party plugins that add checkout fields
  • Added WPML and Polylang support
Download this release

Release Info

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

Code changes from version 1.2.3 to 1.3

assets/css/admin.css CHANGED
@@ -81,9 +81,8 @@ span.inspire-file-error {
81
  display: none;
82
  }
83
 
84
- .woocommerce_page_inspire_checkout_fields_settings .field-settings > div,
85
- .woocommerce_page_inspire_checkout_fields_settings .fields-container > div {
86
- margin: 5px 10px 10px 0;
87
  }
88
 
89
  .woocommerce_page_inspire_checkout_fields_settings .field-settings label {
@@ -101,8 +100,8 @@ span.inspire-file-error {
101
  .woocommerce_page_inspire_checkout_fields_settings .field-settings a.remove-field {
102
  color: #a00;
103
  display: inline-block;
104
- margin: 5px 0;
105
- text-decoration: none;
106
  }
107
 
108
  .woocommerce_page_inspire_checkout_fields_settings .field-settings a.remove-field:hover {
@@ -118,6 +117,29 @@ span.inspire-file-error {
118
  float: left;
119
  }
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  /* Additional Checkboxes */
122
  .woocommerce_page_inspire_checkout_fields_settings #checkboxes_field.sortable {
123
  margin: 0 30px 20px 0;
@@ -158,6 +180,8 @@ span.inspire-file-error {
158
  }
159
 
160
  /* PRO */
 
 
161
  .woocommerce_page_inspire_checkout_fields_settings code.hook {
162
  visibility: hidden;
163
  }
@@ -165,3 +189,49 @@ span.inspire-file-error {
165
  .woocommerce_page_inspire_checkout_fields_settings .form-table td p:first-child {
166
  margin-bottom: 4px;
167
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  display: none;
82
  }
83
 
84
+ .woocommerce_page_inspire_checkout_fields_settings .field-settings-tab-container > div {
85
+ margin: 5px 0 10px;
 
86
  }
87
 
88
  .woocommerce_page_inspire_checkout_fields_settings .field-settings label {
100
  .woocommerce_page_inspire_checkout_fields_settings .field-settings a.remove-field {
101
  color: #a00;
102
  display: inline-block;
103
+ margin: 10px 0 5px 320px;
104
+ text-decoration: none;
105
  }
106
 
107
  .woocommerce_page_inspire_checkout_fields_settings .field-settings a.remove-field:hover {
117
  float: left;
118
  }
119
 
120
+ /* Tabs */
121
+ .woocommerce_page_inspire_checkout_fields_settings .fields-container .nav-tab {
122
+ /*background-color: #ededed;*/
123
+ font-size: 12px;
124
+ margin-left: 0;
125
+ margin-right: .5em;
126
+ }
127
+
128
+ .woocommerce_page_inspire_checkout_fields_settings .fields-container .nav-tab-active,
129
+ .woocommerce_page_inspire_checkout_fields_settings .fields-container .nav-tab-active:focus,
130
+ .woocommerce_page_inspire_checkout_fields_settings .fields-container .nav-tab-active:focus:active,
131
+ .woocommerce_page_inspire_checkout_fields_settings .fields-container .nav-tab-active:hover {
132
+ background-color: #fff;
133
+ border-bottom: 0;
134
+ }
135
+
136
+ .woocommerce_page_inspire_checkout_fields_settings .field-settings-tab-container {
137
+ border: 1px solid #ccc;
138
+ margin-top: -1px;
139
+ margin-right: 10px;
140
+ padding: 4px 10px 0;
141
+ }
142
+
143
  /* Additional Checkboxes */
144
  .woocommerce_page_inspire_checkout_fields_settings #checkboxes_field.sortable {
145
  margin: 0 30px 20px 0;
180
  }
181
 
182
  /* PRO */
183
+
184
+ /* Hooks */
185
  .woocommerce_page_inspire_checkout_fields_settings code.hook {
186
  visibility: hidden;
187
  }
189
  .woocommerce_page_inspire_checkout_fields_settings .form-table td p:first-child {
190
  margin-bottom: 4px;
191
  }
192
+
193
+ /* Rules */
194
+ .woocommerce_page_inspire_checkout_fields_settings .options {
195
+ margin-bottom: 10px;
196
+ }
197
+
198
+ .woocommerce_page_inspire_checkout_fields_settings .rules fieldset {
199
+ border: 1px solid #ccc;
200
+ padding: 8px 8px 3px;
201
+ margin-bottom: 10px;
202
+
203
+ /*border-bottom: 1px solid #dadada;
204
+ margin-bottom: 10px;*/
205
+ }
206
+
207
+ .woocommerce_page_inspire_checkout_fields_settings .rules fieldset legend {
208
+ font-weight: bold;
209
+ }
210
+
211
+ .woocommerce_page_inspire_checkout_fields_settings .rules fieldset > div {
212
+ margin-bottom: 2px;
213
+ }
214
+
215
+ /*.woocommerce_page_inspire_checkout_fields_settings .rules .select2-container-multi .select2-choices {
216
+ width: auto;
217
+ }*/
218
+
219
+ .woocommerce_page_inspire_checkout_fields_settings .rules .select2-container {
220
+ max-width: 345px;
221
+ }
222
+
223
+ .woocommerce_page_inspire_checkout_fields_settings .reset_settings {
224
+ float: right !important;
225
+ background:none!important;
226
+ border:none!important;
227
+ padding:0!important;
228
+ font: inherit;
229
+ /*border is optional*/
230
+ /* border-bottom:1px solid #444; */
231
+ cursor: pointer;
232
+ color: #a00;
233
+ display: inline-block;
234
+ margin: 5px 5px;
235
+ text-decoration: none;
236
+ box-shadow: 0 0px 0 #ccc;
237
+ }
class/inspireCheckoutFieldsSettings.php CHANGED
@@ -7,10 +7,74 @@
7
 
8
  $this->plugin = $plugin;
9
 
10
- add_action( 'admin_init', array($this, 'updateSettingsAction') );
11
  add_action( 'admin_menu', array($this, 'initAdminMenuAction'), 80);
 
 
 
12
  }
13
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * add new menu to woocommerce function.
16
  *
@@ -128,6 +192,9 @@
128
  if ( is_array( $value )) {
129
  foreach ( $value as $key => $val ) {
130
  $settings[$key] = $val;
 
 
 
131
  }
132
  }
133
  else {
7
 
8
  $this->plugin = $plugin;
9
 
10
+ add_action( 'admin_init', array($this, 'updateSettingsAction') );
11
  add_action( 'admin_menu', array($this, 'initAdminMenuAction'), 80);
12
+
13
+ add_action( 'init', array($this, 'init_polylang') );
14
+ add_action( 'admin_init', array($this, 'init_wpml') );
15
  }
16
+
17
+ function init_polylang() {
18
+ if ( function_exists( 'pll_register_string' ) ) {
19
+ $settings = get_option('inspire_checkout_fields_settings', array() );
20
+ $checkout_field_type = $this->plugin->get_fields();
21
+ foreach ( $settings as $section ) {
22
+ if ( is_array( $section ) ) {
23
+ foreach ( $section as $field ) {
24
+ if ( isset( $field['label'] ) && $field['label'] != '' ) {
25
+ pll_register_string( $field['label'], $field['label'], __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
26
+ }
27
+ if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
28
+ pll_register_string( $field['placeholder'], $field['placeholder'], __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
29
+ }
30
+ if ( isset( $field['type'] ) && isset( $checkout_field_type[$field['type']]['has_options'] ) && $checkout_field_type[$field['type']]['has_options'] ) {
31
+ $array_options = explode("\n", $field['option']);
32
+ if ( !empty( $array_options ) ){
33
+ foreach ( $array_options as $option ) {
34
+ $tmp = explode(':', $option);
35
+ $option_label = trim( $tmp[1] );
36
+ pll_register_string( $option_label, $option_label, __('Flexible Checkout Fields', 'flexible-checkout-fields' ) );
37
+ unset($tmp);
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ function init_wpml() {
48
+ if ( function_exists( 'icl_register_string' ) ) {
49
+ $icl_language_code = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : get_bloginfo('language');
50
+ $settings = get_option('inspire_checkout_fields_settings', array() );
51
+ $checkout_field_type = $this->plugin->get_fields();
52
+ foreach ( $settings as $section ) {
53
+ if ( is_array( $section ) ) {
54
+ foreach ( $section as $field ) {
55
+ if ( isset( $field['label'] ) && $field['label'] != '' ) {
56
+ icl_register_string( 'flexible-checkout-fields', $field['label'], $field['label'], false, $icl_language_code );
57
+ }
58
+ if ( isset( $field['placeholder'] ) && $field['placeholder'] != '' ) {
59
+ icl_register_string( 'flexible-checkout-fields', $field['placeholder'], $field['placeholder'], false, $icl_language_code );
60
+ }
61
+ if ( isset( $field['type'] ) && isset( $checkout_field_type[$field['type']]['has_options'] ) && $checkout_field_type[$field['type']]['has_options'] ) {
62
+ $array_options = explode("\n", $field['option']);
63
+ if ( !empty( $array_options ) ){
64
+ foreach ( $array_options as $option ) {
65
+ $tmp = explode(':', $option);
66
+ $option_label = trim( $tmp[1] );
67
+ icl_register_string( 'flexible-checkout-fields', $option_label, $option_label, false, $icl_language_code );
68
+ unset($tmp);
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+
78
  /**
79
  * add new menu to woocommerce function.
80
  *
192
  if ( is_array( $value )) {
193
  foreach ( $value as $key => $val ) {
194
  $settings[$key] = $val;
195
+ if ( isset( $_POST['reset_settings'] ) ) {
196
+ unset( $settings[$key] );
197
+ }
198
  }
199
  }
200
  else {
class/views/settings-fields.php CHANGED
@@ -18,11 +18,15 @@
18
  */
19
 
20
  $checkout_field_type = $args['plugin']->get_fields();
21
-
22
  ?>
23
 
24
  <div class="wrap">
25
  <?php if (!empty($_POST['option_page']) && $_POST['option_page'] === 'inspire_checkout_fields_settings'): ?>
 
 
 
 
 
26
  <div id="message" class="updated fade">
27
  <p><strong><?php _e( 'Settings saved.', 'flexible-checkout-fields' ); ?></strong></p>
28
  </div>
@@ -60,7 +64,7 @@
60
  <?php foreach ( $this->plugin->sections as $custom_section => $custom_section_data ) : ?>
61
  <?php $selected = ""; ?>
62
  <?php if ( $custom_section_data['tab'] == $current_tab ) $selected = " selected"; ?>
63
- <option value="<?php echo $custom_section_data['section']; ?>" <?php echo $selected; ?>><?php echo $custom_section_data['title']; ?></option>
64
  <?php endforeach; ?>
65
  </select>
66
  </div>
@@ -90,7 +94,7 @@
90
  <h3><?php _e( 'Edit Section', 'flexible-checkout-fields' ) ?></h3>
91
 
92
  <div class="publishing-action">
93
- <span class="spinner"></span>
94
  <input type="submit" name="" value="<?php _e( 'Save Changes', 'flexible-checkout-fields' ) ?>" class="button button-primary">
95
  </div>
96
  </div>
@@ -136,6 +140,19 @@
136
  </div>
137
 
138
  <div class="menu-item-settings field-settings">
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  <?php if( $is_custom_field ): ?>
140
  <?php if ( isset($checkout_field_type[$settings[$key][$name]['type']]['description'] ) ) :?>
141
  <div class="element-<?php echo $settings[$key][$name]['type']; ?>-description show">
@@ -157,7 +174,10 @@
157
  <?php
158
  $checked = '';
159
  $style = '';
160
- if ( isset($checkout_field_type[$settings[$key][$name]['type']]['has_required']) && $checkout_field_type[$settings[$key][$name]['type']]['has_rquired'] == false ) {
 
 
 
161
  $style = ' display:none; ';
162
  }
163
  else {
@@ -173,7 +193,7 @@
173
  </label>
174
  </div>
175
 
176
- <div class="field-type-label">
177
 
178
  <label for="label_<?php echo $name ?>"><?php _e( 'Label', 'flexible-checkout-fields' ) ?></label>
179
 
@@ -198,11 +218,25 @@
198
  </div>
199
  <?php endif; ?>
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  <?php if( !$is_custom_field || empty( $checkout_field_type[$settings[$key][$name]['type']]['disable_placeholder'] ) || !$checkout_field_type[$settings[$key][$name]['type']]['disable_placeholder'] ): ?>
202
  <div class="field_placeholder">
203
  <?php
204
  $required = '';
205
- if( isset( $checkout_field_type[$settings[$key][$name]['type']]['label_is_required'] ) ) {
206
  $required = ' required';
207
  }
208
  ?>
@@ -211,25 +245,13 @@
211
  <input type="text" id="placeholder_<?php echo $name ?>" name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][placeholder]" value="<?php if(!empty($settings[$key][$name]['placeholder'])): echo $settings[$key][$name]['placeholder']; else: echo isset($field['placeholder'])?$field['placeholder']:''; endif; ?>" <?php echo $required; ?> />
212
  </div>
213
  <?php endif; ?>
214
-
215
  <div>
216
  <label for="class_<?php echo $name ?>"><?php _e( 'CSS Class', 'flexible-checkout-fields' ) ?></label>
217
  <input type="text" id="class_<?php echo $name ?>" name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][class]" value="<?php if(!empty($settings[$key][$name]['class'])): echo $settings[$key][$name]['class']; else: if(!empty($field['class'])) echo implode(' ', $field['class']); endif; ?>" />
218
  </div>
219
-
220
- <?php if( $is_custom_field ): ?>
221
- <?php do_action( 'flexible_checkout_fields_settings_html', $key, $name, $settings ); ?>
222
- <div>
223
- <label for="type_<?php echo $name ?>"><?php _e( 'Field Type', 'flexible-checkout-fields' ) ?></label>
224
-
225
- <select id="woocommerce_checkout_fields_field_type" name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][type]" disabled>
226
- <?php foreach ($checkout_field_type as $type_key => $value): ?>
227
- <option value="<?php echo $type_key ?>"<?php if($settings[$key][$name]['type'] == $type_key) echo " selected";?>><?php echo $value['name'] ?></option>
228
- <?php endforeach; ?>
229
- </select>
230
- </div>
231
- <a class="remove-field" href="#"><?php _e( 'Delete Field', 'flexible-checkout-fields' ) ?></a>
232
- <?php endif; ?>
233
  </div>
234
  </li>
235
  <?php endforeach; ?>
@@ -237,12 +259,13 @@
237
  </div>
238
 
239
  <?php do_action( 'flexible_checkout_fields_section_settings', $key, $settings ); ?>
240
-
241
  <?php endforeach; ?>
242
 
243
  <div id="nav-menu-footer">
244
  <div class="major-publishing-actions wp-clearfix">
245
  <input type="submit" name="" value="<?php _e( 'Save Changes', 'flexible-checkout-fields' ) ?>" class="button button-primary">
 
246
  <span class="spinner"></span>
247
  </div>
248
  </div>
@@ -289,11 +312,21 @@ jQuery(document).ready(function () {
289
  html += '</div>';
290
  html += '</div>';
291
  html += '<div class="menu-item-settings field-settings">';
292
- <?php /* ?>
293
- html += '<div class="element-file-description">';
294
- html += '<p class="description"><?php _e( 'Files will be saved to /wp-content/uploads/woocommerce_uploads/checkout_fields', 'flexible-checkout-fields' ) ?></p>';
295
- html += '</div>';
296
- <?php */ ?>
 
 
 
 
 
 
 
 
 
 
297
  <?php foreach ( $checkout_field_type as $key => $value ) : ?>
298
  <?php if ( isset( $value['description'] ) ) : ?>
299
  html += '<div class="element-<?php echo $key; ?>-description">';
@@ -320,6 +353,17 @@ jQuery(document).ready(function () {
320
  html += '<textarea id="label_'+ field_slug + '" class="field-name" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][label]">' + field_name + '</textarea>';
321
  html += '<p class="description"><?php _e( 'You can use HTML.', 'flexible-checkout-fields' ); ?></p>';
322
  html += '</div>';
 
 
 
 
 
 
 
 
 
 
 
323
  html += '<div class="field_placeholder">';
324
  html += '<label for="placeholder_'+ field_slug +'"><?php _e( 'Placeholder', 'flexible-checkout-fields' ) ?></label>';
325
  html += '<input type="text" id="placeholder_' + field_slug + '" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][placeholder]" value="">';
@@ -328,11 +372,11 @@ jQuery(document).ready(function () {
328
  html += '<label for="class_' + field_slug + '"><?php _e( 'CSS Class', 'flexible-checkout-fields') ?></label>';
329
  html += '<input type="text" id="class_' + field_slug + '" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][class]" value="">';
330
  html += '</div>';
331
- <?php do_action( 'flexible_checkout_fields_settings_js_html' ); ?>
332
- html += '<div>';
333
- html += '<label for="type_' + field_slug + '"><?php _e( 'Field Type', 'flexible-checkout-fields' ) ?></label>';
334
- html += '<select id="woocommerce_checkout_fields_field_type" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][type]" disabled>'+printSelectTypeOptions(field_type)+'</select>';
335
  html += '</div>';
 
 
 
336
  html += '<a class="remove-field" href="#"><?php _e( 'Delete Field', 'flexible-checkout-fields' ) ?></a>';
337
  html += '</li>';
338
  html += '';
@@ -394,6 +438,9 @@ jQuery(document).ready(function () {
394
  jQuery('form').bind('submit', function () {
395
  jQuery(this).find('select').prop('disabled', false);
396
  jQuery(this).find('.major-publishing-actions').find('.spinner').css('visibility', 'visible');
 
 
 
397
  });
398
 
399
  // Activate Spinner on Save
@@ -402,8 +449,34 @@ jQuery(document).ready(function () {
402
  if ( jQuery(this).val() == '' && jQuery(this).is(':hidden') ) {
403
  jQuery(this).closest('li').find('.item-controls>a').click();
404
  }
405
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  });
 
 
407
  });
408
 
409
  function printSelectTypeOptions(selected){
18
  */
19
 
20
  $checkout_field_type = $args['plugin']->get_fields();
 
21
  ?>
22
 
23
  <div class="wrap">
24
  <?php if (!empty($_POST['option_page']) && $_POST['option_page'] === 'inspire_checkout_fields_settings'): ?>
25
+ <?php if ( isset( $_POST['reset_settings'] ) ) : ?>
26
+ <div id="message" class="updated fade">
27
+ <p><strong><?php _e( 'Settings resetted.', 'flexible-checkout-fields' ); ?></strong></p>
28
+ </div>
29
+ <?php endif; ?>
30
  <div id="message" class="updated fade">
31
  <p><strong><?php _e( 'Settings saved.', 'flexible-checkout-fields' ); ?></strong></p>
32
  </div>
64
  <?php foreach ( $this->plugin->sections as $custom_section => $custom_section_data ) : ?>
65
  <?php $selected = ""; ?>
66
  <?php if ( $custom_section_data['tab'] == $current_tab ) $selected = " selected"; ?>
67
+ <option value="<?php echo $custom_section_data['section']; ?>" <?php echo $selected; ?>><?php echo $custom_section_data['tab_title']; ?></option>
68
  <?php endforeach; ?>
69
  </select>
70
  </div>
94
  <h3><?php _e( 'Edit Section', 'flexible-checkout-fields' ) ?></h3>
95
 
96
  <div class="publishing-action">
97
+ <span class="spinner"></span>
98
  <input type="submit" name="" value="<?php _e( 'Save Changes', 'flexible-checkout-fields' ) ?>" class="button button-primary">
99
  </div>
100
  </div>
140
  </div>
141
 
142
  <div class="menu-item-settings field-settings">
143
+ <div style="margin-bottom: -1px ! important;" class="nav-tab-wrapper">
144
+ <a href="#general" class="nav-tab nav-tab-active"><?php _e( 'General', 'flexible-checkout-fields' ); ?></a>
145
+ <a class="nav-tab" href="#apperance"><?php _e( 'Appearance', 'flexible-checkout-fields' ); ?></a>
146
+ <?php
147
+ $additional_tabs = apply_filters( 'flexible_checkout_fields_field_tabs', array() );
148
+ foreach ( $additional_tabs as $additional_tab ) {
149
+ ?>
150
+ <a class="nav-tab" href="#<?php echo $additional_tab['hash']; ?>"><?php echo $additional_tab['title']; ?></a>
151
+ <?php
152
+ }
153
+ ?>
154
+ </div>
155
+ <div class="field-settings-tab-container field-settings-general">
156
  <?php if( $is_custom_field ): ?>
157
  <?php if ( isset($checkout_field_type[$settings[$key][$name]['type']]['description'] ) ) :?>
158
  <div class="element-<?php echo $settings[$key][$name]['type']; ?>-description show">
174
  <?php
175
  $checked = '';
176
  $style = '';
177
+ if ( isset($settings[$key][$name]['type'])
178
+ && isset($checkout_field_type[$settings[$key][$name]['type']]['has_required'])
179
+ && $checkout_field_type[$settings[$key][$name]['type']]['has_required'] == false
180
+ ) {
181
  $style = ' display:none; ';
182
  }
183
  else {
193
  </label>
194
  </div>
195
 
196
+ <div class="field-type-label">
197
 
198
  <label for="label_<?php echo $name ?>"><?php _e( 'Label', 'flexible-checkout-fields' ) ?></label>
199
 
218
  </div>
219
  <?php endif; ?>
220
 
221
+ <?php if( $is_custom_field ): ?>
222
+ <?php do_action( 'flexible_checkout_fields_settings_html', $key, $name, $settings ); ?>
223
+ <div>
224
+ <label for="type_<?php echo $name ?>"><?php _e( 'Field Type', 'flexible-checkout-fields' ) ?></label>
225
+
226
+ <select id="woocommerce_checkout_fields_field_type" name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][type]" disabled>
227
+ <?php foreach ($checkout_field_type as $type_key => $value): ?>
228
+ <option value="<?php echo $type_key ?>"<?php if($settings[$key][$name]['type'] == $type_key) echo " selected";?>><?php echo $value['name'] ?></option>
229
+ <?php endforeach; ?>
230
+ </select>
231
+ </div>
232
+ <?php endif; ?>
233
+ </div>
234
+ <div class="field-settings-tab-container field-settings-apperance" style="display:none;">
235
  <?php if( !$is_custom_field || empty( $checkout_field_type[$settings[$key][$name]['type']]['disable_placeholder'] ) || !$checkout_field_type[$settings[$key][$name]['type']]['disable_placeholder'] ): ?>
236
  <div class="field_placeholder">
237
  <?php
238
  $required = '';
239
+ if( isset( $settings[$key][$name]['type'] ) && isset( $checkout_field_type[$settings[$key][$name]['type']]['label_is_required'] ) ) {
240
  $required = ' required';
241
  }
242
  ?>
245
  <input type="text" id="placeholder_<?php echo $name ?>" name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][placeholder]" value="<?php if(!empty($settings[$key][$name]['placeholder'])): echo $settings[$key][$name]['placeholder']; else: echo isset($field['placeholder'])?$field['placeholder']:''; endif; ?>" <?php echo $required; ?> />
246
  </div>
247
  <?php endif; ?>
 
248
  <div>
249
  <label for="class_<?php echo $name ?>"><?php _e( 'CSS Class', 'flexible-checkout-fields' ) ?></label>
250
  <input type="text" id="class_<?php echo $name ?>" name="inspire_checkout_fields[settings][<?php echo $key ?>][<?php echo $name ?>][class]" value="<?php if(!empty($settings[$key][$name]['class'])): echo $settings[$key][$name]['class']; else: if(!empty($field['class'])) echo implode(' ', $field['class']); endif; ?>" />
251
  </div>
252
+ </div>
253
+ <?php do_action( 'flexible_checkout_fields_field_tabs_content', $key, $name, $field, $settings ); ?>
254
+ <a class="remove-field" href="#"><?php _e( 'Delete Field', 'flexible-checkout-fields' ) ?></a>
 
 
 
 
 
 
 
 
 
 
 
255
  </div>
256
  </li>
257
  <?php endforeach; ?>
259
  </div>
260
 
261
  <?php do_action( 'flexible_checkout_fields_section_settings', $key, $settings ); ?>
262
+
263
  <?php endforeach; ?>
264
 
265
  <div id="nav-menu-footer">
266
  <div class="major-publishing-actions wp-clearfix">
267
  <input type="submit" name="" value="<?php _e( 'Save Changes', 'flexible-checkout-fields' ) ?>" class="button button-primary">
268
+ <input type="submit" value="<?php _e( 'Reset Section Settings', 'flexible-checkout-fields' ); ?>" class="button reset_settings" id="submit" name="reset_settings">
269
  <span class="spinner"></span>
270
  </div>
271
  </div>
312
  html += '</div>';
313
  html += '</div>';
314
  html += '<div class="menu-item-settings field-settings">';
315
+
316
+ html += '<div style="margin-bottom: -1px ! important;" class="nav-tab-wrapper">';
317
+ html += '<a href="#general" class="nav-tab nav-tab-active"><?php _e( 'General', 'flexible-checkout-fields' ); ?></a>';
318
+ html += '<a class="nav-tab" href="#apperance"><?php _e( 'Appearance', 'flexible-checkout-fields' ); ?></a>';
319
+ <?php
320
+ $additional_tabs = apply_filters( 'flexible_checkout_fields_field_tabs', array() );
321
+ foreach ( $additional_tabs as $additional_tab ) {
322
+ ?>
323
+ html += '<a class="nav-tab" href="#<?php echo $additional_tab['hash']; ?>"><?php echo $additional_tab['title']; ?></a>';
324
+ <?php
325
+ }
326
+ ?>
327
+ html += '</div>';
328
+ html += '<div class="field-settings-tab-container field-settings-general">';
329
+
330
  <?php foreach ( $checkout_field_type as $key => $value ) : ?>
331
  <?php if ( isset( $value['description'] ) ) : ?>
332
  html += '<div class="element-<?php echo $key; ?>-description">';
353
  html += '<textarea id="label_'+ field_slug + '" class="field-name" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][label]">' + field_name + '</textarea>';
354
  html += '<p class="description"><?php _e( 'You can use HTML.', 'flexible-checkout-fields' ); ?></p>';
355
  html += '</div>';
356
+
357
+ <?php do_action( 'flexible_checkout_fields_settings_js_html' ); ?>
358
+
359
+ html += '<div>';
360
+ html += '<label for="type_' + field_slug + '"><?php _e( 'Field Type', 'flexible-checkout-fields' ) ?></label>';
361
+ html += '<select id="woocommerce_checkout_fields_field_type" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][type]" disabled>'+printSelectTypeOptions(field_type)+'</select>';
362
+ html += '</div>';
363
+
364
+ html += '</div>';
365
+ html += '<div class="field-settings-tab-container field-settings-apperance" style="display:none;">';
366
+
367
  html += '<div class="field_placeholder">';
368
  html += '<label for="placeholder_'+ field_slug +'"><?php _e( 'Placeholder', 'flexible-checkout-fields' ) ?></label>';
369
  html += '<input type="text" id="placeholder_' + field_slug + '" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][placeholder]" value="">';
372
  html += '<label for="class_' + field_slug + '"><?php _e( 'CSS Class', 'flexible-checkout-fields') ?></label>';
373
  html += '<input type="text" id="class_' + field_slug + '" name="inspire_checkout_fields[settings]['+ field_section +']['+ field_slug +'][class]" value="">';
374
  html += '</div>';
375
+
 
 
 
376
  html += '</div>';
377
+
378
+ <?php do_action( 'flexible_checkout_fields_field_tabs_content_js', $field ); ?>
379
+
380
  html += '<a class="remove-field" href="#"><?php _e( 'Delete Field', 'flexible-checkout-fields' ) ?></a>';
381
  html += '</li>';
382
  html += '';
438
  jQuery('form').bind('submit', function () {
439
  jQuery(this).find('select').prop('disabled', false);
440
  jQuery(this).find('.major-publishing-actions').find('.spinner').css('visibility', 'visible');
441
+ jQuery('.flexible_checkout_fields_add_rule select').each(function(){
442
+ jQuery(this).attr('disabled','disabled');
443
+ });
444
  });
445
 
446
  // Activate Spinner on Save
449
  if ( jQuery(this).val() == '' && jQuery(this).is(':hidden') ) {
450
  jQuery(this).closest('li').find('.item-controls>a').click();
451
  }
452
+ if ( jQuery(this).hasClass("reset_settings") ) {
453
+ if ( !confirm( '<?php _e( 'Please confirm settings reset.', 'flexible-checkout-fields' ); ?>' ) ) {
454
+ return false;
455
+ }
456
+ }
457
+ });
458
+
459
+
460
+ });
461
+ });
462
+
463
+ <?php do_action( 'flexible_checkout_fields_java_script' ); ?>
464
+
465
+ jQuery(document).on('click', '.nav-tab-wrapper > a', function() {
466
+ jQuery(this).parent().find('a').each(function() {
467
+ jQuery(this).removeClass('nav-tab-active');
468
+ });
469
+ jQuery(this).addClass('nav-tab-active');
470
+ jQuery(this).parent().parent().find('.field-settings-tab-container').each(function(){
471
+ jQuery(this).hide();
472
+ });
473
+ var href = jQuery(this).attr("href");
474
+ var hash = href.substr(href.indexOf("#")+1);
475
+ jQuery(this).parent().parent().find('.field-settings-' + hash).each(function(){
476
+ jQuery(this).show();
477
  });
478
+ jQuery(this).blur();
479
+ return false;
480
  });
481
 
482
  function printSelectTypeOptions(selected){
class/views/settings-settings.php CHANGED
@@ -31,5 +31,7 @@
31
 
32
  <?php do_action('woocommerce_checkout_fields_after_display_tab_settings'); ?>
33
 
34
- <p class="submit"><input type="submit" value="<?php _e( 'Save Changes', 'flexible-checkout-fields' ); ?>" class="button button-primary" id="submit" name=""></p>
 
 
35
  </form>
31
 
32
  <?php do_action('woocommerce_checkout_fields_after_display_tab_settings'); ?>
33
 
34
+ <p class="submit">
35
+ <input type="submit" value="<?php _e( 'Save Changes', 'flexible-checkout-fields' ); ?>" class="button button-primary" id="submit" name="">
36
+ </p>
37
  </form>
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: 1.2.3
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
@@ -67,16 +67,16 @@
67
  add_action( 'wp_enqueue_scripts', array($this, 'initPublicCssAction'), 75 );
68
  add_action( 'wp_enqueue_scripts', array($this, 'initPublicJsAction'), 75 );
69
 
70
- add_action( 'woocommerce_checkout_fields', array( $this, 'changeCheckoutFields' ), 9999 );
71
  add_action( 'woocommerce_checkout_update_order_meta', array($this, 'updateCheckoutFields'));
72
 
73
- add_action( 'woocommerce_admin_billing_fields', array($this, 'changeAdminBillingFields'));
74
- add_action( 'woocommerce_admin_shipping_fields', array($this, 'changeAdminShippingFields'));
75
- add_action( 'woocommerce_admin_order_fields', array($this, 'changeAdminOrderFields'));
76
 
77
- add_action( 'woocommerce_admin_order_data_after_billing_address', array($this, 'addCustomBillingFieldsToAdmin'), 999 );
78
- add_action( 'woocommerce_admin_order_data_after_shipping_address', array($this, 'addCustomShippingFieldsToAdmin'), 999 );
79
- add_action( 'woocommerce_admin_order_data_after_shipping_address', array($this, 'addCustomOrderFieldsToAdmin'), 999 );
80
 
81
  add_action( 'woocommerce_thankyou', array($this, 'addCustomFieldsToReview'), 75);
82
  add_action( 'woocommerce_email_order_meta', array($this, 'addCustomFieldsToEmail'), 195);
@@ -101,6 +101,10 @@
101
 
102
  add_filter( 'flexible_chekout_fields_fields', array( $this, 'getCheckoutFields'), 10, 2 );
103
 
 
 
 
 
104
  $this->get_sections();
105
  }
106
 
@@ -265,6 +269,7 @@
265
 
266
  public function getCheckoutFields( $fields, $request_type = null ) {
267
  $settings = $this->get_settings();
 
268
  $checkout_field_type = $this->get_fields();
269
  if ( !empty( $settings ) ) {
270
  $new = array();
@@ -283,56 +288,59 @@
283
  }
284
  $fields_found = true;
285
  foreach ( $type as $field_name => $field ) {
286
- if( $field['visible'] == 0 || ($_GET['page'] == 'inspire_checkout_fields_settings' && $field['visible'] == 1) || $field['name'] == 'billing_country' or $field['name'] == 'shipping_country' ){
287
- if ( isset( $fields[$key][$field['name']] ) ) {
288
- $new[$key][$field['name']] = $fields[$key][$field['name']];
289
- }
290
- else {
291
- $new[$key][$field['name']] = $type[$field['name']];
292
- }
293
- if( $field['required'] == 1 ){
294
- $new[$key][$field['name']]['required'] = true;
295
- }
296
- else{
297
- $new[$key][$field['name']]['required'] = false;
298
- }
299
- $new[$key][$field['name']]['label'] = stripcslashes($field['label']);
300
- if ( isset( $field['placeholder'] ) ) {
301
- $new[$key][$field['name']]['placeholder'] = $field['placeholder'];
302
- }
303
- else {
304
- $new[$key][$field['name']]['placeholder'] = '';
305
- }
306
- if( is_array($field['class'])){
307
- $new[$key][$field['name']]['class'] = $field['class'];
308
- }
309
- else {
310
- $new[$key][$field['name']]['class'] = explode( ' ', $field['class'] );
311
- }
312
- if(($field['name'] == 'billing_country' or $field['name'] == 'shipping_country') and $field['visible'] == 1){
313
- $new[$key][$field['name']]['class'][1] = "inspire_checkout_fields_hide";
314
- }
 
 
315
 
316
- if( isset( $field['custom_field'] ) && $field['custom_field'] == 1 ){
317
- $new[$key][$field['name']]['type'] = $field['type'];
318
-
319
- if( isset($checkout_field_type[$field['type']]['has_options'] ) ){
320
- $array_options = explode("\n", $field['option']);
321
- if(!empty($array_options)){
322
- foreach ($array_options as $option) {
323
- $tmp = explode(':', $option);
324
- $options[trim($tmp[0])] = trim($tmp[1]);
325
- unset($tmp);
326
- }
327
- $new[$key][$field['name']]['options'] = $options;
328
- unset($options);
329
- }
330
- }
331
- }
332
 
333
- $new[$key][$field['name']]['custom_attributes'] = apply_filters( 'flexible_checkout_fields_custom_attributes', array(), $field );
334
 
335
- }
 
336
  }
337
  }
338
  }
@@ -368,7 +376,7 @@
368
 
369
  if ( !empty($settings[$request_type] ) ){
370
  foreach ( $settings[$request_type] as $key => $field ) {
371
- if($field['visible'] == 0 or $field['name'] == 'billing_country' or $field['name'] == 'shipping_country' or ($_GET['page'] == 'inspire_checkout_fields_settings' and $field['visible'] == 1)){
372
 
373
  if(!empty($fields[$key])){
374
  $new[$key] = $fields[$key];
@@ -382,11 +390,11 @@
382
  }
383
 
384
  //if(!empty($field['label'])){
385
- $new[$key]['label'] = $field['label'];
386
  //}
387
  //if(!empty($field['placeholder'])){
388
  if ( isset( $field['placeholder'] ) ) {
389
- $new[$key]['placeholder'] = $field['placeholder'];
390
  }
391
  else {
392
  $new[$key]['placeholder'] = '';
@@ -413,7 +421,7 @@
413
  if(!empty($array_options)){
414
  foreach ($array_options as $option) {
415
  $tmp = explode(':', $option);
416
- $options[trim($tmp[0])] = trim($tmp[1]);
417
  unset($tmp);
418
  }
419
  $new[$key]['options'] = $options;
@@ -446,10 +454,10 @@
446
  if ( $value = get_post_meta( $order->id, '_'.$field['name'] , true ) ) {
447
  if ( isset( $field['type'] ) ) {
448
  $value = apply_filters( 'flexible_checkout_fields_print_value', $value, $field );
449
- $return[] = '<b>'.stripslashes($field['label']).'</b>: '.$value;
450
  }
451
  else{
452
- $return[] = '<b>'.stripslashes($field['label']).'</b>: '.$value;
453
  }
454
  }
455
  }
@@ -529,8 +537,8 @@
529
 
530
  if( !empty( $settings ) && is_array( $settings ) ) {
531
  $return = array();
532
- foreach ($settings as $key => $type) {
533
- foreach ($type as $field) {
534
  if($field['visible'] == 0 && isset($field['custom_field']) && $field['custom_field'] == 1){
535
  if($value = get_post_meta( $order_id, '_'.$field['name'] , true )){
536
  if ( !empty( $checkout_field_type[$field['type']]['has_options'] ) ) {
@@ -538,16 +546,16 @@
538
  if(!empty($array_options)){
539
  foreach ($array_options as $option) {
540
  $tmp = explode(':', $option);
541
- $options[trim($tmp[0])] = trim($tmp[1]);
542
  unset($tmp);
543
  }
544
  }
545
- $return[] = '<strong>'.stripslashes($field['label']).'</strong>: '.$options[$value];
546
  unset($options);
547
  }
548
  else{
549
  if ( !isset( $field['type'] ) || $field['type'] != 'file' ) {
550
- $return[] = '<strong>'.stripslashes($field['label']).'</strong>: '.$value;
551
  }
552
  }
553
  }
@@ -757,12 +765,28 @@
757
  return array_merge( $plugin_links, $links );
758
  }
759
 
760
- public static function getInstance() {
761
- if( self::$_oInstance == false ) {
762
  self::$_oInstance = new inspireCheckoutFields();
763
  }
764
  return self::$_oInstance;
765
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
 
767
  }
768
 
@@ -774,4 +798,19 @@
774
  return is_plugin_active( 'flexible-checkout-fields-pro/flexible-checkout-fields-pro.php' );
775
  }
776
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
  $_GLOBALS['inspire_checkout_fields'] = $inspire_checkout_fields = inspireCheckoutFields::getInstance();
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: 1.3
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
67
  add_action( 'wp_enqueue_scripts', array($this, 'initPublicCssAction'), 75 );
68
  add_action( 'wp_enqueue_scripts', array($this, 'initPublicJsAction'), 75 );
69
 
70
+ add_action( 'woocommerce_checkout_fields', array( $this, 'changeCheckoutFields' ) );
71
  add_action( 'woocommerce_checkout_update_order_meta', array($this, 'updateCheckoutFields'));
72
 
73
+ add_action( 'woocommerce_admin_billing_fields', array($this, 'changeAdminBillingFields') );
74
+ add_action( 'woocommerce_admin_shipping_fields', array($this, 'changeAdminShippingFields') );
75
+ add_action( 'woocommerce_admin_order_fields', array($this, 'changeAdminOrderFields') );
76
 
77
+ add_action( 'woocommerce_admin_order_data_after_billing_address', array($this, 'addCustomBillingFieldsToAdmin') );
78
+ add_action( 'woocommerce_admin_order_data_after_shipping_address', array($this, 'addCustomShippingFieldsToAdmin') );
79
+ add_action( 'woocommerce_admin_order_data_after_shipping_address', array($this, 'addCustomOrderFieldsToAdmin') );
80
 
81
  add_action( 'woocommerce_thankyou', array($this, 'addCustomFieldsToReview'), 75);
82
  add_action( 'woocommerce_email_order_meta', array($this, 'addCustomFieldsToEmail'), 195);
101
 
102
  add_filter( 'flexible_chekout_fields_fields', array( $this, 'getCheckoutFields'), 10, 2 );
103
 
104
+ add_filter( 'flexible_checkout_fields_field_tabs', array( 'inspireCheckoutFields', 'flexible_checkout_fields_field_tabs' ), 10 );
105
+
106
+ add_action( 'flexible_checkout_fields_field_tabs_content', array( 'inspireCheckoutFields', 'flexible_checkout_fields_field_tabs_content'), 10, 4 );
107
+
108
  $this->get_sections();
109
  }
110
 
269
 
270
  public function getCheckoutFields( $fields, $request_type = null ) {
271
  $settings = $this->get_settings();
272
+
273
  $checkout_field_type = $this->get_fields();
274
  if ( !empty( $settings ) ) {
275
  $new = array();
288
  }
289
  $fields_found = true;
290
  foreach ( $type as $field_name => $field ) {
291
+ if ( apply_filters( 'flexible_checkout_fields_condition', true, $field ) ) {
292
+ if( $field['visible'] == 0 or
293
+ ( ( isset( $_GET['page'] ) && $_GET['page'] == 'inspire_checkout_fields_settings' ) and $field['visible'] == 1) or $field['name'] == 'billing_country' or $field['name'] == 'shipping_country'){
294
+ if ( isset( $fields[$key][$field['name']] ) ) {
295
+ $new[$key][$field['name']] = $fields[$key][$field['name']];
296
+ }
297
+ else {
298
+ $new[$key][$field['name']] = $type[$field['name']];
299
+ }
300
+ if( $field['required'] == 1 ){
301
+ $new[$key][$field['name']]['required'] = true;
302
+ }
303
+ else{
304
+ $new[$key][$field['name']]['required'] = false;
305
+ }
306
+ $new[$key][$field['name']]['label'] = stripcslashes( wpdesk__($field['label'] , 'flexible-checkout-fields' ) );
307
+ if ( isset( $field['placeholder'] ) ) {
308
+ $new[$key][$field['name']]['placeholder'] = wpdesk__( $field['placeholder'], 'flexible-checkout-fields' );
309
+ }
310
+ else {
311
+ $new[$key][$field['name']]['placeholder'] = '';
312
+ }
313
+ if( is_array($field['class'])){
314
+ $new[$key][$field['name']]['class'] = $field['class'];
315
+ }
316
+ else {
317
+ $new[$key][$field['name']]['class'] = explode( ' ', $field['class'] );
318
+ }
319
+ if(($field['name'] == 'billing_country' or $field['name'] == 'shipping_country') and $field['visible'] == 1){
320
+ $new[$key][$field['name']]['class'][1] = "inspire_checkout_fields_hide";
321
+ }
322
 
323
+ if( isset( $field['custom_field'] ) && $field['custom_field'] == 1 ){
324
+ $new[$key][$field['name']]['type'] = $field['type'];
325
+
326
+ if( isset($field['has_options'] ) ){
327
+ $array_options = explode("\n", $field['option']);
328
+ if(!empty($array_options)){
329
+ foreach ($array_options as $option) {
330
+ $tmp = explode(':', $option);
331
+ $options[trim($tmp[0])] = wpdesk__( trim($tmp[1]), 'flexible-checkout-fields' );
332
+ unset($tmp);
333
+ }
334
+ $new[$key][$field['name']]['options'] = $options;
335
+ unset($options);
336
+ }
337
+ }
338
+ }
339
 
340
+ $new[$key][$field['name']]['custom_attributes'] = apply_filters( 'flexible_checkout_fields_custom_attributes', array(), $field );
341
 
342
+ }
343
+ }
344
  }
345
  }
346
  }
376
 
377
  if ( !empty($settings[$request_type] ) ){
378
  foreach ( $settings[$request_type] as $key => $field ) {
379
+ if($field['visible'] == 0 or $field['name'] == 'billing_country' or $field['name'] == 'shipping_country' or ( isset($_GET['page']) && $_GET['page'] == 'inspire_checkout_fields_settings' and $field['visible'] == 1)){
380
 
381
  if(!empty($fields[$key])){
382
  $new[$key] = $fields[$key];
390
  }
391
 
392
  //if(!empty($field['label'])){
393
+ $new[$key]['label'] = wpdesk__( $field['label'], 'flexible-checkout-fields' );
394
  //}
395
  //if(!empty($field['placeholder'])){
396
  if ( isset( $field['placeholder'] ) ) {
397
+ $new[$key]['placeholder'] = wpdesk__( $field['placeholder'], 'flexible-checkout-fields' );
398
  }
399
  else {
400
  $new[$key]['placeholder'] = '';
421
  if(!empty($array_options)){
422
  foreach ($array_options as $option) {
423
  $tmp = explode(':', $option);
424
+ $options[trim($tmp[0])] = wpdesk__( trim($tmp[1]), 'flexible-checkout-fields' );
425
  unset($tmp);
426
  }
427
  $new[$key]['options'] = $options;
454
  if ( $value = get_post_meta( $order->id, '_'.$field['name'] , true ) ) {
455
  if ( isset( $field['type'] ) ) {
456
  $value = apply_filters( 'flexible_checkout_fields_print_value', $value, $field );
457
+ $return[] = '<b>'.stripslashes( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ).'</b>: '.$value;
458
  }
459
  else{
460
+ $return[] = '<b>'.stripslashes( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ).'</b>: '.$value;
461
  }
462
  }
463
  }
537
 
538
  if( !empty( $settings ) && is_array( $settings ) ) {
539
  $return = array();
540
+ foreach ( $settings as $key => $type ) {
541
+ foreach ( $type as $field ) {
542
  if($field['visible'] == 0 && isset($field['custom_field']) && $field['custom_field'] == 1){
543
  if($value = get_post_meta( $order_id, '_'.$field['name'] , true )){
544
  if ( !empty( $checkout_field_type[$field['type']]['has_options'] ) ) {
546
  if(!empty($array_options)){
547
  foreach ($array_options as $option) {
548
  $tmp = explode(':', $option);
549
+ $options[trim($tmp[0])] = wpdesk__( trim($tmp[1]), 'flexible-checkout-fields' );
550
  unset($tmp);
551
  }
552
  }
553
+ $return[] = '<strong>'.stripslashes( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ).'</strong>: '.$options[$value];
554
  unset($options);
555
  }
556
  else{
557
  if ( !isset( $field['type'] ) || $field['type'] != 'file' ) {
558
+ $return[] = '<strong>'.stripslashes( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ).'</strong>: '.$value;
559
  }
560
  }
561
  }
765
  return array_merge( $plugin_links, $links );
766
  }
767
 
768
+ public static function getInstance() {
769
+ if( self::$_oInstance == false ) {
770
  self::$_oInstance = new inspireCheckoutFields();
771
  }
772
  return self::$_oInstance;
773
+ }
774
+
775
+ public static function flexible_checkout_fields_section_settings( $key, $settings ) {
776
+ echo 1;
777
+ }
778
+
779
+ public static function flexible_checkout_fields_field_tabs( $tabs ) {
780
+ $tabs[] = array(
781
+ 'hash' => 'advanced',
782
+ 'title' => __( 'Advanced', 'flexible-checkout-fields' )
783
+ );
784
+ return $tabs;
785
+ }
786
+
787
+ public static function flexible_checkout_fields_field_tabs_content( $key, $name, $field, $settings ) {
788
+ include( 'views/settings-field-advanced.php' );
789
+ }
790
 
791
  }
792
 
798
  return is_plugin_active( 'flexible-checkout-fields-pro/flexible-checkout-fields-pro.php' );
799
  }
800
 
801
+ function wpdesk__( $text, $domain ) {
802
+ if ( function_exists( 'icl_sw_filters_gettext' ) ) {
803
+ return icl_sw_filters_gettext( $text, $text, $domain, $text );
804
+ }
805
+ if ( function_exists( 'pll__' ) ) {
806
+ return pll__( $text );
807
+ }
808
+ return __( $text, $domain );
809
+ }
810
+
811
+ function wpdesk__e( $text, $domain ) {
812
+ echo wpdesk__( $text, $domain );
813
+ }
814
+
815
+
816
  $_GLOBALS['inspire_checkout_fields'] = $inspire_checkout_fields = inspireCheckoutFields::getInstance();
lang/flexible-checkout-fields-pl_PL.mo CHANGED
Binary file
lang/flexible-checkout-fields-pl_PL.po CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WooCommerce Flexible Checkout Fields\n"
4
- "POT-Creation-Date: 2016-09-06 16:06+0200\n"
5
- "PO-Revision-Date: 2016-09-06 16:06+0200\n"
6
- "Last-Translator: Maciej Swoboda <maciej.swoboda@gmail.com>\n"
7
  "Language-Team: Maciej Swoboda <maciej.swoboda@gmail.com>\n"
8
  "Language: pl_PL\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.7\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "X-Poedit-WPHeader: flexible-checkout-fields.php\n"
15
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
@@ -45,26 +45,33 @@ msgstr "Docs"
45
  msgid "Wsparcie"
46
  msgstr "Wsparcie"
47
 
48
- #: class/inspireCheckoutFieldsSettings.php:23
 
 
 
 
 
 
 
49
  msgid "Checkout Fields Settings"
50
  msgstr "Ustawienia pól zamówienia"
51
 
52
- #: class/inspireCheckoutFieldsSettings.php:23
53
  msgid "Checkout Fields"
54
  msgstr "Pola zamówienia"
55
 
56
- #: class/inspireCheckoutFieldsSettings.php:45
57
  msgid "Order Notes"
58
  msgstr "Uwagi do zamówienia"
59
 
60
- #: class/inspireCheckoutFieldsSettings.php:46
61
  msgctxt "placeholder"
62
  msgid "Notes about your order, e.g. special notes for delivery."
63
  msgstr ""
64
  "Notatka do twojego zamówienia, np. informacje o dostarczeniu przesyłki."
65
 
66
- #: class/inspireCheckoutFieldsSettings.php:72
67
- #: class/views/settings-settings.php:11 flexible-checkout-fields.php:739
68
  msgid "Settings"
69
  msgstr "Ustawienia"
70
 
@@ -112,71 +119,83 @@ msgstr "Aktywne Płatności"
112
  msgid "Conditionally display payment methods based on shipping."
113
  msgstr "Warunkowo wyświetlaj metody płatności oparte na wysyłce."
114
 
115
- #: class/views/settings-fields.php:27 class/views/settings-settings.php:8
 
 
 
 
116
  msgid "Settings saved."
117
  msgstr "Ustawienia zostały zapisane."
118
 
119
- #: class/views/settings-fields.php:35
120
  msgid "Add New Field"
121
  msgstr "Dodaj nowe pole"
122
 
123
- #: class/views/settings-fields.php:39 class/views/settings-fields.php:199
124
- #: class/views/settings-fields.php:309
125
  msgid "Field Type"
126
  msgstr "Typ pola"
127
 
128
- #: class/views/settings-fields.php:49 class/views/settings-fields.php:166
129
- #: class/views/settings-fields.php:295
130
  msgid "Label"
131
  msgstr "Etykieta"
132
 
133
- #: class/views/settings-fields.php:53 class/views/settings-fields.php:170
134
- #: class/views/settings-fields.php:297
135
  msgid "You can use HTML."
136
  msgstr "Możesz używać HTML."
137
 
138
- #: class/views/settings-fields.php:57
139
  msgid "Section"
140
  msgstr "Sekcja"
141
 
142
- #: class/views/settings-fields.php:68
143
  msgid "Save changes after adding a field."
144
  msgstr "Zapisz zmiany po dodaniu pola."
145
 
146
- #: class/views/settings-fields.php:72
147
  msgid "Add Field"
148
  msgstr "Dodaj pole"
149
 
150
- #: class/views/settings-fields.php:90
151
  msgid "Edit Section"
152
  msgstr "Edytuj sekcję"
153
 
154
- #: class/views/settings-fields.php:94 class/views/settings-fields.php:221
155
- #: class/views/settings-settings.php:34
156
  msgid "Save Changes"
157
  msgstr "Zapisz zmiany"
158
 
159
- #: class/views/settings-fields.php:102
160
  msgid "Section Fields"
161
  msgstr "Pola sekcji"
162
 
163
- #: class/views/settings-fields.php:132 class/views/settings-fields.php:263
164
  msgid "Edit"
165
  msgstr "Edytuj"
166
 
167
- #: class/views/settings-fields.php:152 class/views/settings-fields.php:284
 
 
 
 
 
 
 
 
168
  msgid "Enable Field"
169
  msgstr "Pokaż pole"
170
 
171
- #: class/views/settings-fields.php:161 class/views/settings-fields.php:291
172
  msgid "Required Field"
173
  msgstr "Pole wymagane"
174
 
175
- #: class/views/settings-fields.php:175
176
  msgid "Options"
177
  msgstr "Opcje"
178
 
179
- #: class/views/settings-fields.php:179
180
  msgid ""
181
  "Format: <code>Value : Name</code>. Value will be in the code, name will be "
182
  "visible to the user. One option per line. Example:<br /><code>woman : I am a "
@@ -187,27 +206,35 @@ msgstr ""
187
  "Przykład:<br /><code>kobieta : Jestem kobietą</code><br /><code>mezczyzna : "
188
  "Jestem mężczyzną</code>"
189
 
190
- #: class/views/settings-fields.php:185 class/views/settings-fields.php:300
191
- #: class/views/settings-fields.php:325 class/views/settings-fields.php:353
192
  msgid "Placeholder"
193
  msgstr "Placeholder"
194
 
195
- #: class/views/settings-fields.php:192 class/views/settings-fields.php:304
196
  msgid "CSS Class"
197
  msgstr "Klasa CSS"
198
 
199
- #: class/views/settings-fields.php:207 class/views/settings-fields.php:312
200
  msgid "Delete Field"
201
  msgstr "Usuń pole"
202
 
203
- #: class/views/settings-fields.php:334
 
 
 
 
204
  msgid "Enter field label!"
205
  msgstr "Wpisz etykietę pola!"
206
 
207
- #: class/views/settings-fields.php:364
208
  msgid "Do you really want to delete this field: "
209
  msgstr "Czy na pewno chcesz usunąć to pole: "
210
 
 
 
 
 
211
  #: class/views/settings-settings.php:17
212
  msgid "CSS jQuery UI"
213
  msgstr "CSS jQuery UI"
@@ -233,71 +260,80 @@ msgstr ""
233
  "Przeczytaj <a href=\"https://www.wpdesk.pl/docs/woocommerce-checkout-fields-"
234
  "docs/\" target=\"_blank\">instrukcję konfiguracji &rarr;"
235
 
236
- #: flexible-checkout-fields.php:112
237
  msgid "Billing"
238
  msgstr "Płatność"
239
 
240
- #: flexible-checkout-fields.php:118
241
  msgid "Shipping"
242
  msgstr "Wysyłka"
243
 
244
- #: flexible-checkout-fields.php:124
245
  msgid "Order"
246
  msgstr "Zamówienie"
247
 
248
- #: flexible-checkout-fields.php:135
249
  msgid "Single Line Text"
250
  msgstr "Pojedyncza linia (input)"
251
 
252
- #: flexible-checkout-fields.php:139
253
  msgid "Paragraph Text"
254
  msgstr "Obszar tekstowy (textarea)"
255
 
256
- #: flexible-checkout-fields.php:218
257
  msgid "Uploading file..."
258
  msgstr "Przesyłanie plik..."
259
 
260
- #: flexible-checkout-fields.php:249
261
  msgid "Close"
262
  msgstr "Zamknij"
263
 
264
- #: flexible-checkout-fields.php:250
265
  msgid "Today"
266
  msgstr "Dzisiaj"
267
 
268
- #: flexible-checkout-fields.php:253
269
  msgid "Next"
270
  msgstr "Następny"
271
 
272
- #: flexible-checkout-fields.php:254
273
  msgid "Previous"
274
  msgstr "Poprzedni"
275
 
276
- #: flexible-checkout-fields.php:546 flexible-checkout-fields.php:704
277
  msgid "Additional Information"
278
  msgstr "Dodatkowe informacje"
279
 
280
- #: flexible-checkout-fields.php:740
281
  msgid "https://www.wpdesk.net/docs/flexible-checkout-fields-docs/"
282
  msgstr "https://www.wpdesk.pl/docs/woocommerce-checkout-fields-docs/"
283
 
284
- #: flexible-checkout-fields.php:740
285
  msgid "Docs"
286
  msgstr "Docs"
287
 
288
- #: flexible-checkout-fields.php:741
289
  msgid "Support"
290
  msgstr "Wsparcie"
291
 
292
- #. Plugin Name of the plugin/theme
293
- msgid "Flexible Checkout Fields"
294
- msgstr "Flexible Checkout Fields"
295
 
296
  #. Plugin URI of the plugin/theme
 
297
  msgid ""
298
  "https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/"
299
  msgstr "https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/"
300
 
 
 
 
 
 
 
 
 
301
  #. Description of the plugin/theme
302
  msgid ""
303
  "Manage your WooCommerce checkout fields. Change order, labels, placeholders "
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WooCommerce Flexible Checkout Fields\n"
4
+ "POT-Creation-Date: 2016-10-07 13:09+0200\n"
5
+ "PO-Revision-Date: 2016-10-07 13:10+0200\n"
6
+ "Last-Translator: Piotr Jabłonowski <piotr.jablonowski@inspirelabs.pl>\n"
7
  "Language-Team: Maciej Swoboda <maciej.swoboda@gmail.com>\n"
8
  "Language: pl_PL\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.9\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "X-Poedit-WPHeader: flexible-checkout-fields.php\n"
15
  "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
45
  msgid "Wsparcie"
46
  msgstr "Wsparcie"
47
 
48
+ #. Plugin Name of the plugin/theme
49
+ #: class/inspireCheckoutFieldsSettings.php:25
50
+ #: class/inspireCheckoutFieldsSettings.php:28
51
+ #: class/inspireCheckoutFieldsSettings.php:36
52
+ msgid "Flexible Checkout Fields"
53
+ msgstr "Flexible Checkout Fields"
54
+
55
+ #: class/inspireCheckoutFieldsSettings.php:87
56
  msgid "Checkout Fields Settings"
57
  msgstr "Ustawienia pól zamówienia"
58
 
59
+ #: class/inspireCheckoutFieldsSettings.php:87
60
  msgid "Checkout Fields"
61
  msgstr "Pola zamówienia"
62
 
63
+ #: class/inspireCheckoutFieldsSettings.php:109
64
  msgid "Order Notes"
65
  msgstr "Uwagi do zamówienia"
66
 
67
+ #: class/inspireCheckoutFieldsSettings.php:110
68
  msgctxt "placeholder"
69
  msgid "Notes about your order, e.g. special notes for delivery."
70
  msgstr ""
71
  "Notatka do twojego zamówienia, np. informacje o dostarczeniu przesyłki."
72
 
73
+ #: class/inspireCheckoutFieldsSettings.php:136
74
+ #: class/views/settings-settings.php:11 flexible-checkout-fields.php:760
75
  msgid "Settings"
76
  msgstr "Ustawienia"
77
 
119
  msgid "Conditionally display payment methods based on shipping."
120
  msgstr "Warunkowo wyświetlaj metody płatności oparte na wysyłce."
121
 
122
+ #: class/views/settings-fields.php:27
123
+ msgid "Settings resetted."
124
+ msgstr "Ustawienia zostały zresetowane."
125
+
126
+ #: class/views/settings-fields.php:31 class/views/settings-settings.php:8
127
  msgid "Settings saved."
128
  msgstr "Ustawienia zostały zapisane."
129
 
130
+ #: class/views/settings-fields.php:39
131
  msgid "Add New Field"
132
  msgstr "Dodaj nowe pole"
133
 
134
+ #: class/views/settings-fields.php:43 class/views/settings-fields.php:224
135
+ #: class/views/settings-fields.php:360
136
  msgid "Field Type"
137
  msgstr "Typ pola"
138
 
139
+ #: class/views/settings-fields.php:53 class/views/settings-fields.php:198
140
+ #: class/views/settings-fields.php:352
141
  msgid "Label"
142
  msgstr "Etykieta"
143
 
144
+ #: class/views/settings-fields.php:57 class/views/settings-fields.php:202
145
+ #: class/views/settings-fields.php:354
146
  msgid "You can use HTML."
147
  msgstr "Możesz używać HTML."
148
 
149
+ #: class/views/settings-fields.php:61
150
  msgid "Section"
151
  msgstr "Sekcja"
152
 
153
+ #: class/views/settings-fields.php:72
154
  msgid "Save changes after adding a field."
155
  msgstr "Zapisz zmiany po dodaniu pola."
156
 
157
+ #: class/views/settings-fields.php:76
158
  msgid "Add Field"
159
  msgstr "Dodaj pole"
160
 
161
+ #: class/views/settings-fields.php:94
162
  msgid "Edit Section"
163
  msgstr "Edytuj sekcję"
164
 
165
+ #: class/views/settings-fields.php:98 class/views/settings-fields.php:267
166
+ #: class/views/settings-settings.php:35
167
  msgid "Save Changes"
168
  msgstr "Zapisz zmiany"
169
 
170
+ #: class/views/settings-fields.php:107
171
  msgid "Section Fields"
172
  msgstr "Pola sekcji"
173
 
174
+ #: class/views/settings-fields.php:137 class/views/settings-fields.php:310
175
  msgid "Edit"
176
  msgstr "Edytuj"
177
 
178
+ #: class/views/settings-fields.php:144 class/views/settings-fields.php:317
179
+ msgid "General"
180
+ msgstr "Główne"
181
+
182
+ #: class/views/settings-fields.php:145 class/views/settings-fields.php:318
183
+ msgid "Appearance"
184
+ msgstr "Wygląd"
185
+
186
+ #: class/views/settings-fields.php:170 class/views/settings-fields.php:341
187
  msgid "Enable Field"
188
  msgstr "Pokaż pole"
189
 
190
+ #: class/views/settings-fields.php:192 class/views/settings-fields.php:348
191
  msgid "Required Field"
192
  msgstr "Pole wymagane"
193
 
194
+ #: class/views/settings-fields.php:213
195
  msgid "Options"
196
  msgstr "Opcje"
197
 
198
+ #: class/views/settings-fields.php:217
199
  msgid ""
200
  "Format: <code>Value : Name</code>. Value will be in the code, name will be "
201
  "visible to the user. One option per line. Example:<br /><code>woman : I am a "
206
  "Przykład:<br /><code>kobieta : Jestem kobietą</code><br /><code>mezczyzna : "
207
  "Jestem mężczyzną</code>"
208
 
209
+ #: class/views/settings-fields.php:243 class/views/settings-fields.php:368
210
+ #: class/views/settings-fields.php:393 class/views/settings-fields.php:421
211
  msgid "Placeholder"
212
  msgstr "Placeholder"
213
 
214
+ #: class/views/settings-fields.php:249 class/views/settings-fields.php:372
215
  msgid "CSS Class"
216
  msgstr "Klasa CSS"
217
 
218
+ #: class/views/settings-fields.php:254 class/views/settings-fields.php:380
219
  msgid "Delete Field"
220
  msgstr "Usuń pole"
221
 
222
+ #: class/views/settings-fields.php:268
223
+ msgid "Reset Section Settings"
224
+ msgstr "Resetuj ustawienia sekcji"
225
+
226
+ #: class/views/settings-fields.php:402
227
  msgid "Enter field label!"
228
  msgstr "Wpisz etykietę pola!"
229
 
230
+ #: class/views/settings-fields.php:432
231
  msgid "Do you really want to delete this field: "
232
  msgstr "Czy na pewno chcesz usunąć to pole: "
233
 
234
+ #: class/views/settings-fields.php:453
235
+ msgid "Please confirm settings reset."
236
+ msgstr "Potwierdź reset ustawień."
237
+
238
  #: class/views/settings-settings.php:17
239
  msgid "CSS jQuery UI"
240
  msgstr "CSS jQuery UI"
260
  "Przeczytaj <a href=\"https://www.wpdesk.pl/docs/woocommerce-checkout-fields-"
261
  "docs/\" target=\"_blank\">instrukcję konfiguracji &rarr;"
262
 
263
+ #: flexible-checkout-fields.php:116
264
  msgid "Billing"
265
  msgstr "Płatność"
266
 
267
+ #: flexible-checkout-fields.php:122
268
  msgid "Shipping"
269
  msgstr "Wysyłka"
270
 
271
+ #: flexible-checkout-fields.php:128
272
  msgid "Order"
273
  msgstr "Zamówienie"
274
 
275
+ #: flexible-checkout-fields.php:139
276
  msgid "Single Line Text"
277
  msgstr "Pojedyncza linia (input)"
278
 
279
+ #: flexible-checkout-fields.php:143
280
  msgid "Paragraph Text"
281
  msgstr "Obszar tekstowy (textarea)"
282
 
283
+ #: flexible-checkout-fields.php:222
284
  msgid "Uploading file..."
285
  msgstr "Przesyłanie plik..."
286
 
287
+ #: flexible-checkout-fields.php:253
288
  msgid "Close"
289
  msgstr "Zamknij"
290
 
291
+ #: flexible-checkout-fields.php:254
292
  msgid "Today"
293
  msgstr "Dzisiaj"
294
 
295
+ #: flexible-checkout-fields.php:257
296
  msgid "Next"
297
  msgstr "Następny"
298
 
299
+ #: flexible-checkout-fields.php:258
300
  msgid "Previous"
301
  msgstr "Poprzedni"
302
 
303
+ #: flexible-checkout-fields.php:567 flexible-checkout-fields.php:725
304
  msgid "Additional Information"
305
  msgstr "Dodatkowe informacje"
306
 
307
+ #: flexible-checkout-fields.php:761
308
  msgid "https://www.wpdesk.net/docs/flexible-checkout-fields-docs/"
309
  msgstr "https://www.wpdesk.pl/docs/woocommerce-checkout-fields-docs/"
310
 
311
+ #: flexible-checkout-fields.php:761
312
  msgid "Docs"
313
  msgstr "Docs"
314
 
315
+ #: flexible-checkout-fields.php:762
316
  msgid "Support"
317
  msgstr "Wsparcie"
318
 
319
+ #: flexible-checkout-fields.php:782
320
+ msgid "Advanced"
321
+ msgstr "Zaawansowane"
322
 
323
  #. Plugin URI of the plugin/theme
324
+ #: views/settings-field-advanced.php:4
325
  msgid ""
326
  "https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/"
327
  msgstr "https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/"
328
 
329
+ #: views/settings-field-advanced.php:5
330
+ #, php-format
331
+ msgid ""
332
+ "Check %sFlexible Checkout Fields PRO%s → to add conditional logic for field."
333
+ msgstr ""
334
+ "Sprawdź %sFlexible Checkout Fields PRO%s → aby włączyć logikę warunkową dla "
335
+ "pól."
336
+
337
  #. Description of the plugin/theme
338
  msgid ""
339
  "Manage your WooCommerce checkout fields. Change order, labels, placeholders "
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.wpdesk.net/flexible-checkout-fields-woocommerce/
4
  Tags: woocommerce checkout, woocommerce checkout fields, flexible checkout 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
5
  Requires at least: 4.0
6
  Tested up to: 4.6.1
7
- Stable tag: 1.2.3
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -61,6 +61,10 @@ Add new fields to WooCommerce checkout:
61
  * HTML or plain text
62
  * File Upload
63
 
 
 
 
 
64
  = Custom Field Sections (PRO) =
65
 
66
  Billing, Shipping or Order sections are not enough? Now you can add fields to 12 other checkout sections. Below you will find all sections and their corresponding hooks (hooks are just for developers' reference - if you do not know what hooks are just ignore them and you'll be just fine - it will just work).
@@ -78,6 +82,15 @@ Billing, Shipping or Order sections are not enough? Now you can add fields to 12
78
  * Before Submit - `woocommerce_review_order_before_submit`
79
  * After Submit - `woocommerce_review_order_after_submit`
80
 
 
 
 
 
 
 
 
 
 
81
  > **Upgrade to Flexible Checkout Fields PRO**<br />
82
  > Get all PRO features and priority e-mail support. [Upgrade Now &rarr;](https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/?utm_source=wporg&utm_medium=link&utm_campaign=wporg-fcf)
83
 
@@ -129,6 +142,12 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
129
 
130
  == Changelog ==
131
 
 
 
 
 
 
 
132
  = 1.2.3 - 2016-09-22 =
133
  * Fixed a warning on line 530
134
 
4
  Tags: woocommerce checkout, woocommerce checkout fields, flexible checkout 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
5
  Requires at least: 4.0
6
  Tested up to: 4.6.1
7
+ Stable tag: 1.3
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
61
  * HTML or plain text
62
  * File Upload
63
 
64
+ = Multilanguage ready =
65
+
66
+ Flexible Checkout Fields is compatible with WPML and Polylang and lets you translate fields data to other languages.
67
+
68
  = Custom Field Sections (PRO) =
69
 
70
  Billing, Shipping or Order sections are not enough? Now you can add fields to 12 other checkout sections. Below you will find all sections and their corresponding hooks (hooks are just for developers' reference - if you do not know what hooks are just ignore them and you'll be just fine - it will just work).
82
  * Before Submit - `woocommerce_review_order_before_submit`
83
  * After Submit - `woocommerce_review_order_after_submit`
84
 
85
+ = Conditional Logic (PRO) =
86
+
87
+ Enable conditional logic (show or hide) for fields based on products and/or categories in the cart, i.e.:
88
+
89
+ * Show engraving field for jewelery category
90
+ * Show delivery date option only for physical products
91
+ * Show VAT Number for digital goods
92
+ * Hide address fields for digital goods
93
+
94
  > **Upgrade to Flexible Checkout Fields PRO**<br />
95
  > Get all PRO features and priority e-mail support. [Upgrade Now &rarr;](https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/?utm_source=wporg&utm_medium=link&utm_campaign=wporg-fcf)
96
 
142
 
143
  == Changelog ==
144
 
145
+ = 1.3 - 2016-10-07 =
146
+ * Added support for fields conditional logic based on products and categories (available in the PRO version)
147
+ * Added option to reset section settings
148
+ * Added better support for third party plugins that add checkout fields
149
+ * Added WPML and Polylang support
150
+
151
  = 1.2.3 - 2016-09-22 =
152
  * Fixed a warning on line 530
153
 
views/settings-field-advanced.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2
+ <div class="field-settings-tab-container field-settings-advanced" style="display:none;">
3
+ <div>
4
+ <?php
5
+ $url = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/' : 'https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/';
6
+ echo sprintf( __( '%sGo PRO &rarr;%s to add conditional logic based on products and categories.' , 'flexible-checkout-fields' ), '<a href="' . $url . '" target="_blank">', '</a>' );
7
+ ?>
8
+ </div>
9
+ </div>