Version Description
- 2019-01-31 =
- Fixed fields order in configuration
- Fixed unwanted validation on additional sections when PRO plugin disabled
- Fixed box display for incorrect validation
- Fixed errors after save fields
- Fixed Polylang translations on select options
- Fixed non city countries validation
Download this release
Release Info
Developer | jablonowski |
Plugin | Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager |
Version | 1.8.2 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.8.2
- classes/field-options.php +1 -1
- classes/settings.php +13 -4
- classes/views/settings-fields.php +9 -2
- flexible-checkout-fields.php +128 -53
- readme.txt +9 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +2 -2
classes/field-options.php
CHANGED
@@ -38,7 +38,7 @@ class Flexible_Checkout_Fields_Field_Options {
|
|
38 |
$option_value = trim( $option_array[0] );
|
39 |
$option_label = $option_value;
|
40 |
if ( isset( $option_array[1] ) ) {
|
41 |
-
$option_label = wp_unslash( strip_tags( $option_array[1], self::ALLOWED_HTML_TAGS_IN_OPTION ) );
|
42 |
}
|
43 |
$options[ $option_value ] = wpdesk__( $option_label, 'flexible-checkout-fields' );
|
44 |
unset( $option_array );
|
38 |
$option_value = trim( $option_array[0] );
|
39 |
$option_label = $option_value;
|
40 |
if ( isset( $option_array[1] ) ) {
|
41 |
+
$option_label = wp_unslash( strip_tags( trim( $option_array[1] ), self::ALLOWED_HTML_TAGS_IN_OPTION ) );
|
42 |
}
|
43 |
$options[ $option_value ] = wpdesk__( $option_label, 'flexible-checkout-fields' );
|
44 |
unset( $option_array );
|
classes/settings.php
CHANGED
@@ -257,6 +257,7 @@
|
|
257 |
*/
|
258 |
|
259 |
public function updateSettingsAction(){
|
|
|
260 |
if ( !empty( $_POST ) ) {
|
261 |
if ( !empty($_POST['option_page']) && in_array( $_POST['option_page'], array('inspire_checkout_fields_settings', 'inspire_checkout_fields_checkboxes') ) ) {
|
262 |
if ( !empty( $_POST[$this->plugin->get_namespace()] ) ) {
|
@@ -273,7 +274,7 @@
|
|
273 |
if ( empty( $settings[$key] ) ) {
|
274 |
$settings[$key] = array();
|
275 |
}
|
276 |
-
foreach ( $settings[$key] as $field_name
|
277 |
if ( isset( $field['custom_field'] ) && $field['custom_field'] == '1' ) {
|
278 |
if ( isset( $field['short_name'] ) && $field['short_name'] ) {
|
279 |
$new_field_name = $key . '_' . $field['short_name'];
|
@@ -292,8 +293,16 @@
|
|
292 |
}
|
293 |
}
|
294 |
}
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
$section_settings[$field_name] = $field;
|
298 |
}
|
299 |
$settings[$key] = $section_settings;
|
@@ -305,7 +314,7 @@
|
|
305 |
}
|
306 |
update_option( 'inspire_checkout_fields_' . $name, $settings );
|
307 |
$settings = get_option( 'inspire_checkout_fields_' . $name, array() );
|
308 |
-
$this->plugin->
|
309 |
}
|
310 |
}
|
311 |
elseif ( empty( $_POST[$this->plugin->get_namespace()] ) && $_POST['option_page'] == 'inspire_checkout_fields_checkboxes' ) {
|
257 |
*/
|
258 |
|
259 |
public function updateSettingsAction(){
|
260 |
+
|
261 |
if ( !empty( $_POST ) ) {
|
262 |
if ( !empty($_POST['option_page']) && in_array( $_POST['option_page'], array('inspire_checkout_fields_settings', 'inspire_checkout_fields_checkboxes') ) ) {
|
263 |
if ( !empty( $_POST[$this->plugin->get_namespace()] ) ) {
|
274 |
if ( empty( $settings[$key] ) ) {
|
275 |
$settings[$key] = array();
|
276 |
}
|
277 |
+
foreach ( $settings[ $key ] as $field_name => $field ) {
|
278 |
if ( isset( $field['custom_field'] ) && $field['custom_field'] == '1' ) {
|
279 |
if ( isset( $field['short_name'] ) && $field['short_name'] ) {
|
280 |
$new_field_name = $key . '_' . $field['short_name'];
|
293 |
}
|
294 |
}
|
295 |
}
|
296 |
+
if ( empty( $field['label'] ) ) {
|
297 |
+
$field['label'] = '';
|
298 |
+
} else {
|
299 |
+
$field['label'] = wp_unslash( $field['label'] );
|
300 |
+
}
|
301 |
+
if ( empty( $field['placeholder'] ) ) {
|
302 |
+
$field['placeholder'] = '';
|
303 |
+
} else {
|
304 |
+
$field['placeholder'] = wp_unslash( $field['placeholder'] );
|
305 |
+
}
|
306 |
$section_settings[$field_name] = $field;
|
307 |
}
|
308 |
$settings[$key] = $section_settings;
|
314 |
}
|
315 |
update_option( 'inspire_checkout_fields_' . $name, $settings );
|
316 |
$settings = get_option( 'inspire_checkout_fields_' . $name, array() );
|
317 |
+
$this->plugin->init_sections();
|
318 |
}
|
319 |
}
|
320 |
elseif ( empty( $_POST[$this->plugin->get_namespace()] ) && $_POST['option_page'] == 'inspire_checkout_fields_checkboxes' ) {
|
classes/views/settings-fields.php
CHANGED
@@ -880,8 +880,15 @@ foreach ( $plugin->sections as $section ) {
|
|
880 |
// Activate Spinner on Save
|
881 |
jQuery('input[type="submit"]').on('click', function (event) {
|
882 |
jQuery('#inspire_checkout_field [required]').each(function () {
|
883 |
-
if (jQuery(this).val()
|
884 |
-
jQuery(this).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
885 |
}
|
886 |
});
|
887 |
if (jQuery(this).hasClass("reset_settings")) {
|
880 |
// Activate Spinner on Save
|
881 |
jQuery('input[type="submit"]').on('click', function (event) {
|
882 |
jQuery('#inspire_checkout_field [required]').each(function () {
|
883 |
+
if (jQuery(this).val() === '' && jQuery(this).is(':hidden')) {
|
884 |
+
jQuery(this).css('border-color', 'red' );
|
885 |
+
var classes = jQuery(this).closest('.field-settings-tab-container').attr('class').split(' ');
|
886 |
+
var tab = classes[1].split('-')[2];
|
887 |
+
jQuery(this).closest('.field-settings').find('.field-settings-tab-container').hide();
|
888 |
+
jQuery(this).closest('.field-settings').find('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
889 |
+
jQuery(this).closest('.field-settings').find('a[href="#' + tab + '"]').addClass('nav-tab-active');
|
890 |
+
jQuery('.' + classes[1] ).show();
|
891 |
+
jQuery(this).closest('li').find('.field-settings').slideDown();
|
892 |
}
|
893 |
});
|
894 |
if (jQuery(this).hasClass("reset_settings")) {
|
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.8.
|
7 |
Author: WP Desk
|
8 |
Author URI: https://www.wpdesk.net/
|
9 |
Text Domain: flexible-checkout-fields
|
@@ -11,7 +11,7 @@
|
|
11 |
Requires at least: 4.6
|
12 |
Tested up to: 5.0.3
|
13 |
WC requires at least: 3.1.0
|
14 |
-
WC tested up to: 3.5.
|
15 |
|
16 |
Copyright 2017 WP Desk Ltd.
|
17 |
|
@@ -33,7 +33,7 @@
|
|
33 |
|
34 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
35 |
|
36 |
-
$plugin_version = '1.8.
|
37 |
define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
|
38 |
|
39 |
|
@@ -68,7 +68,7 @@
|
|
68 |
|
69 |
class Flexible_Checkout_Fields_Plugin extends WPDesk_Plugin_1_8 {
|
70 |
|
71 |
-
protected $script_version = '1.8.
|
72 |
|
73 |
protected $fields = array();
|
74 |
|
@@ -176,7 +176,7 @@
|
|
176 |
public function plugins_loaded() {
|
177 |
$this->init_fields();
|
178 |
//do użycia dla pola miasto, kod pocztowy i stan
|
179 |
-
$this->
|
180 |
}
|
181 |
|
182 |
public function getSettingValue( $name, $default = null ) {
|
@@ -213,35 +213,37 @@
|
|
213 |
return $fields;
|
214 |
}
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
|
|
|
|
245 |
|
246 |
function init_fields() {
|
247 |
$this->fields['text'] = array(
|
@@ -324,11 +326,46 @@
|
|
324 |
return apply_filters( 'flexible_checkout_fields_fields' , $this->fields );
|
325 |
}
|
326 |
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
|
333 |
function woocommerce_before_checkout_form() {
|
334 |
WC()->session->set( 'checkout-fields', array() );
|
@@ -491,7 +528,7 @@
|
|
491 |
foreach ( $type as $field_name => $field ) {
|
492 |
if ( apply_filters( 'flexible_checkout_fields_condition', true, $field ) ) {
|
493 |
if ( $field['visible'] == 0 or
|
494 |
-
( ( isset( $_GET['page'] ) && $_GET['page'] == 'inspire_checkout_fields_settings' )
|
495 |
{
|
496 |
$custom_field = false;
|
497 |
if( isset( $field['custom_field'] ) && $field['custom_field'] == 1 ) {
|
@@ -527,7 +564,7 @@
|
|
527 |
else {
|
528 |
$new[$key][$field['name']]['class'] = explode( ' ', $field['class'] );
|
529 |
}
|
530 |
-
if ( ($field['name'] == 'billing_country'
|
531 |
$new[$key][$field['name']]['class'][1] = "inspire_checkout_fields_hide";
|
532 |
}
|
533 |
if ( ! $custom_field ) {
|
@@ -583,15 +620,21 @@
|
|
583 |
$new[$type][$key]['priority'] = $priority;
|
584 |
}
|
585 |
}
|
|
|
586 |
if ( $request_type == null ) {
|
587 |
if ( !empty($fields['account'] ) ) {
|
588 |
$new['account'] = $fields['account'];
|
589 |
}
|
|
|
|
|
|
|
|
|
590 |
return $new;
|
591 |
}
|
592 |
else{
|
593 |
if ( isset( $new[$request_type] ) ) {
|
594 |
-
|
|
|
595 |
}
|
596 |
else {
|
597 |
return array();
|
@@ -603,6 +646,35 @@
|
|
603 |
}
|
604 |
}
|
605 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
public function getCheckoutUserFields($fields, $request_type = null) {
|
607 |
$settings = $this->get_settings();
|
608 |
|
@@ -613,7 +685,7 @@
|
|
613 |
if ( !empty($settings[$request_type] ) ) {
|
614 |
foreach ( $settings[$request_type] as $key => $field ) {
|
615 |
|
616 |
-
if($field['visible'] == 0
|
617 |
if(!empty($fields[$key])){
|
618 |
$new[$key] = $fields[$key];
|
619 |
}
|
@@ -644,7 +716,7 @@
|
|
644 |
}
|
645 |
|
646 |
if ( !empty( $field['name'] ) ) {
|
647 |
-
if ( ( $field['name'] == 'billing_country'
|
648 |
$new[ $key ]['class'][1] = "inspire_checkout_fields_hide";
|
649 |
}
|
650 |
}
|
@@ -791,27 +863,27 @@
|
|
791 |
}
|
792 |
|
793 |
public function changeShippingFields($fields) {
|
794 |
-
return $this
|
795 |
}
|
796 |
|
797 |
public function changeBillingFields($fields) {
|
798 |
-
return $this
|
799 |
}
|
800 |
|
801 |
public function changeOrderFields($fields) {
|
802 |
-
return $this
|
803 |
}
|
804 |
|
805 |
public function changeAdminBillingFields($labels) {
|
806 |
-
return $this
|
807 |
}
|
808 |
|
809 |
public function changeAdminShippingFields($labels) {
|
810 |
-
return $this
|
811 |
}
|
812 |
|
813 |
public function changeAdminOrderFields($labels) {
|
814 |
-
return $this
|
815 |
}
|
816 |
|
817 |
public function addCustomBillingFieldsToAdmin($order){
|
@@ -827,15 +899,15 @@
|
|
827 |
}
|
828 |
|
829 |
public function addCustomFieldsBillingFields($fields) {
|
830 |
-
|
831 |
}
|
832 |
|
833 |
public function addCustomFieldsShippingFields($fields) {
|
834 |
-
|
835 |
}
|
836 |
|
837 |
public function addCustomFieldsOrderFields($fields) {
|
838 |
-
return $this
|
839 |
}
|
840 |
|
841 |
function updateCheckoutFields( $order_id ) {
|
@@ -861,7 +933,10 @@
|
|
861 |
array_keys( isset( $settings['order'] ) ? $settings['order'] : array() )
|
862 |
)
|
863 |
);
|
|
|
|
|
864 |
foreach ($_POST as $key => $value) {
|
|
|
865 |
$save = true;
|
866 |
if (empty($_POST['ship_to_different_address']))
|
867 |
{
|
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.8.2
|
7 |
Author: WP Desk
|
8 |
Author URI: https://www.wpdesk.net/
|
9 |
Text Domain: flexible-checkout-fields
|
11 |
Requires at least: 4.6
|
12 |
Tested up to: 5.0.3
|
13 |
WC requires at least: 3.1.0
|
14 |
+
WC tested up to: 3.5.4
|
15 |
|
16 |
Copyright 2017 WP Desk Ltd.
|
17 |
|
33 |
|
34 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
35 |
|
36 |
+
$plugin_version = '1.8.2';
|
37 |
define( 'FLEXIBLE_CHECKOUT_FIELDS_VERSION', $plugin_version );
|
38 |
|
39 |
|
68 |
|
69 |
class Flexible_Checkout_Fields_Plugin extends WPDesk_Plugin_1_8 {
|
70 |
|
71 |
+
protected $script_version = '1.8.2';
|
72 |
|
73 |
protected $fields = array();
|
74 |
|
176 |
public function plugins_loaded() {
|
177 |
$this->init_fields();
|
178 |
//do użycia dla pola miasto, kod pocztowy i stan
|
179 |
+
$this->init_sections();
|
180 |
}
|
181 |
|
182 |
public function getSettingValue( $name, $default = null ) {
|
213 |
return $fields;
|
214 |
}
|
215 |
|
216 |
+
/**
|
217 |
+
* Init sections.
|
218 |
+
*/
|
219 |
+
public function init_sections() {
|
220 |
+
$sections = array(
|
221 |
+
'billing' => array(
|
222 |
+
'section' => 'billing',
|
223 |
+
'tab' => 'fields_billing',
|
224 |
+
'tab_title' => __( 'Billing', 'flexible-checkout-fields' ),
|
225 |
+
'custom_section' => false
|
226 |
+
),
|
227 |
+
'shipping' => array(
|
228 |
+
'section' => 'shipping',
|
229 |
+
'tab' => 'fields_shipping',
|
230 |
+
'tab_title' => __( 'Shipping', 'flexible-checkout-fields' ),
|
231 |
+
'custom_section' => false
|
232 |
+
),
|
233 |
+
'order' => array(
|
234 |
+
'section' => 'order',
|
235 |
+
'tab' => 'fields_order',
|
236 |
+
'tab_title' => __( 'Order', 'flexible-checkout-fields' ),
|
237 |
+
'custom_section' => false
|
238 |
+
)
|
239 |
+
);
|
240 |
+
|
241 |
+
$all_sections = unserialize( serialize( $sections ) );
|
242 |
+
|
243 |
+
$this->sections = apply_filters( 'flexible_checkout_fields_sections', $sections );
|
244 |
+
|
245 |
+
$this->all_sections = apply_filters( 'flexible_checkout_fields_all_sections', $all_sections );
|
246 |
+
}
|
247 |
|
248 |
function init_fields() {
|
249 |
$this->fields['text'] = array(
|
326 |
return apply_filters( 'flexible_checkout_fields_fields' , $this->fields );
|
327 |
}
|
328 |
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Remove unavailable sections from settings.
|
332 |
+
* Removes sections added by PRO plugin, after PRO plugin disable.
|
333 |
+
*
|
334 |
+
* @param array $settings Settings.
|
335 |
+
* @return array
|
336 |
+
*/
|
337 |
+
private function get_settings_for_available_sections( array $settings ) {
|
338 |
+
$this->init_sections();
|
339 |
+
if ( is_array( $settings ) && is_array( $this->sections ) ) {
|
340 |
+
foreach ( $settings as $section => $section_settings ) {
|
341 |
+
$unset = true;
|
342 |
+
foreach ( $this->sections as $section_data ) {
|
343 |
+
if ( $section_data['section'] === $section ) {
|
344 |
+
$unset = false;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
if ( $unset ) {
|
348 |
+
unset( $settings[ $section ] );
|
349 |
+
}
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
return $settings;
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Get settings.
|
358 |
+
*
|
359 |
+
* @return array
|
360 |
+
*/
|
361 |
+
public function get_settings() {
|
362 |
+
$settings = get_option( 'inspire_checkout_fields_settings', array() );
|
363 |
+
if ( ! is_array( $settings ) ) {
|
364 |
+
$settings = array();
|
365 |
+
}
|
366 |
+
|
367 |
+
return $this->get_settings_for_available_sections( $settings );
|
368 |
+
}
|
369 |
|
370 |
function woocommerce_before_checkout_form() {
|
371 |
WC()->session->set( 'checkout-fields', array() );
|
528 |
foreach ( $type as $field_name => $field ) {
|
529 |
if ( apply_filters( 'flexible_checkout_fields_condition', true, $field ) ) {
|
530 |
if ( $field['visible'] == 0 or
|
531 |
+
( ( isset( $_GET['page'] ) && $_GET['page'] == 'inspire_checkout_fields_settings' ) && $field['visible'] == 1) || $field['name'] == 'billing_country' || $field['name'] == 'shipping_country')
|
532 |
{
|
533 |
$custom_field = false;
|
534 |
if( isset( $field['custom_field'] ) && $field['custom_field'] == 1 ) {
|
564 |
else {
|
565 |
$new[$key][$field['name']]['class'] = explode( ' ', $field['class'] );
|
566 |
}
|
567 |
+
if ( ($field['name'] == 'billing_country' || $field['name'] == 'shipping_country') && $field['visible'] == 1 ){
|
568 |
$new[$key][$field['name']]['class'][1] = "inspire_checkout_fields_hide";
|
569 |
}
|
570 |
if ( ! $custom_field ) {
|
620 |
$new[$type][$key]['priority'] = $priority;
|
621 |
}
|
622 |
}
|
623 |
+
|
624 |
if ( $request_type == null ) {
|
625 |
if ( !empty($fields['account'] ) ) {
|
626 |
$new['account'] = $fields['account'];
|
627 |
}
|
628 |
+
|
629 |
+
$new = $this->restore_default_city_validation( $new, $_POST, 'billing' );
|
630 |
+
$new = $this->restore_default_city_validation( $new, $_POST, 'shipping' );
|
631 |
+
|
632 |
return $new;
|
633 |
}
|
634 |
else{
|
635 |
if ( isset( $new[$request_type] ) ) {
|
636 |
+
$new = $this->restore_default_city_validation( $new, $_POST, $request_type );
|
637 |
+
return $new[ $request_type ];
|
638 |
}
|
639 |
else {
|
640 |
return array();
|
646 |
}
|
647 |
}
|
648 |
|
649 |
+
/**
|
650 |
+
* Restores the default validation for the city
|
651 |
+
*
|
652 |
+
* @param array $fields
|
653 |
+
* @param array $request
|
654 |
+
* @param string $request_type the type of shipping address (billing or shipping)
|
655 |
+
*
|
656 |
+
* @return array
|
657 |
+
*/
|
658 |
+
private function restore_default_city_validation( array $fields, array $request, $request_type ) {
|
659 |
+
|
660 |
+
$city = $request_type . '_city';
|
661 |
+
$country = $request_type . '_country';
|
662 |
+
|
663 |
+
if( isset( $fields[ $request_type ][ $city ]['required'] ) && isset( $request[ $country ] ) ) {
|
664 |
+
$slug = $request[ $country ];
|
665 |
+
$countries = new WC_Countries();
|
666 |
+
$locales = $countries->get_country_locale();
|
667 |
+
if ( isset( $locales[ $slug ]['city']['required'] ) ) {
|
668 |
+
$required = $locales[ $slug ]['city']['required'];
|
669 |
+
if( !$required ) {
|
670 |
+
$fields[ $request_type ][ $city ]['required'] = 0;
|
671 |
+
$fields[ $request_type ][ $city ]['hidden'] = 1;
|
672 |
+
}
|
673 |
+
}
|
674 |
+
}
|
675 |
+
return $fields;
|
676 |
+
}
|
677 |
+
|
678 |
public function getCheckoutUserFields($fields, $request_type = null) {
|
679 |
$settings = $this->get_settings();
|
680 |
|
685 |
if ( !empty($settings[$request_type] ) ) {
|
686 |
foreach ( $settings[$request_type] as $key => $field ) {
|
687 |
|
688 |
+
if($field['visible'] == 0 || $field['name'] == 'billing_country' || $field['name'] == 'shipping_country' || ( isset($_GET['page']) && $_GET['page'] == 'inspire_checkout_fields_settings' && $field['visible'] == 1)){
|
689 |
if(!empty($fields[$key])){
|
690 |
$new[$key] = $fields[$key];
|
691 |
}
|
716 |
}
|
717 |
|
718 |
if ( !empty( $field['name'] ) ) {
|
719 |
+
if ( ( $field['name'] == 'billing_country' || $field['name'] == 'shipping_country' ) && $field['visible'] == 1 ) {
|
720 |
$new[ $key ]['class'][1] = "inspire_checkout_fields_hide";
|
721 |
}
|
722 |
}
|
863 |
}
|
864 |
|
865 |
public function changeShippingFields($fields) {
|
866 |
+
return $this->getCheckoutFields($fields, 'shipping');
|
867 |
}
|
868 |
|
869 |
public function changeBillingFields($fields) {
|
870 |
+
return $this->getCheckoutFields($fields, 'billing');
|
871 |
}
|
872 |
|
873 |
public function changeOrderFields($fields) {
|
874 |
+
return $this->getCheckoutFields($fields, 'order');
|
875 |
}
|
876 |
|
877 |
public function changeAdminBillingFields($labels) {
|
878 |
+
return $this->changeAdminLabelsCheckoutFields($labels, 'billing');
|
879 |
}
|
880 |
|
881 |
public function changeAdminShippingFields($labels) {
|
882 |
+
return $this->changeAdminLabelsCheckoutFields($labels, 'shipping');
|
883 |
}
|
884 |
|
885 |
public function changeAdminOrderFields($labels) {
|
886 |
+
return $this->changeAdminLabelsCheckoutFields($labels, 'order');
|
887 |
}
|
888 |
|
889 |
public function addCustomBillingFieldsToAdmin($order){
|
899 |
}
|
900 |
|
901 |
public function addCustomFieldsBillingFields($fields) {
|
902 |
+
return $this->getCheckoutUserFields( $fields, 'billing');
|
903 |
}
|
904 |
|
905 |
public function addCustomFieldsShippingFields($fields) {
|
906 |
+
return $this->getCheckoutUserFields( $fields, 'shipping');
|
907 |
}
|
908 |
|
909 |
public function addCustomFieldsOrderFields($fields) {
|
910 |
+
return $this->getCheckoutUserFields($fields, 'order');
|
911 |
}
|
912 |
|
913 |
function updateCheckoutFields( $order_id ) {
|
933 |
array_keys( isset( $settings['order'] ) ? $settings['order'] : array() )
|
934 |
)
|
935 |
);
|
936 |
+
|
937 |
+
|
938 |
foreach ($_POST as $key => $value) {
|
939 |
+
|
940 |
$save = true;
|
941 |
if (empty($_POST['ship_to_different_address']))
|
942 |
{
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.wpdesk.net/flexible-checkout-fields-woocommerce/
|
|
4 |
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
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.0.3
|
7 |
-
Stable tag: 1.8.
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -188,6 +188,14 @@ If you are upgrading from the old WooCommerce Checkout Fields version (1.1, wooc
|
|
188 |
|
189 |
== Changelog ==
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
= 1.8.1 - 2019-01-15 =
|
192 |
* Fixed CSS WP Menu
|
193 |
|
4 |
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
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.0.3
|
7 |
+
Stable tag: 1.8.2
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
188 |
|
189 |
== Changelog ==
|
190 |
|
191 |
+
= 1.8.2 - 2019-01-31 =
|
192 |
+
* Fixed fields order in configuration
|
193 |
+
* Fixed unwanted validation on additional sections when PRO plugin disabled
|
194 |
+
* Fixed box display for incorrect validation
|
195 |
+
* Fixed errors after save fields
|
196 |
+
* Fixed Polylang translations on select options
|
197 |
+
* Fixed non city countries validation
|
198 |
+
|
199 |
= 1.8.1 - 2019-01-15 =
|
200 |
* Fixed CSS WP Menu
|
201 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit09a68d2f73e07dd82498c95f90d52bad::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit339e576d1584ef57acd838e4ae65c834
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
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\
|
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 ComposerAutoloaderInit09a68d2f73e07dd82498c95f90d52bad
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit09a68d2f73e07dd82498c95f90d52bad', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit09a68d2f73e07dd82498c95f90d52bad', '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\ComposerStaticInit09a68d2f73e07dd82498c95f90d52bad::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
|
8 |
{
|
9 |
public static $classMap = array (
|
10 |
'Browser' => __DIR__ . '/../..' . '/classes/wpdesk/settings-api/modules/sysinfo/browser.php',
|
@@ -56,7 +56,7 @@ class ComposerStaticInit339e576d1584ef57acd838e4ae65c834
|
|
56 |
public static function getInitializer(ClassLoader $loader)
|
57 |
{
|
58 |
return \Closure::bind(function () use ($loader) {
|
59 |
-
$loader->classMap =
|
60 |
|
61 |
}, null, ClassLoader::class);
|
62 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit09a68d2f73e07dd82498c95f90d52bad
|
8 |
{
|
9 |
public static $classMap = array (
|
10 |
'Browser' => __DIR__ . '/../..' . '/classes/wpdesk/settings-api/modules/sysinfo/browser.php',
|
56 |
public static function getInitializer(ClassLoader $loader)
|
57 |
{
|
58 |
return \Closure::bind(function () use ($loader) {
|
59 |
+
$loader->classMap = ComposerStaticInit09a68d2f73e07dd82498c95f90d52bad::$classMap;
|
60 |
|
61 |
}, null, ClassLoader::class);
|
62 |
}
|