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

Version Description

  • 2016-11-23 =
  • Limit field name to 20 characters in order to prevent DB problems (this only behind the scenes, labels and user all visible elements remain intact)
Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

class/views/settings-fields.php CHANGED
@@ -251,7 +251,9 @@
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; ?>
@@ -293,7 +295,8 @@ jQuery(document).ready(function () {
293
  var field_section = jQuery(this).find('#woocommerce_checkout_fields_field_section').val();
294
  var field_type = jQuery(this).find('#woocommerce_checkout_fields_field_type').val();
295
  var field_option = jQuery(this).find('#woocommerce_checkout_fields_field_option').val();
296
- var field_slug = stringToSlug(field_section + '_' + field_name + '_' + Math.floor((Math.random() * 100000) + 1));
 
297
 
298
  // Proceed if Name (label) is filled
299
  if(field_name) {
251
  </div>
252
  </div>
253
  <?php do_action( 'flexible_checkout_fields_field_tabs_content', $key, $name, $field, $settings ); ?>
254
+ <?php if ( $is_custom_field ) : ?>
255
+ <a class="remove-field" href="#"><?php _e( 'Delete Field', 'flexible-checkout-fields' ) ?></a>
256
+ <?php endif; ?>
257
  </div>
258
  </li>
259
  <?php endforeach; ?>
295
  var field_section = jQuery(this).find('#woocommerce_checkout_fields_field_section').val();
296
  var field_type = jQuery(this).find('#woocommerce_checkout_fields_field_type').val();
297
  var field_option = jQuery(this).find('#woocommerce_checkout_fields_field_option').val();
298
+ //var field_slug = stringToSlug(field_section + '_' + field_name + '_' + Math.floor((Math.random() * 100000) + 1));
299
+ var field_slug = field_section + '_' + stringToSlug(field_name).substr(0,20) + '_' + Math.floor((Math.random() * 100000) + 1);
300
 
301
  // Proceed if Name (label) is filled
302
  if(field_name) {
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.1
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' ), 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,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'), 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 );
@@ -800,18 +800,22 @@
800
  return is_plugin_active( 'flexible-checkout-fields-pro/flexible-checkout-fields-pro.php' );
801
  }
802
 
803
- function wpdesk__( $text, $domain ) {
804
- if ( function_exists( 'icl_sw_filters_gettext' ) ) {
805
- return icl_sw_filters_gettext( $text, $text, $domain, $text );
 
 
 
 
 
 
806
  }
807
- if ( function_exists( 'pll__' ) ) {
808
- return pll__( $text );
809
- }
810
- return __( $text, $domain );
811
  }
812
 
813
- function wpdesk__e( $text, $domain ) {
814
- echo wpdesk__( $text, $domain );
 
 
815
  }
816
 
817
 
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.2
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' ), 9999 );
71
  add_action( 'woocommerce_checkout_update_order_meta', array($this, 'updateCheckoutFields'), 9 );
72
 
73
+ add_action( 'woocommerce_admin_billing_fields', array($this, 'changeAdminBillingFields'), 9999 );
74
+ add_action( 'woocommerce_admin_shipping_fields', array($this, 'changeAdminShippingFields'), 9999 );
75
+ add_action( 'woocommerce_admin_order_fields', array($this, 'changeAdminOrderFields'), 9999 );
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'), 9999 );
94
+ add_action( 'woocommerce_shipping_fields', array($this, 'addCustomFieldsShippingFields'), 9999 );
95
+ add_action( 'woocommerce_order_fields', array($this, 'addCustomFieldsOrderFields'), 9999 );
96
 
97
 
98
  add_action( 'woocommerce_before_checkout_form', array( $this, 'woocommerce_before_checkout_form' ), 10 );
800
  return is_plugin_active( 'flexible-checkout-fields-pro/flexible-checkout-fields-pro.php' );
801
  }
802
 
803
+ if ( !function_exists( 'wpdesk__' ) ) {
804
+ function wpdesk__( $text, $domain ) {
805
+ if ( function_exists( 'icl_sw_filters_gettext' ) ) {
806
+ return icl_sw_filters_gettext( $text, $text, $domain, $text );
807
+ }
808
+ if ( function_exists( 'pll__' ) ) {
809
+ return pll__( $text );
810
+ }
811
+ return __( $text, $domain );
812
  }
 
 
 
 
813
  }
814
 
815
+ if ( !function_exists( 'wpdesk__e' ) ) {
816
+ function wpdesk__e( $text, $domain ) {
817
+ echo wpdesk__( $text, $domain );
818
+ }
819
  }
820
 
821
 
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.1
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -142,6 +142,9 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
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
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.2
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.2 - 2016-11-23 =
146
+ * Limit field name to 20 characters in order to prevent DB problems (this only behind the scenes, labels and user all visible elements remain intact)
147
+
148
  = 1.3.1 - 2016-10-24 =
149
  * Fixed resetting section's settings which blocked ability to edit fields in the order
150
  * Fixed potential warning on the thank you page