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

Version Description

  • 2016-10-24 =
  • Fixed resetting section's settings which blocked ability to edit fields in the order
  • Fixed potential warning on the thank you page
Download this release

Release Info

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

Code changes from version 1.3 to 1.3.1

class/inspireCheckoutFieldsSettings.php CHANGED
@@ -100,7 +100,7 @@
100
  $countries = new WC_Countries();
101
  $billing = $countries->get_address_fields($countries->get_base_country(), 'billing_');
102
  $shipping = $countries->get_address_fields($countries->get_base_country(), 'shipping_');
103
-
104
  if( empty( $settings ) || empty( $settings['order'] ) ) {
105
  $order = array(
106
  'order_comments' => array(
100
  $countries = new WC_Countries();
101
  $billing = $countries->get_address_fields($countries->get_base_country(), 'billing_');
102
  $shipping = $countries->get_address_fields($countries->get_base_country(), 'shipping_');
103
+
104
  if( empty( $settings ) || empty( $settings['order'] ) ) {
105
  $order = array(
106
  'order_comments' => array(
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.3
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-checkout-fields
@@ -67,12 +67,12 @@
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') );
@@ -90,9 +90,9 @@
90
 
91
  add_action( 'woocommerce_edit_address_slugs', array($this, 'changeEditAddressSlugToEnglish'), 95);
92
 
93
- add_action( 'woocommerce_billing_fields', array($this, 'addCustomFieldsBillingFields'), 95);
94
- add_action( 'woocommerce_shipping_fields', array($this, 'addCustomFieldsShippingFields'), 95);
95
- add_action( 'woocommerce_order_fields', array($this, 'addCustomFieldsOrderFields'), 95);
96
 
97
 
98
  add_action( 'woocommerce_before_checkout_form', array( $this, 'woocommerce_before_checkout_form' ), 10 );
@@ -473,10 +473,10 @@
473
 
474
  public function changeAdminLabelsCheckoutFields( $labels, $request_type ) {
475
  $settings = $this->get_settings();
476
- if(!empty($settings)){
477
  $new = array();
478
  foreach ($settings as $key => $type) {
479
- if($request_type == null || $request_type == $key){
480
  foreach ($type as $field) {
481
  if ( $field['visible'] == 0 && ($request_type == null || strpos($field['name'], $request_type) === 0 )
482
  && ( ( empty( $field['type'] ) || ( $field['type'] != 'heading' && $field['type'] != 'info' && $field['type'] != 'file' ) ) )
@@ -538,29 +538,31 @@
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'] ) ) {
545
- $array_options = explode("\n", $field['option']);
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
- }
562
- }
563
- }
 
 
564
  }
565
  if( count($return) > 0 ) {
566
  echo '<div class="inspire_checkout_fields_additional_information">';
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.1
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' ), 9 );
71
+ add_action( 'woocommerce_checkout_update_order_meta', array($this, 'updateCheckoutFields'), 9 );
72
 
73
+ add_action( 'woocommerce_admin_billing_fields', array($this, 'changeAdminBillingFields'), 9 );
74
+ add_action( 'woocommerce_admin_shipping_fields', array($this, 'changeAdminShippingFields'), 9 );
75
+ add_action( 'woocommerce_admin_order_fields', array($this, 'changeAdminOrderFields'), 9 );
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') );
90
 
91
  add_action( 'woocommerce_edit_address_slugs', array($this, 'changeEditAddressSlugToEnglish'), 95);
92
 
93
+ add_action( 'woocommerce_billing_fields', array($this, 'addCustomFieldsBillingFields'), 9 );
94
+ add_action( 'woocommerce_shipping_fields', array($this, 'addCustomFieldsShippingFields'), 9 );
95
+ add_action( 'woocommerce_order_fields', array($this, 'addCustomFieldsOrderFields'), 9 );
96
 
97
 
98
  add_action( 'woocommerce_before_checkout_form', array( $this, 'woocommerce_before_checkout_form' ), 10 );
473
 
474
  public function changeAdminLabelsCheckoutFields( $labels, $request_type ) {
475
  $settings = $this->get_settings();
476
+ if( !empty( $settings ) && ( $request_type == null || !empty( $settings[$request_type] ) ) ) {
477
  $new = array();
478
  foreach ($settings as $key => $type) {
479
+ if ( $request_type == null || $request_type == $key ) {
480
  foreach ($type as $field) {
481
  if ( $field['visible'] == 0 && ($request_type == null || strpos($field['name'], $request_type) === 0 )
482
  && ( ( empty( $field['type'] ) || ( $field['type'] != 'heading' && $field['type'] != 'info' && $field['type'] != 'file' ) ) )
538
  if( !empty( $settings ) && is_array( $settings ) ) {
539
  $return = array();
540
  foreach ( $settings as $key => $type ) {
541
+ if ( isset( $type ) && is_array( $type ) ) {
542
+ foreach ( $type as $field ) {
543
+ if($field['visible'] == 0 && isset($field['custom_field']) && $field['custom_field'] == 1){
544
+ if($value = get_post_meta( $order_id, '_'.$field['name'] , true )){
545
+ if ( !empty( $checkout_field_type[$field['type']]['has_options'] ) ) {
546
+ $array_options = explode("\n", $field['option']);
547
+ if(!empty($array_options)){
548
+ foreach ($array_options as $option) {
549
+ $tmp = explode(':', $option);
550
+ $options[trim($tmp[0])] = wpdesk__( trim($tmp[1]), 'flexible-checkout-fields' );
551
+ unset($tmp);
552
+ }
553
+ }
554
+ $return[] = '<strong>'.stripslashes( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ).'</strong>: '.$options[$value];
555
+ unset($options);
556
+ }
557
+ else{
558
+ if ( !isset( $field['type'] ) || $field['type'] != 'file' ) {
559
+ $return[] = '<strong>'.stripslashes( wpdesk__( $field['label'], 'flexible-checkout-fields' ) ).'</strong>: '.$value;
560
+ }
561
+ }
562
+ }
563
+ }
564
+ }
565
+ }
566
  }
567
  if( count($return) > 0 ) {
568
  echo '<div class="inspire_checkout_fields_additional_information">';
lang/flexible-checkout-fields-pl_PL.mo CHANGED
Binary file
lang/flexible-checkout-fields-pl_PL.po CHANGED
@@ -1,8 +1,8 @@
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"
@@ -71,7 +71,7 @@ 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
 
@@ -300,40 +300,39 @@ msgstr "Następny"
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 "
@@ -350,6 +349,13 @@ msgstr "WP Desk"
350
  msgid "https://www.wpdesk.net/"
351
  msgstr "https://www.wpdesk.pl/"
352
 
 
 
 
 
 
 
 
353
  #~ msgid "https://www.wpdesk.net/products/flexible-checkout-fields/"
354
  #~ msgstr "https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/"
355
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WooCommerce Flexible Checkout Fields\n"
4
+ "POT-Creation-Date: 2016-10-18 09:00+0200\n"
5
+ "PO-Revision-Date: 2016-10-18 09:01+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"
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:762
75
  msgid "Settings"
76
  msgstr "Ustawienia"
77
 
300
  msgid "Previous"
301
  msgstr "Poprzedni"
302
 
303
+ #: flexible-checkout-fields.php:569 flexible-checkout-fields.php:727
304
  msgid "Additional Information"
305
  msgstr "Dodatkowe informacje"
306
 
307
+ #: flexible-checkout-fields.php:763
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:763
312
  msgid "Docs"
313
  msgstr "Docs"
314
 
315
+ #: flexible-checkout-fields.php:764
316
  msgid "Support"
317
  msgstr "Wsparcie"
318
 
319
+ #: flexible-checkout-fields.php:784
320
  msgid "Advanced"
321
  msgstr "Zaawansowane"
322
 
323
+ #: views/settings-field-advanced.php:6
324
+ #, php-format
325
+ msgid ""
326
+ "%sGo PRO &rarr;%s to add conditional logic based on products and categories."
327
+ msgstr ""
328
+ "%sKup wersję PRO &rarr;%s aby dodać logikę warunkową opartą na produktach i "
329
+ "kategoriach."
330
+
331
  #. Plugin URI of the plugin/theme
 
332
  msgid ""
333
  "https://www.wpdesk.net/products/flexible-checkout-fields-pro-woocommerce/"
334
  msgstr "https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/"
335
 
 
 
 
 
 
 
 
 
336
  #. Description of the plugin/theme
337
  msgid ""
338
  "Manage your WooCommerce checkout fields. Change order, labels, placeholders "
349
  msgid "https://www.wpdesk.net/"
350
  msgstr "https://www.wpdesk.pl/"
351
 
352
+ #~ msgid ""
353
+ #~ "Check %sFlexible Checkout Fields PRO%s → to add conditional logic for "
354
+ #~ "field."
355
+ #~ msgstr ""
356
+ #~ "Sprawdź %sFlexible Checkout Fields PRO%s → aby włączyć logikę warunkową "
357
+ #~ "dla pól."
358
+
359
  #~ msgid "https://www.wpdesk.net/products/flexible-checkout-fields/"
360
  #~ msgstr "https://www.wpdesk.pl/sklep/woocommerce-checkout-fields/"
361
 
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.3
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -142,6 +142,10 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
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
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.1
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
142
 
143
  == Changelog ==
144
 
145
+ = 1.3.1 - 2016-10-24 =
146
+ * Fixed resetting section's settings which blocked ability to edit fields in the order
147
+ * Fixed potential warning on the thank you page
148
+
149
  = 1.3 - 2016-10-07 =
150
  * Added support for fields conditional logic based on products and categories (available in the PRO version)
151
  * Added option to reset section settings