Version Description
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 6.2.3 |
Comparing to | |
See all releases |
Code changes from version 6.2.2 to 6.2.3
- includes/class-wooccm-install.php +0 -95
- includes/class-wooccm.php +0 -5
- includes/quadlayers/links.php +26 -0
- includes/{class-wooccm-notices.php → quadlayers/notices.php} +23 -34
- includes/view/frontend/class-wooccm-fields-filters.php +223 -242
- readme.txt +4 -1
- woocommerce-checkout-manager.php +26 -40
includes/class-wooccm-install.php
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Install
|
4 |
-
{
|
5 |
-
|
6 |
-
public static function install()
|
7 |
-
{
|
8 |
-
|
9 |
-
// Check if we are not already running this routine.
|
10 |
-
if ('yes' === get_transient('wooccm_installing')) {
|
11 |
-
return;
|
12 |
-
}
|
13 |
-
|
14 |
-
// If we made it till here nothing is running yet, lets set the transient now.
|
15 |
-
set_transient('wooccm_installing', 'yes', MINUTE_IN_SECONDS * 10);
|
16 |
-
set_transient('wooccm-notice-delay', true, MONTH_IN_SECONDS);
|
17 |
-
|
18 |
-
//wooccm_install();
|
19 |
-
}
|
20 |
-
|
21 |
-
public static function update()
|
22 |
-
{
|
23 |
-
|
24 |
-
if (!get_option('wooccm_billing', false)) {
|
25 |
-
update_option(WOOCCM()->billing->get_fields());
|
26 |
-
}
|
27 |
-
|
28 |
-
if (!get_option('wooccm_shipping', false)) {
|
29 |
-
update_option(WOOCCM()->shipping->get_fields());
|
30 |
-
}
|
31 |
-
|
32 |
-
if (!get_option('wooccm_additional', false)) {
|
33 |
-
update_option(WOOCCM()->additional->get_fields());
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
public static function old_panel_compatibility($field_id, $field = array())
|
38 |
-
{
|
39 |
-
|
40 |
-
$field = $this->get_old_args($field);
|
41 |
-
|
42 |
-
$field = wp_parse_args($field, array_fill_keys($this->old_args, null));
|
43 |
-
|
44 |
-
if (!is_numeric($field['order'])) {
|
45 |
-
$field['order'] = $field_id + 1;
|
46 |
-
}
|
47 |
-
|
48 |
-
$field['type'] = $this->get_old_type($field['type']);
|
49 |
-
|
50 |
-
if (empty($field['position']) && isset($field['class'])) {
|
51 |
-
if ($position = $this->array_to_string(array_intersect((array) $field['class'], array('form-row-wide', 'form-row-first', 'form-row-last')))) {
|
52 |
-
$field['position'] = $position;
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
$field['role_option'] = $this->array_to_string($field['role_option']);
|
57 |
-
$field['role_option2'] = $this->array_to_string($field['role_option2']);
|
58 |
-
//$field['option_array'] = $this->array_to_string($field['option_array']);
|
59 |
-
$field['single_p'] = $this->array_to_string($field['single_p']);
|
60 |
-
$field['single_px'] = $this->array_to_string($field['single_px']);
|
61 |
-
$field['single_p_cat'] = $this->array_to_string($field['single_p_cat']);
|
62 |
-
$field['single_px_cat'] = $this->array_to_string($field['single_px_cat']);
|
63 |
-
$field['tax_remove'] = !$field['tax_remove'];
|
64 |
-
|
65 |
-
// Days
|
66 |
-
if (is_array($field['days_disabler'])) {
|
67 |
-
foreach ($field['days_disabler'] as $day_index => $day) {
|
68 |
-
$field['days_disabler' . strval($day_index)] = 1;
|
69 |
-
}
|
70 |
-
$field['days_disabler'] = 1;
|
71 |
-
unset($field['date_limit_days']);
|
72 |
-
}
|
73 |
-
|
74 |
-
// Dates
|
75 |
-
if (!empty($field['date_limit_fixed_min'])) {
|
76 |
-
|
77 |
-
$min = explode('-', $field['date_limit_fixed_min']);
|
78 |
-
|
79 |
-
$field['single_yy'] = $min[0];
|
80 |
-
$field['single_mm'] = $min[1];
|
81 |
-
$field['single_dd'] = $min[2];
|
82 |
-
}
|
83 |
-
|
84 |
-
if (!empty($field['date_limit_fixed_max'])) {
|
85 |
-
|
86 |
-
$max = explode('-', $field['date_limit_fixed_max']);
|
87 |
-
|
88 |
-
$field['single_max_yy'] = $max[0];
|
89 |
-
$field['single_max_mm'] = $max[1];
|
90 |
-
$field['single_max_dd'] = $max[2];
|
91 |
-
}
|
92 |
-
|
93 |
-
return array_intersect_key($field, array_flip($this->old_args));
|
94 |
-
}
|
95 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-wooccm.php
CHANGED
@@ -2,14 +2,9 @@
|
|
2 |
|
3 |
final class WOOCCM {
|
4 |
|
5 |
-
|
6 |
protected static $_instance;
|
7 |
|
8 |
public function __construct() {
|
9 |
-
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-install.php';
|
10 |
-
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-notices.php';
|
11 |
-
|
12 |
-
register_activation_hook( WOOCCM_PLUGIN_FILE, array( 'WOOCCM_Install', 'install' ) );
|
13 |
|
14 |
load_plugin_textdomain( 'woocommerce-checkout-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
15 |
|
2 |
|
3 |
final class WOOCCM {
|
4 |
|
|
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
|
|
|
|
|
|
|
|
8 |
|
9 |
load_plugin_textdomain( 'woocommerce-checkout-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
10 |
|
includes/quadlayers/links.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Admin_Links {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
function __construct() {
|
8 |
+
add_filter( 'plugin_action_links_' . WOOCCM_PLUGIN_BASENAME, array( $this, 'add_action_links' ) );
|
9 |
+
}
|
10 |
+
|
11 |
+
public function add_action_links( $links ) {
|
12 |
+
$links[] = '<a target="_blank" href="' . WOOCCM_DEMO_URL . '">' . esc_html__( 'Documentation', 'woocommerce-checkout-manager' ) . '</a>';
|
13 |
+
$links[] = '<a target="_blank" href="' . WOOCCM_SUPPORT_URL . '">' . esc_html__( 'Support', 'woocommerce-checkout-manager' ) . '</a>';
|
14 |
+
return $links;
|
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 |
+
}
|
25 |
+
|
26 |
+
WOOCCM_Admin_Links::instance();
|
includes/{class-wooccm-notices.php → quadlayers/notices.php}
RENAMED
@@ -7,17 +7,10 @@ class WOOCCM_Notices {
|
|
7 |
public function __construct() {
|
8 |
add_action( 'wp_ajax_wooccm_dismiss_notice', array( $this, 'ajax_dismiss_notice' ) );
|
9 |
add_action( 'admin_notices', array( $this, 'add_notices' ) );
|
10 |
-
|
11 |
}
|
12 |
|
13 |
-
|
14 |
-
if ( is_null( self::$_instance ) ) {
|
15 |
-
self::$_instance = new self();
|
16 |
-
}
|
17 |
-
return self::$_instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
public function ajax_dismiss_notice() {
|
21 |
if ( check_admin_referer( 'wooccm_dismiss_notice', 'nonce' ) && isset( $_REQUEST['notice_id'] ) ) {
|
22 |
|
23 |
$notice_id = sanitize_key( $_REQUEST['notice_id'] );
|
@@ -31,7 +24,11 @@ class WOOCCM_Notices {
|
|
31 |
wp_die();
|
32 |
}
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
|
36 |
$transient = get_transient( 'wooccm-notice-delay' );
|
37 |
|
@@ -64,8 +61,10 @@ class WOOCCM_Notices {
|
|
64 |
</script>
|
65 |
<?php
|
66 |
|
|
|
|
|
67 |
$user_rating = ! get_user_meta( get_current_user_id(), 'wooccm-user-rating', true );
|
68 |
-
$user_premium = ! get_user_meta( get_current_user_id(), 'wooccm-user-premium', true ) && ! $this->is_installed(
|
69 |
$user_cross_sell = ! get_user_meta( get_current_user_id(), 'wooccm-user-cross-sell', true );
|
70 |
|
71 |
if ( $user_rating ) {
|
@@ -108,14 +107,14 @@ class WOOCCM_Notices {
|
|
108 |
<?php
|
109 |
printf(
|
110 |
esc_html__( 'Today we want to make you a special gift. Using this coupon before the next 48 hours you can get a 20 percent discount on the premium version of the %s plugin.', 'woocommerce-checkout-manager' ),
|
111 |
-
esc_html(
|
112 |
)
|
113 |
?>
|
114 |
</p>
|
115 |
-
<a href="<?php echo esc_url(
|
116 |
<?php esc_html_e( 'More info', 'woocommerce-checkout-manager' ); ?>
|
117 |
</a>
|
118 |
-
<input style="width:
|
119 |
</div>
|
120 |
</div>
|
121 |
</div>
|
@@ -131,7 +130,7 @@ class WOOCCM_Notices {
|
|
131 |
return;
|
132 |
}
|
133 |
|
134 |
-
list($
|
135 |
|
136 |
?>
|
137 |
<div class="wooccm-notice notice notice-info is-dismissible" data-notice_id="wooccm-user-cross-sell">
|
@@ -141,14 +140,14 @@ class WOOCCM_Notices {
|
|
141 |
</div>
|
142 |
<div class="notice-content" style="margin-left: 15px;">
|
143 |
<p>
|
144 |
-
<?php printf( esc_html__( 'Hello! We want to invite you to try our %s plugin!', 'woocommerce-checkout-manager' ),
|
145 |
<br/>
|
146 |
-
<?php echo esc_html(
|
147 |
</p>
|
148 |
<a href="<?php echo esc_url( $action_link ); ?>" class="button-primary">
|
149 |
<?php echo esc_html( $action ); ?>
|
150 |
</a>
|
151 |
-
<a href="<?php echo esc_url(
|
152 |
<?php esc_html_e( 'More info', 'woocommerce-checkout-manager' ); ?>
|
153 |
</a>
|
154 |
</div>
|
@@ -162,17 +161,13 @@ class WOOCCM_Notices {
|
|
162 |
|
163 |
function get_cross_sell() {
|
164 |
|
165 |
-
$title = 'Direct Checkout';
|
166 |
-
$description = esc_html__( 'Direct Checkout for WooCommerce allows you to reduce the steps in the checkout process by skipping the shopping cart page. This can encourage buyers to shop more and quickly. You will increase your sales reducing cart abandonment.', 'woocommerce-checkout-manager' );
|
167 |
-
$link = 'https://quadlayers.com/portfolio/woocommerce-direct-checkout/?utm_source=wooccm_admin';
|
168 |
-
|
169 |
$screen = get_current_screen();
|
170 |
|
171 |
if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
|
172 |
return array();
|
173 |
}
|
174 |
|
175 |
-
$plugin_slug =
|
176 |
|
177 |
$plugin_file = "{$plugin_slug}/{$plugin_slug}.php";
|
178 |
|
@@ -187,9 +182,6 @@ class WOOCCM_Notices {
|
|
187 |
}
|
188 |
|
189 |
return array(
|
190 |
-
$title,
|
191 |
-
$description,
|
192 |
-
$link,
|
193 |
esc_html__( 'Activate', 'woocommerce-checkout-manager' ),
|
194 |
wp_nonce_url( "plugins.php?action=activate&plugin={$plugin_file}&plugin_status=all&paged=1", "activate-plugin_{$plugin_file}" ),
|
195 |
);
|
@@ -201,9 +193,6 @@ class WOOCCM_Notices {
|
|
201 |
}
|
202 |
|
203 |
return array(
|
204 |
-
$title,
|
205 |
-
$description,
|
206 |
-
$link,
|
207 |
esc_html__( 'Install', 'woocommerce-checkout-manager' ),
|
208 |
wp_nonce_url( self_admin_url( "update.php?action=install-plugin&plugin={$plugin_slug}" ), "install-plugin_{$plugin_slug}" ),
|
209 |
);
|
@@ -217,12 +206,12 @@ class WOOCCM_Notices {
|
|
217 |
return isset( $installed_plugins[ $path ] );
|
218 |
}
|
219 |
|
220 |
-
function
|
221 |
-
|
222 |
-
|
223 |
-
|
|
|
224 |
}
|
225 |
-
|
226 |
}
|
227 |
|
228 |
WOOCCM_Notices::instance();
|
7 |
public function __construct() {
|
8 |
add_action( 'wp_ajax_wooccm_dismiss_notice', array( $this, 'ajax_dismiss_notice' ) );
|
9 |
add_action( 'admin_notices', array( $this, 'add_notices' ) );
|
10 |
+
register_activation_hook( WOOCCM_PLUGIN_FILE, array( $this, 'add_transient' ) );
|
11 |
}
|
12 |
|
13 |
+
function ajax_dismiss_notice() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
if ( check_admin_referer( 'wooccm_dismiss_notice', 'nonce' ) && isset( $_REQUEST['notice_id'] ) ) {
|
15 |
|
16 |
$notice_id = sanitize_key( $_REQUEST['notice_id'] );
|
24 |
wp_die();
|
25 |
}
|
26 |
|
27 |
+
function add_transient() {
|
28 |
+
set_transient( 'wooccm-notice-delay', true, MONTH_IN_SECONDS );
|
29 |
+
}
|
30 |
+
|
31 |
+
function add_notices() {
|
32 |
|
33 |
$transient = get_transient( 'wooccm-notice-delay' );
|
34 |
|
61 |
</script>
|
62 |
<?php
|
63 |
|
64 |
+
$plugin_slug = WOOCCM_PREMIUM_SELL_SLUG;
|
65 |
+
|
66 |
$user_rating = ! get_user_meta( get_current_user_id(), 'wooccm-user-rating', true );
|
67 |
+
$user_premium = ! get_user_meta( get_current_user_id(), 'wooccm-user-premium', true ) && ! $this->is_installed( "{$plugin_slug}/{$plugin_slug}.php" );
|
68 |
$user_cross_sell = ! get_user_meta( get_current_user_id(), 'wooccm-user-cross-sell', true );
|
69 |
|
70 |
if ( $user_rating ) {
|
107 |
<?php
|
108 |
printf(
|
109 |
esc_html__( 'Today we want to make you a special gift. Using this coupon before the next 48 hours you can get a 20 percent discount on the premium version of the %s plugin.', 'woocommerce-checkout-manager' ),
|
110 |
+
esc_html( WOOCCM_PREMIUM_SELL_NAME )
|
111 |
)
|
112 |
?>
|
113 |
</p>
|
114 |
+
<a href="<?php echo esc_url( WOOCCM_PREMIUM_SELL_URL ); ?>" class="button-primary" target="_blank">
|
115 |
<?php esc_html_e( 'More info', 'woocommerce-checkout-manager' ); ?>
|
116 |
</a>
|
117 |
+
<input style="width:130px" type="text" value="ADMINPANEL20%"/>
|
118 |
</div>
|
119 |
</div>
|
120 |
</div>
|
130 |
return;
|
131 |
}
|
132 |
|
133 |
+
list($action, $action_link) = $cross_sell;
|
134 |
|
135 |
?>
|
136 |
<div class="wooccm-notice notice notice-info is-dismissible" data-notice_id="wooccm-user-cross-sell">
|
140 |
</div>
|
141 |
<div class="notice-content" style="margin-left: 15px;">
|
142 |
<p>
|
143 |
+
<?php printf( esc_html__( 'Hello! We want to invite you to try our %s plugin!', 'woocommerce-checkout-manager' ), esc_html( WOOCCM_CROSS_INSTALL_NAME ) ); ?>
|
144 |
<br/>
|
145 |
+
<?php echo esc_html( WOOCCM_CROSS_INSTALL_DESCRIPTION ); ?>
|
146 |
</p>
|
147 |
<a href="<?php echo esc_url( $action_link ); ?>" class="button-primary">
|
148 |
<?php echo esc_html( $action ); ?>
|
149 |
</a>
|
150 |
+
<a href="<?php echo esc_url( WOOCCM_CROSS_INSTALL_URL ); ?>" class="button-secondary" target="_blank">
|
151 |
<?php esc_html_e( 'More info', 'woocommerce-checkout-manager' ); ?>
|
152 |
</a>
|
153 |
</div>
|
161 |
|
162 |
function get_cross_sell() {
|
163 |
|
|
|
|
|
|
|
|
|
164 |
$screen = get_current_screen();
|
165 |
|
166 |
if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
|
167 |
return array();
|
168 |
}
|
169 |
|
170 |
+
$plugin_slug = WOOCCM_CROSS_INSTALL_SLUG;
|
171 |
|
172 |
$plugin_file = "{$plugin_slug}/{$plugin_slug}.php";
|
173 |
|
182 |
}
|
183 |
|
184 |
return array(
|
|
|
|
|
|
|
185 |
esc_html__( 'Activate', 'woocommerce-checkout-manager' ),
|
186 |
wp_nonce_url( "plugins.php?action=activate&plugin={$plugin_file}&plugin_status=all&paged=1", "activate-plugin_{$plugin_file}" ),
|
187 |
);
|
193 |
}
|
194 |
|
195 |
return array(
|
|
|
|
|
|
|
196 |
esc_html__( 'Install', 'woocommerce-checkout-manager' ),
|
197 |
wp_nonce_url( self_admin_url( "update.php?action=install-plugin&plugin={$plugin_slug}" ), "install-plugin_{$plugin_slug}" ),
|
198 |
);
|
206 |
return isset( $installed_plugins[ $path ] );
|
207 |
}
|
208 |
|
209 |
+
public static function instance() {
|
210 |
+
if ( is_null( self::$_instance ) ) {
|
211 |
+
self::$_instance = new self();
|
212 |
+
}
|
213 |
+
return self::$_instance;
|
214 |
}
|
|
|
215 |
}
|
216 |
|
217 |
WOOCCM_Notices::instance();
|
includes/view/frontend/class-wooccm-fields-filters.php
CHANGED
@@ -1,319 +1,300 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class WOOCCM_Fields_Filter
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
public function __construct()
|
10 |
-
{
|
11 |
-
$this->init();
|
12 |
-
}
|
13 |
-
|
14 |
-
public static function instance()
|
15 |
-
{
|
16 |
-
if (is_null(self::$_instance)) {
|
17 |
-
self::$_instance = new self();
|
18 |
-
}
|
19 |
-
return self::$_instance;
|
20 |
-
}
|
21 |
-
|
22 |
-
// Custom fields
|
23 |
-
// ---------------------------------------------------------------------------
|
24 |
-
public function custom_field($field, $key, $args, $value = null)
|
25 |
-
{
|
26 |
-
|
27 |
-
$field = '';
|
28 |
-
|
29 |
-
if ($args['required']) {
|
30 |
-
//$args['class'][] = 'validate-required';
|
31 |
-
$required = ' <abbr class="required" title="' . esc_attr__('required', 'woocommerce-checkout-manager') . '">*</abbr>';
|
32 |
-
} else {
|
33 |
-
$required = ' <span class="optional">(' . esc_html__('optional', 'woocommerce-checkout-manager') . ')</span>';
|
34 |
-
}
|
35 |
-
|
36 |
-
if (is_string($args['label_class'])) {
|
37 |
-
$args['label_class'] = array($args['label_class']);
|
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 |
-
$args['class'][] = 'validate-' . $validate;
|
74 |
-
}
|
75 |
-
}
|
76 |
|
77 |
-
|
78 |
-
$label_id = $args['id'];
|
79 |
-
$sort = $args['priority'] ? $args['priority'] : '';
|
80 |
-
$field_container = '<p class="form-row %1$s" id="%2$s" data-priority="' . esc_attr($sort) . '">%3$s</p>';
|
81 |
-
switch ($args['type']) {
|
82 |
|
83 |
-
|
84 |
-
$field = '';
|
85 |
|
86 |
-
|
|
|
|
|
|
|
|
|
87 |
|
88 |
-
|
|
|
89 |
|
90 |
-
|
91 |
-
$option_key = is_numeric($option_key) ? $option_text : $option_key;
|
92 |
-
$field .= '<input type="radio" class="input-checkbox" value="' . esc_attr($option_key) . '" name="' . esc_attr($key) . '" id="' . esc_attr($key) . '_' . esc_attr($option_key) . '"' . checked($value, $option_text, false) . ' />';
|
93 |
-
$field .= '<label for="' . esc_attr($key) . '_' . esc_attr($option_key) . '" class="checkbox ' . implode(' ', $args['label_class']) . '">' . $option_text . '</label><br>';
|
94 |
-
}
|
95 |
|
96 |
-
|
97 |
-
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
-
|
102 |
|
103 |
-
|
|
|
104 |
|
105 |
-
|
106 |
-
$field .= '<select name="' . esc_attr($key) . '" id="' . esc_attr($args['id']) . '" class="select ' . esc_attr(implode(' ', $args['input_class'])) . '" ' . implode(' ', $custom_attributes) . ' data-placeholder="' . esc_attr($args['placeholder']) . '">';
|
107 |
-
if (!empty($args['placeholder'])) {
|
108 |
-
$field .= '<option value="" disabled="disabled" selected="selected">' . esc_attr($args['placeholder']) . '</option>';
|
109 |
-
}
|
110 |
-
foreach ($args['options'] as $option_key => $option_text) {
|
111 |
-
$option_key = is_numeric($option_key) ? $option_text : $option_key;
|
112 |
-
$field .= '<option value="' . esc_attr($option_key) . '" ' . selected($value, $option_text, false) . '>' . esc_attr($option_text) . '</option>';
|
113 |
-
}
|
114 |
-
$field .= '</select>';
|
115 |
-
}
|
116 |
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
-
|
120 |
|
121 |
-
|
|
|
122 |
|
123 |
-
|
124 |
|
125 |
-
|
126 |
-
$field .= '<select name="' . esc_attr($key) . '[]" id="' . esc_attr($key) . '" class="select ' . esc_attr(implode(' ', $args['input_class'])) . '" multiple="multiple" ' . implode(' ', $custom_attributes) . '>';
|
127 |
-
foreach ($args['options'] as $option_key => $option_text) {
|
128 |
-
$option_key = is_numeric($option_key) ? $option_text : $option_key;
|
129 |
-
$field .= '<option value="' . esc_attr($option_key) . '" ' . selected(in_array($option_text, $value), 1, false) . '>' . esc_attr($option_text) . '</option>';
|
130 |
-
}
|
131 |
-
$field .= ' </select>';
|
132 |
-
}
|
133 |
|
134 |
-
|
135 |
|
136 |
-
|
|
|
|
|
|
|
137 |
|
138 |
-
|
|
|
139 |
|
140 |
-
|
141 |
|
142 |
-
|
|
|
143 |
|
144 |
-
|
|
|
|
|
|
|
|
|
145 |
|
146 |
-
|
147 |
-
|
148 |
-
$field .= '<label><input type="checkbox" name="' . esc_attr($key) . '[]" value="' . esc_attr($option_key) . '"' . checked(in_array($option_text, $value), 1, false) . ' /> ' . esc_attr($option_text) . '</label>';
|
149 |
-
}
|
150 |
|
151 |
-
|
152 |
-
|
153 |
|
154 |
-
|
|
|
|
|
155 |
|
156 |
-
|
157 |
|
158 |
-
|
|
|
|
|
159 |
|
160 |
-
|
161 |
-
//$field .= '<input class="wooccm-file-field" type="text" name="' . esc_attr($key) . '" id="' . esc_attr($key) . '" value="test" />';
|
162 |
-
$field .= '<input class="wooccm-file-field" type="hidden" name="' . esc_attr($key) . '" id="' . esc_attr($args['id']) . '" value="" ' . implode(' ', $custom_attributes) . ' />';
|
163 |
-
$field .= '<input style="display:none;" class="fileinput-button" type="file" name="' . esc_attr($key) . '_file" id="' . esc_attr($key) . '_file" multiple="multiple" />';
|
164 |
-
$field .= '<span style="display:none;" class="wooccm-file-list"></span>';
|
165 |
|
166 |
-
|
167 |
-
|
|
|
|
|
168 |
|
169 |
-
|
170 |
-
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
175 |
|
176 |
-
|
|
|
|
|
|
|
|
|
177 |
|
178 |
-
|
179 |
-
$field_html .= '<span class="description" id="' . esc_attr($args['id']) . '-description" aria-hidden="true">' . wp_kses_post($args['description']) . '</span>';
|
180 |
-
}
|
181 |
|
182 |
-
|
183 |
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
}
|
188 |
|
189 |
-
|
190 |
-
|
191 |
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
196 |
|
197 |
-
|
198 |
-
$custom_attributes = array();
|
199 |
|
200 |
-
|
201 |
-
foreach ($args['custom_attributes'] as $attribute => $attribute_value) {
|
202 |
-
$custom_attributes[] = esc_attr($attribute) . '="' . esc_attr($attribute_value) . '"';
|
203 |
-
}
|
204 |
-
}
|
205 |
|
206 |
-
|
207 |
|
208 |
-
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
$field_container = '<div class="form-row %1$s" id="%2$s" data-priority="' . esc_attr($sort) . '">%3$s</div>';
|
213 |
|
214 |
-
|
215 |
-
|
|
|
|
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
{
|
221 |
|
222 |
-
|
223 |
-
$args['maxlength'] = 7;
|
224 |
|
225 |
-
|
226 |
|
227 |
-
|
|
|
|
|
228 |
|
229 |
-
|
230 |
|
231 |
-
|
232 |
|
233 |
-
|
234 |
-
|
235 |
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
|
241 |
-
|
|
|
|
|
242 |
|
243 |
-
|
244 |
-
return $field;
|
245 |
-
}
|
246 |
|
247 |
-
|
248 |
|
249 |
-
|
|
|
|
|
250 |
|
251 |
-
|
252 |
-
$value = $args['default'];
|
253 |
-
}
|
254 |
|
255 |
-
|
256 |
|
257 |
-
|
|
|
258 |
|
259 |
-
|
260 |
-
|
261 |
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
{
|
266 |
|
267 |
-
|
268 |
|
269 |
-
|
270 |
-
return $field;
|
271 |
-
}
|
272 |
|
273 |
-
|
|
|
274 |
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
public function hidden_field($field = '', $key = '', $args = [], $value = null)
|
289 |
-
{
|
290 |
-
|
291 |
-
static $instance = 0;
|
292 |
-
|
293 |
-
if ($instance) {
|
294 |
-
return $field;
|
295 |
-
}
|
296 |
-
|
297 |
-
$instance++;
|
298 |
-
|
299 |
-
$field .= '<input type="hidden" name="' . esc_attr($key) . '" id="' . esc_attr($args['id']) . '" value="' . esc_html($value) . '" ' . implode(' ', $args['custom_attributes']) . ' readonly="readonly" />';
|
300 |
-
|
301 |
-
return $field;
|
302 |
-
}
|
303 |
-
|
304 |
-
public function init()
|
305 |
-
{
|
306 |
-
add_filter('woocommerce_form_field_radio', array($this, 'custom_field'), 10, 4);
|
307 |
-
add_filter('woocommerce_form_field_multicheckbox', array($this, 'custom_field'), 10, 4);
|
308 |
-
add_filter('woocommerce_form_field_multiselect', array($this, 'custom_field'), 10, 4);
|
309 |
-
add_filter('woocommerce_form_field_select', array($this, 'custom_field'), 10, 4);
|
310 |
-
add_filter('woocommerce_form_field_file', array($this, 'custom_field'), 10, 4);
|
311 |
-
add_filter('woocommerce_form_field_heading', array($this, 'heading_field'), 10, 4);
|
312 |
-
add_filter('woocommerce_form_field_colorpicker', array($this, 'colorpicker_field'), 10, 4);
|
313 |
-
add_filter('woocommerce_form_field_country', array($this, 'country_field'), 10, 4);
|
314 |
-
add_filter('woocommerce_form_field_state', array($this, 'state_field'), 10, 4);
|
315 |
-
add_filter('woocommerce_form_field_hidden', array($this, 'hidden_field'), 10, 4);
|
316 |
-
}
|
317 |
}
|
318 |
|
319 |
WOOCCM_Fields_Filter::instance();
|
1 |
<?php
|
2 |
|
3 |
+
class WOOCCM_Fields_Filter {
|
4 |
+
|
5 |
+
|
6 |
+
protected static $_instance;
|
7 |
+
public $count = 0;
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
$this->init();
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if ( is_null( self::$_instance ) ) {
|
15 |
+
self::$_instance = new self();
|
16 |
+
}
|
17 |
+
return self::$_instance;
|
18 |
+
}
|
19 |
+
|
20 |
+
// Custom fields
|
21 |
+
// ---------------------------------------------------------------------------
|
22 |
+
public function custom_field( $field = '', $key = '', $args = array(), $value = null ) {
|
23 |
+
$field = '';
|
24 |
+
|
25 |
+
if ( $args['required'] ) {
|
26 |
+
// $args['class'][] = 'validate-required';
|
27 |
+
$required = ' <abbr class="required" title="' . esc_attr__( 'required', 'woocommerce-checkout-manager' ) . '">*</abbr>';
|
28 |
+
} else {
|
29 |
+
$required = ' <span class="optional">(' . esc_html__( 'optional', 'woocommerce-checkout-manager' ) . ')</span>';
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( is_string( $args['label_class'] ) ) {
|
33 |
+
$args['label_class'] = array( $args['label_class'] );
|
34 |
+
}
|
35 |
+
|
36 |
+
// if (is_null($value)) {
|
37 |
+
if ( ! $value ) {
|
38 |
+
$value = $args['default'];
|
39 |
+
}
|
40 |
|
41 |
+
// Custom attribute handling.
|
42 |
+
$custom_attributes = array();
|
43 |
+
$args['custom_attributes'] = array_filter( (array) $args['custom_attributes'], 'strlen' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
if ( $args['maxlength'] ) {
|
46 |
+
$args['custom_attributes']['maxlength'] = absint( $args['maxlength'] );
|
47 |
+
}
|
|
|
48 |
|
49 |
+
if ( ! empty( $args['autocomplete'] ) ) {
|
50 |
+
$args['custom_attributes']['autocomplete'] = $args['autocomplete'];
|
51 |
+
}
|
52 |
|
53 |
+
if ( true === $args['autofocus'] ) {
|
54 |
+
$args['custom_attributes']['autofocus'] = 'autofocus';
|
55 |
+
}
|
56 |
|
57 |
+
if ( $args['description'] ) {
|
58 |
+
$args['custom_attributes']['aria-describedby'] = $args['id'] . '-description';
|
59 |
+
}
|
60 |
|
61 |
+
if ( ! empty( $args['custom_attributes'] ) && is_array( $args['custom_attributes'] ) ) {
|
62 |
+
foreach ( $args['custom_attributes'] as $attribute => $attribute_value ) {
|
63 |
+
$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
|
64 |
+
}
|
65 |
+
}
|
66 |
|
67 |
+
if ( ! empty( $args['validate'] ) ) {
|
68 |
+
foreach ( $args['validate'] as $validate ) {
|
69 |
+
$args['class'][] = 'validate-' . $validate;
|
70 |
+
}
|
71 |
+
}
|
72 |
|
73 |
+
// $field = '';
|
74 |
+
$label_id = $args['id'];
|
75 |
+
$sort = $args['priority'] ? $args['priority'] : '';
|
76 |
+
$field_container = '<p class="form-row %1$s" id="%2$s" data-priority="' . esc_attr( $sort ) . '">%3$s</p>';
|
77 |
+
switch ( $args['type'] ) {
|
78 |
|
79 |
+
case 'radio':
|
80 |
+
$field = '';
|
|
|
|
|
|
|
81 |
|
82 |
+
if ( ! empty( $args['options'] ) ) {
|
|
|
|
|
|
|
|
|
83 |
|
84 |
+
$field .= ' <span class="woocommerce-radio-wrapper" ' . implode( ' ', $custom_attributes ) . '>';
|
|
|
85 |
|
86 |
+
foreach ( $args['options'] as $option_key => $option_text ) {
|
87 |
+
$option_key = is_numeric( $option_key ) ? $option_text : $option_key;
|
88 |
+
$field .= '<input type="radio" class="input-checkbox" value="' . esc_attr( $option_key ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $key ) . '_' . esc_attr( $option_key ) . '"' . checked( $value, $option_text, false ) . ' />';
|
89 |
+
$field .= '<label for="' . esc_attr( $key ) . '_' . esc_attr( $option_key ) . '" class="checkbox ' . implode( ' ', $args['label_class'] ) . '">' . $option_text . '</label><br>';
|
90 |
+
}
|
91 |
|
92 |
+
$field .= ' </span>';
|
93 |
+
}
|
94 |
|
95 |
+
break;
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
case 'select':
|
98 |
+
$field = '';
|
99 |
|
100 |
+
if ( ! empty( $args['options'] ) ) {
|
101 |
+
$field .= '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . ' data-placeholder="' . esc_attr( $args['placeholder'] ) . '">';
|
102 |
+
if ( ! empty( $args['placeholder'] ) ) {
|
103 |
+
$field .= '<option value="" disabled="disabled" selected="selected">' . esc_attr( $args['placeholder'] ) . '</option>';
|
104 |
+
}
|
105 |
+
foreach ( $args['options'] as $option_key => $option_text ) {
|
106 |
+
$option_key = is_numeric( $option_key ) ? $option_text : $option_key;
|
107 |
+
$field .= '<option value="' . esc_attr( $option_key ) . '" ' . selected( $value, $option_text, false ) . '>' . esc_attr( $option_text ) . '</option>';
|
108 |
+
}
|
109 |
+
$field .= '</select>';
|
110 |
+
}
|
111 |
|
112 |
+
break;
|
113 |
|
114 |
+
case 'multiselect':
|
115 |
+
$field = '';
|
116 |
|
117 |
+
$value = is_array( $value ) ? $value : array_map( 'trim', (array) explode( ',', $value ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
+
if ( ! empty( $args['options'] ) ) {
|
120 |
+
$field .= '<select name="' . esc_attr( $key ) . '[]" id="' . esc_attr( $key ) . '" class="select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" multiple="multiple" ' . implode( ' ', $custom_attributes ) . '>';
|
121 |
+
foreach ( $args['options'] as $option_key => $option_text ) {
|
122 |
+
$option_key = is_numeric( $option_key ) ? $option_text : $option_key;
|
123 |
+
$field .= '<option value="' . esc_attr( $option_key ) . '" ' . selected( in_array( $option_text, $value ), 1, false ) . '>' . esc_attr( $option_text ) . '</option>';
|
124 |
+
}
|
125 |
+
$field .= ' </select>';
|
126 |
+
}
|
127 |
|
128 |
+
break;
|
129 |
|
130 |
+
case 'multicheckbox':
|
131 |
+
$field = '';
|
132 |
|
133 |
+
$value = is_array( $value ) ? $value : array_map( 'trim', (array) explode( ',', $value ) );
|
134 |
|
135 |
+
if ( ! empty( $args['options'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
+
$field .= ' <span class="woocommerce-multicheckbox-wrapper" ' . implode( ' ', $custom_attributes ) . '>';
|
138 |
|
139 |
+
foreach ( $args['options'] as $option_key => $option_text ) {
|
140 |
+
$option_key = is_numeric( $option_key ) ? $option_text : $option_key;
|
141 |
+
$field .= '<label><input type="checkbox" name="' . esc_attr( $key ) . '[]" value="' . esc_attr( $option_key ) . '"' . checked( in_array( $option_text, $value ), 1, false ) . ' /> ' . esc_attr( $option_text ) . '</label>';
|
142 |
+
}
|
143 |
|
144 |
+
$field .= '</span>';
|
145 |
+
}
|
146 |
|
147 |
+
break;
|
148 |
|
149 |
+
case 'file':
|
150 |
+
$field = '';
|
151 |
|
152 |
+
$field .= '<button style="width:100%" class="wooccm-file-button button alt" type="button" class="button alt" id="' . esc_attr( $key ) . '_button">' . esc_html( $args['placeholder'] ) . '</button>';
|
153 |
+
// $field .= '<input class="wooccm-file-field" type="text" name="' . esc_attr($key) . '" id="' . esc_attr($key) . '" value="test" />';
|
154 |
+
$field .= '<input class="wooccm-file-field" type="hidden" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="" ' . implode( ' ', $custom_attributes ) . ' />';
|
155 |
+
$field .= '<input style="display:none;" class="fileinput-button" type="file" name="' . esc_attr( $key ) . '_file" id="' . esc_attr( $key ) . '_file" multiple="multiple" />';
|
156 |
+
$field .= '<span style="display:none;" class="wooccm-file-list"></span>';
|
157 |
|
158 |
+
break;
|
159 |
+
}
|
|
|
|
|
160 |
|
161 |
+
if ( ! empty( $field ) ) {
|
162 |
+
$field_html = '';
|
163 |
|
164 |
+
if ( $args['label'] && 'checkbox' !== $args['type'] ) {
|
165 |
+
$field_html .= '<label for="' . esc_attr( $label_id ) . '" class="' . esc_attr( implode( ' ', $args['label_class'] ) ) . '">' . $args['label'] . $required . '</label>';
|
166 |
+
}
|
167 |
|
168 |
+
$field_html .= '<span class="woocommerce-input-wrapper">' . $field;
|
169 |
|
170 |
+
if ( $args['description'] ) {
|
171 |
+
$field_html .= '<span class="description" id="' . esc_attr( $args['id'] ) . '-description" aria-hidden="true">' . wp_kses_post( $args['description'] ) . '</span>';
|
172 |
+
}
|
173 |
|
174 |
+
$field_html .= '</span>';
|
|
|
|
|
|
|
|
|
175 |
|
176 |
+
$container_class = esc_attr( implode( ' ', $args['class'] ) );
|
177 |
+
$container_id = esc_attr( $args['id'] ) . '_field';
|
178 |
+
$field = sprintf( $field_container, $container_class, $container_id, $field_html );
|
179 |
+
}
|
180 |
|
181 |
+
return $field;
|
182 |
+
}
|
183 |
|
184 |
+
// Heading
|
185 |
+
// ---------------------------------------------------------------------------
|
186 |
+
public function heading_field( $field = '', $key = '', $args = array(), $value = null ) {
|
187 |
+
// Custom attribute handling.
|
188 |
+
$custom_attributes = array();
|
189 |
|
190 |
+
if ( ! empty( $args['custom_attributes'] ) && is_array( $args['custom_attributes'] ) ) {
|
191 |
+
foreach ( $args['custom_attributes'] as $attribute => $attribute_value ) {
|
192 |
+
$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
|
193 |
+
}
|
194 |
+
}
|
195 |
|
196 |
+
$sort = $args['priority'] ? $args['priority'] : '';
|
|
|
|
|
197 |
|
198 |
+
$field_html = '<h3 ' . implode( ' ', $custom_attributes ) . '>' . esc_html( $args['label'] ) . '</h3>';
|
199 |
|
200 |
+
$container_class = esc_attr( implode( ' ', $args['class'] ) );
|
201 |
+
$container_id = esc_attr( $args['id'] ) . '_field';
|
202 |
+
$field_container = '<div class="form-row %1$s" id="%2$s" data-priority="' . esc_attr( $sort ) . '">%3$s</div>';
|
|
|
203 |
|
204 |
+
return sprintf( $field_container, $container_class, $container_id, $field_html );
|
205 |
+
}
|
206 |
|
207 |
+
// Colorpicker
|
208 |
+
// ---------------------------------------------------------------------------
|
209 |
+
public function colorpicker_field( $field = '', $key = '', $args = array(), $value = null ) {
|
210 |
+
$args['type'] = 'text';
|
211 |
+
$args['maxlength'] = 7;
|
212 |
|
213 |
+
ob_start();
|
|
|
214 |
|
215 |
+
woocommerce_form_field( $key, $args, $value );
|
|
|
|
|
|
|
|
|
216 |
|
217 |
+
$field = ob_get_clean();
|
218 |
|
219 |
+
$field = str_replace( '</p>', ' <span class="wooccmcolorpicker_container" class="spec_shootd"></span></p>', $field );
|
220 |
|
221 |
+
return $field;
|
222 |
+
}
|
|
|
223 |
|
224 |
+
// Country
|
225 |
+
// ---------------------------------------------------------------------------
|
226 |
+
public function country_field( $field = '', $key = '', $args = array(), $value = null ) {
|
227 |
+
static $instance = 0;
|
228 |
|
229 |
+
if ( $instance ) {
|
230 |
+
return $field;
|
231 |
+
}
|
|
|
232 |
|
233 |
+
$instance++;
|
|
|
234 |
|
235 |
+
ob_start();
|
236 |
|
237 |
+
if ( ! empty( $args['default'] ) ) {
|
238 |
+
$value = $args['default'];
|
239 |
+
}
|
240 |
|
241 |
+
woocommerce_form_field( $key, $args, $value );
|
242 |
|
243 |
+
$field = ob_get_clean();
|
244 |
|
245 |
+
return $field;
|
246 |
+
}
|
247 |
|
248 |
+
// State
|
249 |
+
// ---------------------------------------------------------------------------
|
250 |
+
public function state_field( $field = '', $key = '', $args = array(), $value = null ) {
|
251 |
+
static $instance = 0;
|
252 |
|
253 |
+
if ( $instance ) {
|
254 |
+
return $field;
|
255 |
+
}
|
256 |
|
257 |
+
$instance++;
|
|
|
|
|
258 |
|
259 |
+
ob_start();
|
260 |
|
261 |
+
if ( ! empty( $args['default'] ) ) {
|
262 |
+
$value = $args['default'];
|
263 |
+
}
|
264 |
|
265 |
+
woocommerce_form_field( $key, $args, $value );
|
|
|
|
|
266 |
|
267 |
+
$field = ob_get_clean();
|
268 |
|
269 |
+
return $field;
|
270 |
+
}
|
271 |
|
272 |
+
public function hidden_field( $field = '', $key = '', $args = array(), $value = null ) {
|
273 |
+
static $instance = 0;
|
274 |
|
275 |
+
if ( $instance ) {
|
276 |
+
return $field;
|
277 |
+
}
|
|
|
278 |
|
279 |
+
$instance++;
|
280 |
|
281 |
+
$field .= '<input type="hidden" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="' . esc_html( $value ) . '" ' . implode( ' ', $args['custom_attributes'] ) . ' readonly="readonly" />';
|
|
|
|
|
282 |
|
283 |
+
return $field;
|
284 |
+
}
|
285 |
|
286 |
+
public function init() {
|
287 |
+
add_filter( 'woocommerce_form_field_radio', array( $this, 'custom_field' ), 10, 4 );
|
288 |
+
add_filter( 'woocommerce_form_field_multicheckbox', array( $this, 'custom_field' ), 10, 4 );
|
289 |
+
add_filter( 'woocommerce_form_field_multiselect', array( $this, 'custom_field' ), 10, 4 );
|
290 |
+
add_filter( 'woocommerce_form_field_select', array( $this, 'custom_field' ), 10, 4 );
|
291 |
+
add_filter( 'woocommerce_form_field_file', array( $this, 'custom_field' ), 10, 4 );
|
292 |
+
add_filter( 'woocommerce_form_field_heading', array( $this, 'heading_field' ), 10, 4 );
|
293 |
+
add_filter( 'woocommerce_form_field_colorpicker', array( $this, 'colorpicker_field' ), 10, 4 );
|
294 |
+
add_filter( 'woocommerce_form_field_country', array( $this, 'country_field' ), 10, 4 );
|
295 |
+
add_filter( 'woocommerce_form_field_state', array( $this, 'state_field' ), 10, 4 );
|
296 |
+
add_filter( 'woocommerce_form_field_hidden', array( $this, 'hidden_field' ), 10, 4 );
|
297 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
299 |
|
300 |
WOOCCM_Fields_Filter::instance();
|
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.2.
|
9 |
WC requires at least: 3.1.0
|
10 |
WC tested up to: 6.8
|
11 |
License: GPLv3
|
@@ -149,6 +149,9 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
|
|
149 |
|
150 |
== Changelog ==
|
151 |
|
|
|
|
|
|
|
152 |
= 6.2.2
|
153 |
* Fix. PHP erros
|
154 |
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 6.0.1
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 6.2.3
|
9 |
WC requires at least: 3.1.0
|
10 |
WC tested up to: 6.8
|
11 |
License: GPLv3
|
149 |
|
150 |
== Changelog ==
|
151 |
|
152 |
+
= 6.2.3
|
153 |
+
* Fix. PHP erros
|
154 |
+
|
155 |
= 6.2.2
|
156 |
* Fix. PHP erros
|
157 |
|
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.2.
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
@@ -16,51 +16,37 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
16 |
die( '-1' );
|
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 |
-
if ( ! defined( 'WOOCCM_DEMO_URL' ) ) {
|
44 |
-
define( 'WOOCCM_DEMO_URL', 'https://quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=wooccm_admin' );
|
45 |
-
}
|
46 |
-
if ( ! defined( 'WOOCCM_PURCHASE_URL' ) ) {
|
47 |
-
define( 'WOOCCM_PURCHASE_URL', WOOCCM_DEMO_URL );
|
48 |
-
}
|
49 |
-
if ( ! defined( 'WOOCCM_SUPPORT_URL' ) ) {
|
50 |
-
define( 'WOOCCM_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=wooccm_admin' );
|
51 |
-
}
|
52 |
-
if ( ! defined( 'WOOCCM_GROUP_URL' ) ) {
|
53 |
-
define( 'WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers' );
|
54 |
-
}
|
55 |
-
if ( ! defined( 'WOOCCM_DEVELOPER' ) ) {
|
56 |
-
define( 'WOOCCM_DEVELOPER', false );
|
57 |
-
}
|
58 |
|
59 |
if ( ! class_exists( 'WOOCCM', false ) ) {
|
60 |
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm.php';
|
61 |
}
|
62 |
|
63 |
require_once WOOCCM_PLUGIN_DIR . 'includes/quadlayers/widget.php';
|
|
|
|
|
64 |
|
65 |
function WOOCCM() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
|
66 |
return WOOCCM::instance();
|
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.2.3
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
16 |
die( '-1' );
|
17 |
}
|
18 |
|
19 |
+
define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
|
20 |
+
define( 'WOOCCM_PLUGIN_VERSION', '6.2.3' );
|
21 |
+
define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
|
22 |
+
define( 'WOOCCM_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
|
23 |
+
define( 'WOOCCM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
24 |
+
define( 'WOOCCM_PREFIX', 'wooccm' );
|
25 |
+
define( 'WOOCCM_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-checkout-manager/' );
|
26 |
+
define( 'WOOCCM_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-checkout-manager/reviews/?filter=5#new-post' );
|
27 |
+
define( 'WOOCCM_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/woocommerce-checkout-manager/?utm_source=wooccm_admin' );
|
28 |
+
define( 'WOOCCM_DEMO_URL', 'https://quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=wooccm_admin' );
|
29 |
+
define( 'WOOCCM_PURCHASE_URL', WOOCCM_DEMO_URL );
|
30 |
+
define( 'WOOCCM_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=wooccm_admin' );
|
31 |
+
define( 'WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers' );
|
32 |
+
define( 'WOOCCM_DEVELOPER', false );
|
33 |
+
|
34 |
+
define( 'WOOCCM_PREMIUM_SELL_SLUG', 'woocommerce-checkout-manager-pro' );
|
35 |
+
define( 'WOOCCM_PREMIUM_SELL_NAME', 'WooCommerce Checkout Manager' );
|
36 |
+
define( 'WOOCCM_PREMIUM_SELL_URL', 'https://quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=wooccm_admin' );
|
37 |
+
|
38 |
+
define( 'WOOCCM_CROSS_INSTALL_SLUG', 'woocommerce-direct-checkout' );
|
39 |
+
define( 'WOOCCM_CROSS_INSTALL_NAME', 'Direct Checkout' );
|
40 |
+
define( 'WOOCCM_CROSS_INSTALL_DESCRIPTION', esc_html__( 'Direct Checkout for WooCommerce allows you to reduce the steps in the checkout process by skipping the shopping cart page. This can encourage buyers to shop more and quickly. You will increase your sales reducing cart abandonment.', 'woocommerce-checkout-manager' ) );
|
41 |
+
define( 'WOOCCM_CROSS_INSTALL_URL', 'https://quadlayers.com/portfolio/woocommerce-checkout-manager/?utm_source=wooccm_admin' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
if ( ! class_exists( 'WOOCCM', false ) ) {
|
44 |
include_once WOOCCM_PLUGIN_DIR . 'includes/class-wooccm.php';
|
45 |
}
|
46 |
|
47 |
require_once WOOCCM_PLUGIN_DIR . 'includes/quadlayers/widget.php';
|
48 |
+
require_once WOOCCM_PLUGIN_DIR . 'includes/quadlayers/notices.php';
|
49 |
+
require_once WOOCCM_PLUGIN_DIR . 'includes/quadlayers/links.php';
|
50 |
|
51 |
function WOOCCM() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
|
52 |
return WOOCCM::instance();
|