Version Description
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 6.3.2 |
Comparing to | |
See all releases |
Code changes from version 6.3.1 to 6.3.2
- includes/class-wooccm-helpers.php +20 -0
- includes/class-wooccm.php +2 -1
- includes/controller/class-wooccm-field-billing.php +91 -101
- includes/controller/class-wooccm-field-shipping.php +86 -94
- includes/model/class-wooccm-field-billing.php +26 -29
- includes/model/class-wooccm-field-shipping.php +24 -26
- includes/model/class-wooccm-field.php +10 -6
- includes/view/frontend/class-wooccm-fields-conditional.php +2 -17
- readme.txt +5 -1
- woocommerce-checkout-manager.php +2 -2
includes/class-wooccm-helpers.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Field_Helpers {
|
4 |
+
|
5 |
+
public static function get_form_action() {
|
6 |
+
|
7 |
+
if ( isset( $_REQUEST['action'] ) && 'edit_address' === $_REQUEST['action'] ) {
|
8 |
+
return 'account';
|
9 |
+
}
|
10 |
+
|
11 |
+
if ( isset( $_REQUEST['woocommerce-process-checkout-nonce'] ) ) {
|
12 |
+
return 'save';
|
13 |
+
}
|
14 |
+
|
15 |
+
if ( isset( $_REQUEST['post_data'] ) && isset( $_REQUEST['wc-ajax'] ) && $_REQUEST['wc-ajax'] == 'update_order_review' ) {
|
16 |
+
return 'update';
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
includes/class-wooccm.php
CHANGED
@@ -28,6 +28,7 @@ final class WOOCCM {
|
|
28 |
}
|
29 |
|
30 |
public function includes() {
|
|
|
31 |
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-backend.php';
|
32 |
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-upload.php';
|
33 |
include_once WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-checkout.php';
|
@@ -99,7 +100,7 @@ final class WOOCCM {
|
|
99 |
);
|
100 |
|
101 |
wp_register_script( 'farbtastic', admin_url( 'js/farbtastic.js' ), array( 'jquery' ), $wp_version );
|
102 |
-
|
103 |
}
|
104 |
|
105 |
public function clear_session() {
|
28 |
}
|
29 |
|
30 |
public function includes() {
|
31 |
+
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-helpers.php';
|
32 |
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-backend.php';
|
33 |
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-upload.php';
|
34 |
include_once WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-checkout.php';
|
100 |
);
|
101 |
|
102 |
wp_register_script( 'farbtastic', admin_url( 'js/farbtastic.js' ), array( 'jquery' ), $wp_version );
|
103 |
+
|
104 |
}
|
105 |
|
106 |
public function clear_session() {
|
includes/controller/class-wooccm-field-billing.php
CHANGED
@@ -1,106 +1,96 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class WOOCCM_Field_Controller_Billing extends WOOCCM_Field_Controller
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
$billing_fields[$field['name']]['label'] = $field['label'];
|
95 |
-
$billing_fields[$field['name']]['name'] = $field['key'];
|
96 |
-
$billing_fields[$field['name']]['value'] = null;
|
97 |
-
$billing_fields[$field['name']]['class'] = join(' ', $field['class']);
|
98 |
-
//$billing_fields[$field['name']]['wrapper_class'] = 'wooccm-premium';
|
99 |
-
}
|
100 |
-
|
101 |
-
|
102 |
-
return $billing_fields;
|
103 |
-
}
|
104 |
}
|
105 |
|
106 |
WOOCCM_Field_Controller_Billing::instance();
|
1 |
<?php
|
2 |
|
3 |
+
class WOOCCM_Field_Controller_Billing extends WOOCCM_Field_Controller {
|
4 |
+
|
5 |
+
|
6 |
+
protected static $_instance;
|
7 |
+
public $billing;
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
include_once WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-billing.php';
|
11 |
+
|
12 |
+
add_action( 'wooccm_sections_header', array( $this, 'add_header' ) );
|
13 |
+
add_action( 'woocommerce_sections_' . WOOCCM_PREFIX, array( $this, 'add_section' ), 99 );
|
14 |
+
add_filter( 'woocommerce_admin_billing_fields', array( $this, 'add_admin_billing_fields' ), 999 );
|
15 |
+
// add_filter('woocommerce_admin_shipping_fields', array($this, 'add_admin_shipping_fields'));
|
16 |
+
// add_action('woocommerce_admin_order_data_after_billing_address', array($this, 'add_order_data'));
|
17 |
+
}
|
18 |
+
|
19 |
+
public static function instance() {
|
20 |
+
if ( is_null( self::$_instance ) ) {
|
21 |
+
self::$_instance = new self();
|
22 |
+
}
|
23 |
+
return self::$_instance;
|
24 |
+
}
|
25 |
+
|
26 |
+
// Admin
|
27 |
+
// ---------------------------------------------------------------------------
|
28 |
+
|
29 |
+
public function add_section() {
|
30 |
+
global $current_section, $wp_roles, $wp_locale;
|
31 |
+
|
32 |
+
if ( 'billing' == $current_section ) {
|
33 |
+
|
34 |
+
$fields = WOOCCM()->billing->get_fields();
|
35 |
+
$defaults = WOOCCM()->billing->get_defaults();
|
36 |
+
$types = WOOCCM()->billing->get_types();
|
37 |
+
$conditionals = WOOCCM()->billing->get_conditional_types();
|
38 |
+
$option = WOOCCM()->billing->get_option_types();
|
39 |
+
$multiple = WOOCCM()->billing->get_multiple_types();
|
40 |
+
$template = WOOCCM()->billing->get_template_types();
|
41 |
+
$disabled = WOOCCM()->billing->get_disabled_types();
|
42 |
+
$product_categories = $this->get_product_categories();
|
43 |
+
|
44 |
+
include_once WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/billing.php';
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
public function add_header() {
|
49 |
+
global $current_section;
|
50 |
+
?>
|
51 |
+
<li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm§ion=billing' ) ); ?>" class="<?php echo ( $current_section == 'billing' ? 'current' : '' ); ?>"><?php esc_html_e( 'Billing', 'woocommerce-checkout-manager' ); ?></a> | </li>
|
52 |
+
<?php
|
53 |
+
}
|
54 |
+
|
55 |
+
// Admin Order
|
56 |
+
// ---------------------------------------------------------------------------
|
57 |
+
|
58 |
+
function add_admin_billing_fields( $billing_fields ) {
|
59 |
+
if ( ! $fields = WOOCCM()->billing->get_fields() ) {
|
60 |
+
return $billing_fields;
|
61 |
+
}
|
62 |
+
|
63 |
+
$template = WOOCCM()->billing->get_template_types();
|
64 |
+
|
65 |
+
foreach ( $fields as $field_id => $field ) {
|
66 |
+
|
67 |
+
if ( ! isset( $field['name'] ) ) {
|
68 |
+
continue;
|
69 |
+
}
|
70 |
+
|
71 |
+
if ( isset( $billing_fields[ $field['name'] ] ) ) {
|
72 |
+
continue;
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( in_array( $field['name'], $template ) ) {
|
76 |
+
continue;
|
77 |
+
}
|
78 |
+
|
79 |
+
if ( ! isset( $field['type'] ) || $field['type'] != 'textarea' ) {
|
80 |
+
$field['type'] = 'text';
|
81 |
+
}
|
82 |
+
|
83 |
+
$billing_fields[ $field['name'] ] = $field;
|
84 |
+
$billing_fields[ $field['name'] ]['id'] = sprintf( '_%s', (string) $field['key'] );
|
85 |
+
$billing_fields[ $field['name'] ]['label'] = $field['label'];
|
86 |
+
$billing_fields[ $field['name'] ]['name'] = $field['key'];
|
87 |
+
$billing_fields[ $field['name'] ]['value'] = null;
|
88 |
+
$billing_fields[ $field['name'] ]['class'] = join( ' ', $field['class'] );
|
89 |
+
// $billing_fields[$field['name']]['wrapper_class'] = 'wooccm-premium';
|
90 |
+
}
|
91 |
+
|
92 |
+
return $billing_fields;
|
93 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
|
96 |
WOOCCM_Field_Controller_Billing::instance();
|
includes/controller/class-wooccm-field-shipping.php
CHANGED
@@ -1,99 +1,91 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class WOOCCM_Field_Controller_Shipping extends WOOCCM_Field_Controller
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
$shipping_fields[$field['name']]['value'] = null;
|
90 |
-
$shipping_fields[$field['name']]['class'] = join(' ', $field['class']);
|
91 |
-
//$shipping_fields[$field['name']]['wrapper_class'] = 'wooccm-premium';
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
-
return $shipping_fields;
|
96 |
-
}
|
97 |
}
|
98 |
|
99 |
WOOCCM_Field_Controller_Shipping::instance();
|
1 |
<?php
|
2 |
|
3 |
+
class WOOCCM_Field_Controller_Shipping extends WOOCCM_Field_Controller {
|
4 |
+
|
5 |
+
|
6 |
+
protected static $_instance;
|
7 |
+
public $shipping;
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
include_once WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-shipping.php';
|
11 |
+
|
12 |
+
add_action( 'wooccm_sections_header', array( $this, 'add_header' ) );
|
13 |
+
add_action( 'woocommerce_sections_' . WOOCCM_PREFIX, array( $this, 'add_section' ), 99 );
|
14 |
+
add_filter( 'woocommerce_admin_shipping_fields', array( $this, 'add_admin_shipping_fields' ), 999 );
|
15 |
+
}
|
16 |
+
|
17 |
+
public static function instance() {
|
18 |
+
if ( is_null( self::$_instance ) ) {
|
19 |
+
self::$_instance = new self();
|
20 |
+
}
|
21 |
+
return self::$_instance;
|
22 |
+
}
|
23 |
+
|
24 |
+
// Admin
|
25 |
+
// ---------------------------------------------------------------------------
|
26 |
+
|
27 |
+
public function add_header() {
|
28 |
+
global $current_section;
|
29 |
+
?>
|
30 |
+
<li><a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=wooccm§ion=shipping' ) ); ?>" class="<?php echo ( $current_section == 'shipping' ? 'current' : '' ); ?>"><?php esc_html_e( 'Shipping', 'woocommerce-checkout-manager' ); ?></a> | </li>
|
31 |
+
<?php
|
32 |
+
}
|
33 |
+
|
34 |
+
public function add_section() {
|
35 |
+
global $current_section, $wp_roles, $wp_locale;
|
36 |
+
|
37 |
+
if ( 'shipping' == $current_section ) {
|
38 |
+
|
39 |
+
$fields = WOOCCM()->shipping->get_fields();
|
40 |
+
$defaults = WOOCCM()->shipping->get_defaults();
|
41 |
+
$types = WOOCCM()->shipping->get_types();
|
42 |
+
$conditionals = WOOCCM()->shipping->get_conditional_types();
|
43 |
+
$option = WOOCCM()->billing->get_option_types();
|
44 |
+
$multiple = WOOCCM()->billing->get_multiple_types();
|
45 |
+
$template = WOOCCM()->billing->get_template_types();
|
46 |
+
$disabled = WOOCCM()->billing->get_disabled_types();
|
47 |
+
$product_categories = $this->get_product_categories();
|
48 |
+
|
49 |
+
include_once WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/shipping.php';
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
function add_admin_shipping_fields( $shipping_fields ) {
|
54 |
+
if ( ! $fields = WOOCCM()->shipping->get_fields() ) {
|
55 |
+
return $shipping_fields;
|
56 |
+
}
|
57 |
+
|
58 |
+
$template = WOOCCM()->shipping->get_template_types();
|
59 |
+
|
60 |
+
foreach ( $fields as $field_id => $field ) {
|
61 |
+
|
62 |
+
if ( ! isset( $field['name'] ) ) {
|
63 |
+
continue;
|
64 |
+
}
|
65 |
+
|
66 |
+
if ( isset( $shipping_fields[ $field['name'] ] ) ) {
|
67 |
+
continue;
|
68 |
+
}
|
69 |
+
|
70 |
+
if ( in_array( $field['name'], $template ) ) {
|
71 |
+
continue;
|
72 |
+
}
|
73 |
+
|
74 |
+
if ( ! isset( $field['type'] ) || $field['type'] != 'textarea' ) {
|
75 |
+
$field['type'] = 'text';
|
76 |
+
}
|
77 |
+
|
78 |
+
$shipping_fields[ $field['name'] ] = $field;
|
79 |
+
$shipping_fields[ $field['name'] ]['id'] = sprintf( '_%s', (string) $field['key'] );
|
80 |
+
$shipping_fields[ $field['name'] ]['label'] = $field['label'];
|
81 |
+
$shipping_fields[ $field['name'] ]['name'] = $field['key'];
|
82 |
+
$shipping_fields[ $field['name'] ]['value'] = null;
|
83 |
+
$shipping_fields[ $field['name'] ]['class'] = join( ' ', $field['class'] );
|
84 |
+
// $shipping_fields[$field['name']]['wrapper_class'] = 'wooccm-premium';
|
85 |
+
}
|
86 |
+
|
87 |
+
return $shipping_fields;
|
88 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
|
91 |
WOOCCM_Field_Controller_Shipping::instance();
|
includes/model/class-wooccm-field-billing.php
CHANGED
@@ -1,36 +1,33 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (!class_exists('WOOCCM_Field_Billing')) {
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
{
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
);
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
}
|
36 |
}
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! class_exists( 'WOOCCM_Field_Billing' ) ) {
|
4 |
|
5 |
+
include_once WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php';
|
6 |
|
7 |
+
class WOOCCM_Field_Billing extends WOOCCM_Field {
|
|
|
8 |
|
9 |
+
protected static $_instance;
|
10 |
+
protected $prefix = 'billing';
|
11 |
+
protected $table = 'wooccm_billing';
|
12 |
+
protected $defaults = array(
|
13 |
+
'country',
|
14 |
+
'first_name',
|
15 |
+
'last_name',
|
16 |
+
'company',
|
17 |
+
'address_1',
|
18 |
+
'address_2',
|
19 |
+
'city',
|
20 |
+
'state',
|
21 |
+
'postcode',
|
22 |
+
'email',
|
23 |
+
'phone',
|
24 |
+
);
|
|
|
25 |
|
26 |
+
public static function instance() {
|
27 |
+
if ( is_null( self::$_instance ) ) {
|
28 |
+
self::$_instance = new self();
|
29 |
+
}
|
30 |
+
return self::$_instance;
|
31 |
+
}
|
32 |
+
}
|
|
|
33 |
}
|
includes/model/class-wooccm-field-shipping.php
CHANGED
@@ -1,33 +1,31 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (!class_exists('WOOCCM_Field_Shipping')) {
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
{
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
}
|
33 |
}
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! class_exists( 'WOOCCM_Field_Shipping' ) ) {
|
4 |
|
5 |
+
include_once WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field.php';
|
6 |
|
7 |
+
class WOOCCM_Field_Shipping extends WOOCCM_Field {
|
|
|
8 |
|
9 |
+
protected static $_instance;
|
10 |
+
protected $prefix = 'shipping';
|
11 |
+
protected $table = 'wooccm_shipping';
|
12 |
+
protected $defaults = array(
|
13 |
+
'country',
|
14 |
+
'first_name',
|
15 |
+
'last_name',
|
16 |
+
'company',
|
17 |
+
'address_1',
|
18 |
+
'address_2',
|
19 |
+
'city',
|
20 |
+
'state',
|
21 |
+
'postcode',
|
22 |
+
);
|
23 |
|
24 |
+
public static function instance() {
|
25 |
+
if ( is_null( self::$_instance ) ) {
|
26 |
+
self::$_instance = new self();
|
27 |
+
}
|
28 |
+
return self::$_instance;
|
29 |
+
}
|
30 |
+
}
|
|
|
31 |
}
|
includes/model/class-wooccm-field.php
CHANGED
@@ -231,20 +231,24 @@ class WOOCCM_Field extends WOOCCM_Model {
|
|
231 |
}
|
232 |
|
233 |
public function get_defaults() {
|
234 |
-
return
|
235 |
-
// return $this->get_default_fields();
|
236 |
}
|
237 |
|
238 |
public function get_default_fields() {
|
239 |
$fields = array();
|
240 |
|
241 |
-
|
|
|
|
|
|
|
|
|
|
|
242 |
|
243 |
$prefix = sprintf( '%s_', $this->prefix );
|
244 |
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
remove_all_filters( 'woocommerce_' . $prefix . 'fields' );
|
249 |
|
250 |
$i = 0;
|
231 |
}
|
232 |
|
233 |
public function get_defaults() {
|
234 |
+
return $this->get_default_fields();
|
|
|
235 |
}
|
236 |
|
237 |
public function get_default_fields() {
|
238 |
$fields = array();
|
239 |
|
240 |
+
/**
|
241 |
+
* Exclude from form actions to fix issue in myaccount edit billing and shipping form save
|
242 |
+
*/
|
243 |
+
$form_action = WOOCCM_Field_Helpers::get_form_action();
|
244 |
+
|
245 |
+
if ( ! $form_action && $this->prefix !== 'additional' ) {
|
246 |
|
247 |
$prefix = sprintf( '%s_', $this->prefix );
|
248 |
|
249 |
+
/**
|
250 |
+
* Fix nesting level
|
251 |
+
*/
|
252 |
remove_all_filters( 'woocommerce_' . $prefix . 'fields' );
|
253 |
|
254 |
$i = 0;
|
includes/view/frontend/class-wooccm-fields-conditional.php
CHANGED
@@ -48,9 +48,9 @@ class WOOCCM_Fields_Conditional {
|
|
48 |
continue;
|
49 |
}
|
50 |
|
51 |
-
$
|
52 |
|
53 |
-
switch ( $
|
54 |
case 'account':
|
55 |
case 'save':
|
56 |
$is_valid_conditional_field = $this->is_valid_conditional_field( $_POST, $field );
|
@@ -99,21 +99,6 @@ class WOOCCM_Fields_Conditional {
|
|
99 |
return false;
|
100 |
}
|
101 |
|
102 |
-
public function get_form_action() {
|
103 |
-
|
104 |
-
if ( isset( $_REQUEST['action'] ) && 'edit_address' === $_REQUEST['action'] ) {
|
105 |
-
return 'account';
|
106 |
-
}
|
107 |
-
|
108 |
-
if ( isset( $_REQUEST['woocommerce-process-checkout-nonce'] ) ) {
|
109 |
-
return 'save';
|
110 |
-
}
|
111 |
-
|
112 |
-
if ( isset( $_REQUEST['post_data'] ) && isset( $_REQUEST['wc-ajax'] ) && $_REQUEST['wc-ajax'] == 'update_order_review' ) {
|
113 |
-
return 'update';
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
public function add_field_attributes( $field ) {
|
118 |
if ( ! empty( $field['conditional'] ) && ! empty( $field['conditional_parent_key'] ) && isset( $field['conditional_parent_value'] ) && ( $field['conditional_parent_key'] != $field['name'] ) ) {
|
119 |
$field['class'][] = 'wooccm-conditional-child';
|
48 |
continue;
|
49 |
}
|
50 |
|
51 |
+
$form_action = WOOCCM_Field_Helpers::get_form_action();
|
52 |
|
53 |
+
switch ( $form_action ) {
|
54 |
case 'account':
|
55 |
case 'save':
|
56 |
$is_valid_conditional_field = $this->is_valid_conditional_field( $_POST, $field );
|
99 |
return false;
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
public function add_field_attributes( $field ) {
|
103 |
if ( ! empty( $field['conditional'] ) && ! empty( $field['conditional_parent_key'] ) && isset( $field['conditional_parent_value'] ) && ( $field['conditional_parent_key'] != $field['name'] ) ) {
|
104 |
$field['class'][] = 'wooccm-conditional-child';
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: checkout field editor, woocommerce checkout field editor, checkout manager
|
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 6.0.1
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 6.3.
|
9 |
WC requires at least: 3.1.0
|
10 |
WC tested up to: 6.9
|
11 |
License: GPLv3
|
@@ -149,6 +149,10 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
|
|
149 |
|
150 |
== Changelog ==
|
151 |
|
|
|
|
|
|
|
|
|
152 |
= 6.3.1
|
153 |
* Fix. WooCommerce Account fields
|
154 |
* Fix. WooCommerce Checkout conditional field prices
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 6.0.1
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 6.3.2
|
9 |
WC requires at least: 3.1.0
|
10 |
WC tested up to: 6.9
|
11 |
License: GPLv3
|
149 |
|
150 |
== Changelog ==
|
151 |
|
152 |
+
= 6.3.2
|
153 |
+
* Fix. WooCommerce Account fields
|
154 |
+
* Fix. WooCommerce default billing & shipping fields
|
155 |
+
|
156 |
= 6.3.1
|
157 |
* Fix. WooCommerce Account fields
|
158 |
* Fix. WooCommerce Checkout conditional field prices
|
woocommerce-checkout-manager.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Checkout Fields Manager for WooCommerce
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
|
6 |
* Description: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
|
7 |
-
* Version: 6.3.
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
17 |
}
|
18 |
|
19 |
define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
|
20 |
-
define( 'WOOCCM_PLUGIN_VERSION', '6.3.
|
21 |
define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
|
22 |
define( 'WOOCCM_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
|
23 |
define( 'WOOCCM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
4 |
* Plugin Name: Checkout Fields Manager for WooCommerce
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
|
6 |
* Description: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
|
7 |
+
* Version: 6.3.2
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
17 |
}
|
18 |
|
19 |
define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
|
20 |
+
define( 'WOOCCM_PLUGIN_VERSION', '6.3.2' );
|
21 |
define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
|
22 |
define( 'WOOCCM_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
|
23 |
define( 'WOOCCM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|