Version Description
- Fix: Undefined variable: custom_fields
- Fix: woocommerce checkout country required when is removed
- Fix: woocommerce checkout additional fields required notice duplicated
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 4.4.1 |
Comparing to | |
See all releases |
Code changes from version 4.4.0 to 4.4.1
- assets/js/wooccm-admin.js +8 -9
- assets/js/wooccm-admin.min.js +1 -1
- assets/js/wooccm-modal.js +120 -193
- assets/js/wooccm-modal.min.js +1 -1
- new/admin.php +29 -0
- new/admin/pages/billing.php +503 -365
- new/fields_handler.php +23 -0
- new/fields_register.php +1 -1
- new/fields_required.php +1 -1
- readme.txt +6 -1
- woocommerce-checkout-manager.php +7 -8
assets/js/wooccm-admin.js
CHANGED
@@ -45,19 +45,18 @@
|
|
45 |
$tr = $link.closest('tr'),
|
46 |
$toggle = $link.find('.woocommerce-input-toggle');
|
47 |
|
48 |
-
var data = {
|
49 |
-
action: 'wooccm_toggle_field_enabled',
|
50 |
-
nonce: wooccm.nonce,
|
51 |
-
field_id: $tr.data('field_id')
|
52 |
-
};
|
53 |
-
|
54 |
-
$toggle.addClass('woocommerce-input-toggle--loading');
|
55 |
-
|
56 |
$.ajax({
|
57 |
url: woocommerce_admin.ajax_url,
|
58 |
-
data:
|
|
|
|
|
|
|
|
|
59 |
dataType: 'json',
|
60 |
type: 'POST',
|
|
|
|
|
|
|
61 |
success: function (response) {
|
62 |
|
63 |
if (true === response.data) {
|
45 |
$tr = $link.closest('tr'),
|
46 |
$toggle = $link.find('.woocommerce-input-toggle');
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
$.ajax({
|
49 |
url: woocommerce_admin.ajax_url,
|
50 |
+
data: {
|
51 |
+
action: 'wooccm_toggle_field_enabled',
|
52 |
+
nonce: wooccm.nonce,
|
53 |
+
field_id: $tr.data('field_id')
|
54 |
+
},
|
55 |
dataType: 'json',
|
56 |
type: 'POST',
|
57 |
+
beforeSend: function (response) {
|
58 |
+
$toggle.addClass('woocommerce-input-toggle--loading');
|
59 |
+
},
|
60 |
success: function (response) {
|
61 |
|
62 |
if (true === response.data) {
|
assets/js/wooccm-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(a){a("#wooccm_billing_fields").on("click",".wooccm-field-toggle-enabled",function(){var b=a(this),d=b.closest("tr"),c=b.find(".woocommerce-input-toggle");
|
1 |
+
(function(a){a("#wooccm_billing_fields").on("click",".wooccm-field-toggle-enabled",function(){var b=a(this),d=b.closest("tr"),c=b.find(".woocommerce-input-toggle");a.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_toggle_field_enabled",nonce:wooccm.nonce,field_id:d.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){c.addClass("woocommerce-input-toggle--loading")},success:function(e){if(true===e.data){c.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");c.addClass("woocommerce-input-toggle--enabled");c.removeClass("woocommerce-input-toggle--loading")}else{if(true!==e.data){c.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");c.addClass("woocommerce-input-toggle--disabled");c.removeClass("woocommerce-input-toggle--loading")}}}});return false})})(jQuery);
|
assets/js/wooccm-modal.js
CHANGED
@@ -1,216 +1,143 @@
|
|
1 |
(function ($) {
|
2 |
|
3 |
-
var
|
4 |
-
|
5 |
};
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
// 'keyup #media-search-input': 'Search',
|
16 |
-
},
|
17 |
-
ui: {
|
18 |
-
nav: undefined,
|
19 |
-
content: undefined,
|
20 |
-
media: undefined
|
21 |
-
},
|
22 |
-
templates: {},
|
23 |
-
initialize: function (e) {
|
24 |
-
'use strict';
|
25 |
-
_.bindAll(this, 'render', 'preserveFocus', 'Close', 'Save');//, 'Select', 'Search', 'Remove'
|
26 |
-
this.initialize_templates();
|
27 |
-
this.render(e);
|
28 |
-
this.backdrop(e);
|
29 |
-
},
|
30 |
-
backdrop: function (e) {
|
31 |
-
'use strict';
|
32 |
-
|
33 |
-
var plugin = this;
|
34 |
-
|
35 |
-
$(document).on('click', '.media-modal-backdrop', function (e) {
|
36 |
-
plugin.Close(e);
|
37 |
-
});
|
38 |
-
},
|
39 |
-
initialize_templates: function () {
|
40 |
-
this.templates.window = wp.template('wpmi-modal-window');
|
41 |
-
this.templates.backdrop = wp.template('wpmi-modal-backdrop');
|
42 |
-
// this.templates.preview = wp.template('wpmi-modal-preview');
|
43 |
-
// this.templates.settings = wp.template('wpmi-modal-settings');
|
44 |
-
},
|
45 |
-
render: function (e) {
|
46 |
-
'use strict';
|
47 |
-
|
48 |
-
this.$el.attr('tabindex', '0')
|
49 |
-
// .data('menu_item_id', menu_item_id)
|
50 |
-
.append(this.templates.window())
|
51 |
-
.append(this.templates.backdrop());
|
52 |
-
|
53 |
-
$(document).on('focusin', this.preserveFocus);
|
54 |
-
$('body').addClass('modal-open').append(this.$el);
|
55 |
-
this.$el.focus();
|
56 |
-
},
|
57 |
-
preserveFocus: function (e) {
|
58 |
-
'use strict';
|
59 |
-
if (this.$el[0] !== e.target && !this.$el.has(e.target).length) {
|
60 |
-
this.$el.focus();
|
61 |
-
}
|
62 |
-
},
|
63 |
-
// Search: function (e) {
|
64 |
-
// 'use strict';
|
65 |
-
// var $this = $(e.target),
|
66 |
-
// $icons = this.$el.find('.attachments .attachment');
|
67 |
-
// $this.on('keyup', function (e) {
|
68 |
-
// e.preventDefault();
|
69 |
-
// setTimeout(function () {
|
70 |
-
// var query = $this.val();
|
71 |
-
// if (query !== '') {
|
72 |
-
// $icons.css({'display': 'none'});
|
73 |
-
// $icons.filter('[class*="' + query + '"]').css({'display': 'block'});
|
74 |
-
// } else {
|
75 |
-
// $icons.removeAttr('style');
|
76 |
-
// }
|
77 |
-
// }, 600);
|
78 |
-
// });
|
79 |
-
// },
|
80 |
-
// Select: function (e) {
|
81 |
-
// 'use strict';
|
82 |
-
// var $this = $(e.target),
|
83 |
-
// $filename = this.$el.find('.media-sidebar .filename'),
|
84 |
-
// $thumbnail = this.$el.find('.media-sidebar .thumbnail > i'),
|
85 |
-
// $input = this.$el.find('input[name="wpmi[icon]"]'),
|
86 |
-
// icon = $this.find('i').attr('class');
|
87 |
-
// $filename.text(icon);
|
88 |
-
// $input.val(icon);
|
89 |
-
// $thumbnail.removeAttr('class').addClass(icon);
|
90 |
-
// },
|
91 |
-
Close: function (e) {
|
92 |
-
'use strict';
|
93 |
-
e.preventDefault();
|
94 |
-
this.undelegateEvents();
|
95 |
-
$(document).off('focusin');
|
96 |
-
$('body').removeClass('modal-open');
|
97 |
-
this.remove();
|
98 |
-
wpmi.__instance = undefined;
|
99 |
-
},
|
100 |
-
Save: function (e) {
|
101 |
-
'use strict';
|
102 |
-
e.preventDefault();
|
103 |
-
|
104 |
-
var plugin = this,
|
105 |
-
$form = $('form', this.$el),
|
106 |
-
menu_item_id = this.$el.data('menu_item_id');
|
107 |
-
|
108 |
-
if (!menu_item_id)
|
109 |
-
return;
|
110 |
-
|
111 |
-
if (!$form.length)
|
112 |
-
return;
|
113 |
-
|
114 |
-
var $li = $('#menu-to-edit').find('#menu-item-' + menu_item_id),
|
115 |
-
$plus = $li.find('.menu-item-wpmi_plus'),
|
116 |
-
$icon = $li.find('.menu-item-wpmi_icon');
|
117 |
-
|
118 |
-
if (!$li.length)
|
119 |
-
return;
|
120 |
-
|
121 |
-
$form.find('.wpmi-input').each(function (i) {
|
122 |
-
|
123 |
-
var key = $(this).prop('id').match(/wpmi-input-([a-z]+)/)[1],
|
124 |
-
value = $(this).val();
|
125 |
-
|
126 |
-
$li.find('input#wpmi-input-' + key).val(value);
|
127 |
-
|
128 |
-
if (key === 'icon') {
|
129 |
-
|
130 |
-
if ($icon.length) {
|
131 |
-
|
132 |
-
$icon.remove();
|
133 |
-
}
|
134 |
-
|
135 |
-
$plus.before('<i class="menu-item-wpmi_icon ' + value + '"></i>');
|
136 |
-
}
|
137 |
-
});
|
138 |
-
|
139 |
-
plugin.Close(e);
|
140 |
-
},
|
141 |
-
Remove: function (e) {
|
142 |
-
'use strict';
|
143 |
-
e.preventDefault();
|
144 |
-
|
145 |
-
var plugin = this,
|
146 |
-
$form = $('form', this.$el),
|
147 |
-
menu_item_id = this.$el.data('menu_item_id');
|
148 |
-
|
149 |
-
if (!menu_item_id)
|
150 |
-
return;
|
151 |
-
|
152 |
-
if (!$form.length)
|
153 |
-
return;
|
154 |
-
|
155 |
-
var $li = $('#menu-to-edit').find('#menu-item-' + menu_item_id),
|
156 |
-
$icon = $li.find('.menu-item-wpmi_icon');
|
157 |
-
|
158 |
-
if (!$li.length)
|
159 |
-
return;
|
160 |
-
|
161 |
-
$form.find('.wpmi-input').each(function (i) {
|
162 |
-
|
163 |
-
var key = $(this).prop('id').match(/wpmi-input-([a-z]+)/)[1];
|
164 |
-
|
165 |
-
$li.find('input#wpmi-input-' + key).val('');
|
166 |
-
|
167 |
-
});
|
168 |
-
|
169 |
-
$icon.remove();
|
170 |
-
|
171 |
-
plugin.Close(e);
|
172 |
-
}
|
173 |
-
});
|
174 |
-
|
175 |
-
$('#wooccm_billing_settings_add').on('click', function (e) {
|
176 |
-
e.preventDefault();
|
177 |
-
alert('test');
|
178 |
-
if (wpmi.__instance === undefined) {
|
179 |
-
wpmi.__instance = new wpmi.Application(e);
|
180 |
}
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
var menu_font = $('input:checked', $(this)).val(),
|
186 |
-
menu_id = $('#menu').val();
|
187 |
-
|
188 |
-
if ($(e.target).hasClass('save') && menu_font && menu_id) {
|
189 |
|
190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
192 |
$.ajax({
|
193 |
-
|
194 |
-
url: ajaxurl,
|
195 |
data: {
|
196 |
-
action: '
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
200 |
},
|
|
|
|
|
201 |
beforeSend: function () {
|
|
|
202 |
},
|
203 |
complete: function () {
|
|
|
204 |
},
|
205 |
error: function () {
|
206 |
alert('Error!');
|
207 |
},
|
208 |
success: function (response) {
|
209 |
-
|
|
|
|
|
|
|
210 |
}
|
211 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
}
|
214 |
});
|
215 |
-
|
216 |
})(jQuery);
|
1 |
(function ($) {
|
2 |
|
3 |
+
var is_blocked = function ($node) {
|
4 |
+
return $node.is('.processing') || $node.parents('.processing').length;
|
5 |
};
|
6 |
+
var block = function ($node) {
|
7 |
+
if (!is_blocked($node)) {
|
8 |
+
$node.addClass('processing').block({
|
9 |
+
message: null,
|
10 |
+
overlayCSS: {
|
11 |
+
background: '#fff',
|
12 |
+
opacity: 0.6
|
13 |
+
}
|
14 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
+
};
|
17 |
+
var unblock = function ($node) {
|
18 |
+
$node.removeClass('processing').unblock();
|
19 |
+
};
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
var wpmi = {
|
22 |
+
__instance: undefined
|
23 |
+
};
|
24 |
+
wpmi.Application = Backbone.View.extend({
|
25 |
+
id: 'wpmi_modal',
|
26 |
+
events: {
|
27 |
+
'click .media-modal-backdrop': 'Close',
|
28 |
+
'click .media-modal-close': 'Close',
|
29 |
+
'click .media-modal-delete': 'Delete',
|
30 |
+
'click .media-modal-save': 'Save',
|
31 |
+
'click .media-modal-prev': 'update',
|
32 |
+
'click .media-modal-next': 'update',
|
33 |
+
},
|
34 |
+
templates: {},
|
35 |
+
initialize: function (e) {
|
36 |
+
'use strict';
|
37 |
+
_.bindAll(this, 'open', 'update', 'render', 'Close', 'Save');
|
38 |
+
this.init();
|
39 |
+
this.open(e);
|
40 |
+
},
|
41 |
+
init: function () {
|
42 |
+
this.templates.window = wp.template('wpmi-modal-window');
|
43 |
+
},
|
44 |
+
render: function (field_id) {
|
45 |
+
'use strict';
|
46 |
+
|
47 |
+
var $modal = this;
|
48 |
|
49 |
$.ajax({
|
50 |
+
url: woocommerce_admin.ajax_url,
|
|
|
51 |
data: {
|
52 |
+
action: 'wooccm_edit_field',
|
53 |
+
nonce: wooccm.nonce,
|
54 |
+
//options_name: $tr.data('options_name'),
|
55 |
+
//options_key: $tr.data('options_key'),
|
56 |
+
field_id: field_id
|
57 |
},
|
58 |
+
dataType: 'json',
|
59 |
+
type: 'POST',
|
60 |
beforeSend: function () {
|
61 |
+
//block($tr);
|
62 |
},
|
63 |
complete: function () {
|
64 |
+
//unblock($tr);
|
65 |
},
|
66 |
error: function () {
|
67 |
alert('Error!');
|
68 |
},
|
69 |
success: function (response) {
|
70 |
+
$modal.$el.attr('tabindex', '0');
|
71 |
+
$modal.$el.html($modal.templates.window(response.data));
|
72 |
+
//$(document).on('focusin', $modal.preserveFocus);
|
73 |
+
$modal.$el.focus().trigger('wc-init-tabbed-panels');
|
74 |
}
|
75 |
});
|
76 |
+
},
|
77 |
+
update: function (e) {
|
78 |
+
'use strict';
|
79 |
+
|
80 |
+
var $button = $(e.target),
|
81 |
+
field_id = $button.data('field_id');
|
82 |
+
|
83 |
+
this.render(field_id);
|
84 |
+
},
|
85 |
+
open: function (e) {
|
86 |
+
'use strict';
|
87 |
|
88 |
+
var $button = $(e.target),
|
89 |
+
$tr = $button.closest('tr'),
|
90 |
+
field_id = $tr.data('field_id');
|
91 |
+
|
92 |
+
this.render(field_id);
|
93 |
+
|
94 |
+
$('body').addClass('modal-open').append(this.$el);
|
95 |
+
|
96 |
+
},
|
97 |
+
/*preserveFocus: function (e) {
|
98 |
+
'use strict';
|
99 |
+
|
100 |
+
if (this.$el[0] !== e.target && !this.$el.has(e.target).length) {
|
101 |
+
this.$el.focus();
|
102 |
+
}
|
103 |
+
},*/
|
104 |
+
Close: function (e) {
|
105 |
+
'use strict';
|
106 |
+
e.preventDefault();
|
107 |
+
this.undelegateEvents();
|
108 |
+
$(document).off('focusin');
|
109 |
+
$('body').removeClass('modal-open');
|
110 |
+
this.remove();
|
111 |
+
wpmi.__instance = undefined;
|
112 |
+
},
|
113 |
+
Save: function (e) {
|
114 |
+
'use strict';
|
115 |
+
e.preventDefault();
|
116 |
+
|
117 |
+
var $modal = this;
|
118 |
+
|
119 |
+
|
120 |
+
$modal.Close(e);
|
121 |
+
},
|
122 |
+
Delete: function (e) {
|
123 |
+
'use strict';
|
124 |
+
e.preventDefault();
|
125 |
+
|
126 |
+
var $modal = this;
|
127 |
+
|
128 |
+
$modal.Close(e);
|
129 |
+
}
|
130 |
+
});
|
131 |
+
$('#wooccm_billing_settings_add').on('click', function (e) {
|
132 |
+
e.preventDefault();
|
133 |
+
if (wpmi.__instance === undefined) {
|
134 |
+
wpmi.__instance = new wpmi.Application(e);
|
135 |
+
}
|
136 |
+
});
|
137 |
+
$('.wooccm_billing_settings_edit').on('click', function (e) {
|
138 |
+
e.preventDefault();
|
139 |
+
if (wpmi.__instance === undefined) {
|
140 |
+
wpmi.__instance = new wpmi.Application(e);
|
141 |
}
|
142 |
});
|
|
|
143 |
})(jQuery);
|
assets/js/wooccm-modal.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(b){var a={__instance:undefined};a.Application=Backbone.View.extend({id:"wpmi_modal",events:{"click .close":"Close","click .
|
1 |
+
(function(c){var d=function(f){return f.is(".processing")||f.parents(".processing").length};var e=function(f){if(!d(f)){f.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var b=function(f){f.removeClass("processing").unblock()};var a={__instance:undefined};a.Application=Backbone.View.extend({id:"wpmi_modal",events:{"click .media-modal-backdrop":"Close","click .media-modal-close":"Close","click .media-modal-delete":"Delete","click .media-modal-save":"Save","click .media-modal-prev":"update","click .media-modal-next":"update",},templates:{},initialize:function(f){_.bindAll(this,"open","update","render","Close","Save");this.init();this.open(f)},init:function(){this.templates.window=wp.template("wpmi-modal-window")},render:function(g){var f=this;c.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_edit_field",nonce:wooccm.nonce,field_id:g},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(h){f.$el.attr("tabindex","0");f.$el.html(f.templates.window(h.data));f.$el.focus().trigger("wc-init-tabbed-panels")}})},update:function(h){var g=c(h.target),f=g.data("field_id");this.render(f)},open:function(i){var h=c(i.target),g=h.closest("tr"),f=g.data("field_id");this.render(f);c("body").addClass("modal-open").append(this.$el)},Close:function(f){f.preventDefault();this.undelegateEvents();c(document).off("focusin");c("body").removeClass("modal-open");this.remove();a.__instance=undefined},Save:function(g){g.preventDefault();var f=this;f.Close(g)},Delete:function(g){g.preventDefault();var f=this;f.Close(g)}});c("#wooccm_billing_settings_add").on("click",function(f){f.preventDefault();if(a.__instance===undefined){a.__instance=new a.Application(f)}});c(".wooccm_billing_settings_edit").on("click",function(f){f.preventDefault();if(a.__instance===undefined){a.__instance=new a.Application(f)}})})(jQuery);
|
new/admin.php
CHANGED
@@ -60,6 +60,34 @@ if (!class_exists('WOOCCM_Admin')) {
|
|
60 |
wp_die();
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
function add_sections($sections = array()) {
|
64 |
|
65 |
global $current_section;
|
@@ -196,6 +224,7 @@ if (!class_exists('WOOCCM_Admin')) {
|
|
196 |
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_section_billing'));
|
197 |
add_action('wp_ajax_wooccm_toggle_field_enabled', array($this, 'ajax_toggle_field_enabled'));
|
198 |
add_action('wp_ajax_wooccm_add_field', array($this, 'ajax_add_field'));
|
|
|
199 |
}
|
200 |
|
201 |
public static function instance() {
|
60 |
wp_die();
|
61 |
}
|
62 |
|
63 |
+
function ajax_edit_field() {
|
64 |
+
|
65 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_admin', 'nonce')) {
|
66 |
+
|
67 |
+
if ($options = get_option('wccs_settings3')) {
|
68 |
+
|
69 |
+
if (array_key_exists('billing_buttons', $options)) {
|
70 |
+
|
71 |
+
$field_id = isset($_REQUEST['field_id']) ? absint($_REQUEST['field_id']) : 0;
|
72 |
+
|
73 |
+
if (isset($options['billing_buttons'][$field_id])) {
|
74 |
+
|
75 |
+
$options['billing_buttons'][$field_id]['id'] = $field_id;
|
76 |
+
$options['billing_buttons'][$field_id]['prev_id'] = $field_id - 1;
|
77 |
+
$options['billing_buttons'][$field_id]['next_id'] = min($field_id + 1, count($options['billing_buttons']) - 1);
|
78 |
+
|
79 |
+
wp_send_json_success($options['billing_buttons'][$field_id]);
|
80 |
+
}
|
81 |
+
|
82 |
+
wp_send_json_error(esc_html__('Undefined field id', 'woocommerce-checkout-managerS'));
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-managerS'));
|
88 |
+
wp_die();
|
89 |
+
}
|
90 |
+
|
91 |
function add_sections($sections = array()) {
|
92 |
|
93 |
global $current_section;
|
224 |
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_section_billing'));
|
225 |
add_action('wp_ajax_wooccm_toggle_field_enabled', array($this, 'ajax_toggle_field_enabled'));
|
226 |
add_action('wp_ajax_wooccm_add_field', array($this, 'ajax_add_field'));
|
227 |
+
add_action('wp_ajax_wooccm_edit_field', array($this, 'ajax_edit_field'));
|
228 |
}
|
229 |
|
230 |
public static function instance() {
|
new/admin/pages/billing.php
CHANGED
@@ -17,17 +17,16 @@
|
|
17 |
<table id="wooccm_billing_fields" class="wc_gateways widefat" cellspacing="0" aria-describedby="wooccm_billing_settings-description">
|
18 |
<thead>
|
19 |
<tr>
|
20 |
-
<th class="sort"></th>
|
21 |
-
<th class="status"><?php esc_html_e('Enabled', 'woocommerce-checkout-manager'); ?></th>
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
23 |
<th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
|
24 |
-
<th class="
|
25 |
-
<th class="required"><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></th>
|
26 |
-
<th class="position"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></th>
|
27 |
-
<th class="clear"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></th>
|
28 |
-
<th class="type"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
|
29 |
-
<th class="action"></th>
|
30 |
-
<th class="delete"></th>
|
31 |
</tr>
|
32 |
</thead>
|
33 |
<tbody class="ui-sortable">
|
@@ -42,15 +41,15 @@
|
|
42 |
|
43 |
foreach ($custom_fields as $id => $custom_field) {
|
44 |
?>
|
45 |
-
<tr data-field_id="<?php echo esc_attr($id); ?>"
|
46 |
-
<td class="sort ui-sortable-handle"
|
47 |
<div class="wc-item-reorder-nav">
|
48 |
<button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), @$custom_field['label'])); ?>"><?php esc_html_e('Move up', 'woocommerce-checkout-manager'); ?></button>
|
49 |
<button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), @$custom_field['label'])); ?>"><?php esc_html_e('Move down', 'woocommerce-checkout-manager'); ?></button>
|
50 |
<input type="hidden" name="gateway_order[]" value="<?php echo esc_attr(@$custom_field['order']); ?>">
|
51 |
</div>
|
52 |
</td>
|
53 |
-
<td class="status"
|
54 |
<a class="wooccm-field-toggle-enabled" href="#">
|
55 |
<?php
|
56 |
if (empty($custom_field['disabled'])) {
|
@@ -63,33 +62,40 @@
|
|
63 |
?>
|
64 |
</a>
|
65 |
</td>
|
66 |
-
|
67 |
-
<strong><?php echo esc_html(@$custom_field['label']); ?></strong>
|
68 |
-
</td>
|
69 |
-
<td class="placeholder" width="" style="max-width: 152px;">
|
70 |
-
<?php echo esc_html(@$custom_field['placeholder']); ?>
|
71 |
-
</td>
|
72 |
-
<td class="order">
|
73 |
-
<strong><?php echo esc_html(@$custom_field['order']); ?></strong>
|
74 |
-
</td>
|
75 |
<td class="required">
|
76 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
</td>
|
78 |
<td class="position">
|
79 |
<?php echo esc_html(@$custom_field['position']); ?>
|
80 |
</td>
|
81 |
<td class="clear">
|
82 |
-
<?php
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
84 |
</td>
|
85 |
-
<td class="
|
86 |
-
|
87 |
</td>
|
88 |
-
<td class="
|
89 |
-
|
90 |
</td>
|
91 |
-
<td class="
|
92 |
-
<a class="" aria-label="
|
|
|
93 |
</td>
|
94 |
</tr>
|
95 |
<?php
|
@@ -100,359 +106,491 @@
|
|
100 |
?>
|
101 |
</tbody>
|
102 |
</table>
|
103 |
-
|
104 |
</tr>
|
105 |
</tbody>
|
106 |
</table>
|
107 |
<script type="text/html" id='tmpl-wpmi-modal-backdrop'>
|
108 |
-
<div class="media-modal-backdrop"> </div>
|
109 |
</script>
|
110 |
<script type="text/html" id='tmpl-wpmi-modal-window'>
|
111 |
-
<div
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
</span>
|
116 |
-
</button>
|
117 |
-
<div class="media-frame mode-select wp-core-ui hide-menu">
|
118 |
-
<!--<div class="edit-attachment-frame mode-select hide-menu hide-router">
|
119 |
<div class="edit-media-header">
|
120 |
-
<button class="left dashicons"><span class="screen-reader-text">Edit previous media item</span></button>
|
121 |
-
<button class="right dashicons"><span class="screen-reader-text">Edit next media item</span></button>
|
122 |
-
<button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text">Close dialog</span></span
|
|
|
123 |
</div>
|
124 |
-
|
125 |
-
|
126 |
-
<h1><?php esc_html_e(WOOCCM_PLUGIN_NAME); ?>
|
127 |
-
<span class="dashicons dashicons-arrow-down"></span>
|
128 |
-
</h1>
|
129 |
-
</div>
|
130 |
-
<div class="media-frame-router">
|
131 |
-
<div class="media-router">
|
132 |
-
<a href="#" class="media-menu-item" >General</a>
|
133 |
-
<a href="#" class="media-menu-item active">Display</a>
|
134 |
-
<a href="#" class="media-menu-item">Conditional</a>
|
135 |
</div>
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
<
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
<
|
154 |
-
<
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
</select>
|
161 |
-
<
|
162 |
-
</
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
<
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
<
|
180 |
-
|
181 |
-
<input type="text" name="wccs_settings3[billing_buttons][
|
182 |
-
<
|
183 |
-
</
|
184 |
-
</
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
<select name="wccs_settings3[billing_buttons][0][type]" title="Type of the Checkout field" readonly="readonly" style="pointer-events:none;"> <!--Call run() function-->
|
208 |
-
<option value="wooccmtext">Text Input</option>
|
209 |
-
<option value="wooccmtextarea">Textarea</option>
|
210 |
-
<option value="wooccmpassword">Password</option>
|
211 |
-
<option value="wooccmradio">Radio Buttons</option>
|
212 |
-
<option value="checkbox_wccm">Check Box</option>
|
213 |
-
<option value="wooccmselect">Select Options</option>
|
214 |
-
<option value="datepicker">Date Picker</option>
|
215 |
-
<option value="time">Time Picker</option>
|
216 |
-
<option value="colorpicker">Color Picker</option>
|
217 |
-
<option value="heading">Heading</option>
|
218 |
-
<option value="multiselect">Multi-Select</option>
|
219 |
-
<option value="multicheckbox">Multi-Checkbox</option>
|
220 |
-
<option selected="selected" value="wooccmcountry">Country</option>
|
221 |
-
<option value="wooccmstate">State</option>
|
222 |
-
<option value="wooccmupload">File Picker</option>
|
223 |
</select>
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
<
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
<input type="
|
242 |
-
</
|
243 |
-
</
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
<input name="wccs_settings3[billing_buttons][
|
251 |
-
</
|
252 |
-
|
253 |
-
|
254 |
-
<input name="wccs_settings3[billing_buttons][
|
255 |
-
</
|
256 |
-
|
257 |
-
|
258 |
-
<input name="wccs_settings3[billing_buttons][
|
259 |
-
</
|
260 |
-
|
261 |
-
|
262 |
-
<input name="wccs_settings3[billing_buttons][
|
263 |
-
</
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
</
|
293 |
-
|
294 |
-
|
295 |
-
<input type="
|
296 |
-
</
|
297 |
-
|
298 |
-
|
299 |
-
<input type="
|
300 |
-
</
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
<td class="more_toggler1c">
|
311 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_p]" placeholder="Product ID(s) e.g 1674||1233" value="">
|
312 |
-
</td>
|
313 |
-
<td class="more_toggler1c">
|
314 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_px]" placeholder="Product ID(s) e.g 1674||1233" value="">
|
315 |
-
</td>
|
316 |
-
<td class="more_toggler1c">
|
317 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_p_cat]" placeholder="Category Slug(s) e.g my-cat||my-cat2" value="">
|
318 |
-
</td>
|
319 |
-
|
320 |
-
<td class="more_toggler1c">
|
321 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_px_cat]" placeholder="Category Slug(s) e.g my-cat||my-cat2" value="">
|
322 |
-
</td>
|
323 |
-
|
324 |
-
<td class="hide_stuff_time">
|
325 |
-
<input type="text" placeholder="6" name="wccs_settings3[billing_buttons][0][start_hour]" value="">
|
326 |
-
</td>
|
327 |
-
|
328 |
-
<td class="hide_stuff_time">
|
329 |
-
<input type="text" placeholder="9" name="wccs_settings3[billing_buttons][0][end_hour]" value="">
|
330 |
-
</td>
|
331 |
-
|
332 |
-
<td class="hide_stuff_time">
|
333 |
-
<input type="text" placeholder="15" name="wccs_settings3[billing_buttons][0][interval_min]" value="">
|
334 |
-
</td>
|
335 |
-
|
336 |
-
<td class="hide_stuff_time">
|
337 |
-
<input type="text" placeholder="0, 10, 20, 30, 40" name="wccs_settings3[billing_buttons][0][manual_min]" value="">
|
338 |
-
</td>
|
339 |
-
|
340 |
-
<td class="hide_stuff_color hide_stuff_days">
|
341 |
-
<input type="text" placeholder="dd-mm-yy" name="wccs_settings3[billing_buttons][0][format_date]" value="">
|
342 |
-
</td>
|
343 |
-
|
344 |
-
<td class="hide_stuff_color hide_stuff_days">
|
345 |
-
<input type="text" placeholder="+3" name="wccs_settings3[billing_buttons][0][min_before]" value="">
|
346 |
-
</td>
|
347 |
-
|
348 |
-
<td class="hide_stuff_color hide_stuff_days">
|
349 |
-
<input type="text" placeholder="3" name="wccs_settings3[billing_buttons][0][max_after]" value="">
|
350 |
-
</td>
|
351 |
-
|
352 |
-
<td class="hide_stuff_color daoo">
|
353 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler]" type="checkbox" value="true">
|
354 |
-
</td>
|
355 |
-
|
356 |
-
<td class="hide_stuff_days">
|
357 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler0]" type="checkbox" value="1">
|
358 |
-
</td>
|
359 |
-
|
360 |
-
<td class="hide_stuff_days">
|
361 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler1]" type="checkbox" value="1">
|
362 |
-
</td>
|
363 |
-
|
364 |
-
<td class="hide_stuff_days">
|
365 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler2]" type="checkbox" value="1">
|
366 |
-
</td>
|
367 |
-
|
368 |
-
<td class="hide_stuff_days">
|
369 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler3]" type="checkbox" value="1">
|
370 |
-
</td>
|
371 |
-
|
372 |
-
<td class="hide_stuff_days">
|
373 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler4]" type="checkbox" value="1">
|
374 |
-
</td>
|
375 |
-
|
376 |
-
<td class="hide_stuff_days">
|
377 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler5]" type="checkbox" value="1">
|
378 |
-
</td>
|
379 |
-
|
380 |
-
<td class="hide_stuff_days">
|
381 |
-
<input name="wccs_settings3[billing_buttons][0][days_disabler6]" type="checkbox" value="1">
|
382 |
-
</td>
|
383 |
-
|
384 |
-
<td class="hide_stuff_color hide_stuff_days">
|
385 |
-
<span class="spongagge">Min Date</span>
|
386 |
-
</td>
|
387 |
-
|
388 |
-
<td class="hide_stuff_color hide_stuff_days">
|
389 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_yy]" placeholder="2013" title="yy" value="">
|
390 |
-
</td>
|
391 |
-
|
392 |
-
<td class="hide_stuff_color hide_stuff_days">
|
393 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_mm]" placeholder="10" title="mm" value="">
|
394 |
-
</td>
|
395 |
-
|
396 |
-
<td class="hide_stuff_color hide_stuff_days">
|
397 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_dd]" placeholder="25" title="dd" value="">
|
398 |
-
</td>
|
399 |
-
|
400 |
-
<td class="hide_stuff_color hide_stuff_days">
|
401 |
-
<span class="spongagge">Max Date</span>
|
402 |
-
</td>
|
403 |
-
|
404 |
-
<td class="hide_stuff_color hide_stuff_days">
|
405 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_max_yy]" placeholder="2013" title="yy" value="">
|
406 |
-
</td>
|
407 |
-
|
408 |
-
<td class="hide_stuff_color hide_stuff_days">
|
409 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_max_mm]" placeholder="10" title="mm" value="">
|
410 |
-
</td>
|
411 |
-
|
412 |
-
<td class="hide_stuff_color hide_stuff_days">
|
413 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][single_max_dd]" placeholder="25" title="dd" value="">
|
414 |
-
</td>
|
415 |
-
|
416 |
-
<td class="more_toggler1" style="text-align:center;">
|
417 |
-
<input name="wccs_settings3[billing_buttons][0][checkbox]" type="checkbox" title="Whether or not the Checkout field is required" value="true" checked="checked">
|
418 |
-
</td>
|
419 |
-
|
420 |
-
<td class="filter_field">
|
421 |
-
<input type="text" name="wccs_settings3[billing_buttons][0][colorpickerd]" id="billing-colorpic0" placeholder="#000000" value="">
|
422 |
-
</td>
|
423 |
-
|
424 |
-
<td class="filter_field">
|
425 |
-
<select name="wccs_settings3[billing_buttons][0][colorpickertype]">
|
426 |
-
<option value="farbtastic" selected="selected">Farbtastic</option>
|
427 |
-
<option value="iris">Iris</option>
|
428 |
</select>
|
429 |
-
</
|
430 |
-
|
431 |
-
|
432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
|
|
|
|
441 |
</div>
|
442 |
-
<div class="media-sidebar">
|
443 |
-
<div tabindex="0" class="attachment-details save-ready">
|
444 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
</div>
|
446 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
</div>
|
448 |
</div>
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
|
|
456 |
</div>
|
457 |
</div>
|
458 |
</div>
|
17 |
<table id="wooccm_billing_fields" class="wc_gateways widefat" cellspacing="0" aria-describedby="wooccm_billing_settings-description">
|
18 |
<thead>
|
19 |
<tr>
|
20 |
+
<th class="sort" style="width:1%"></th>
|
21 |
+
<th class="status" style="width:1%"><?php esc_html_e('Enabled', 'woocommerce-checkout-manager'); ?></th>
|
22 |
+
<!--<th class="order"><?php esc_html_e('Order', 'woocommerce-checkout-manager'); ?></th>-->
|
23 |
+
<th class="required" style="width:1%"><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></th>
|
24 |
+
<th class="type" style="width:1%"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
|
25 |
+
<th class="position" style="width:1%;min-width: 100px;"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></th>
|
26 |
+
<th class="clear" style="width:1%"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></th>
|
27 |
+
<th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
|
28 |
<th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
|
29 |
+
<th class="actions"></th>
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
</tr>
|
31 |
</thead>
|
32 |
<tbody class="ui-sortable">
|
41 |
|
42 |
foreach ($custom_fields as $id => $custom_field) {
|
43 |
?>
|
44 |
+
<tr data-options_name="wccs_settings3" data-options_key="billing_buttons" data-field_id="<?php echo esc_attr($id); ?>">
|
45 |
+
<td class="sort ui-sortable-handle">
|
46 |
<div class="wc-item-reorder-nav">
|
47 |
<button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), @$custom_field['label'])); ?>"><?php esc_html_e('Move up', 'woocommerce-checkout-manager'); ?></button>
|
48 |
<button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), @$custom_field['label'])); ?>"><?php esc_html_e('Move down', 'woocommerce-checkout-manager'); ?></button>
|
49 |
<input type="hidden" name="gateway_order[]" value="<?php echo esc_attr(@$custom_field['order']); ?>">
|
50 |
</div>
|
51 |
</td>
|
52 |
+
<td class="status">
|
53 |
<a class="wooccm-field-toggle-enabled" href="#">
|
54 |
<?php
|
55 |
if (empty($custom_field['disabled'])) {
|
62 |
?>
|
63 |
</a>
|
64 |
</td>
|
65 |
+
<!--<td class="order"><strong><?php echo esc_html(@$custom_field['order']); ?></strong>-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
<td class="required">
|
67 |
+
<?php
|
68 |
+
if (!empty($custom_field['checkbox'])) {
|
69 |
+
?>
|
70 |
+
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
71 |
+
<?php } else { ?>
|
72 |
+
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
73 |
+
<?php } ?>
|
74 |
+
</td>
|
75 |
+
<td class="type">
|
76 |
+
<?php echo esc_html(@$custom_field['type']); ?>
|
77 |
</td>
|
78 |
<td class="position">
|
79 |
<?php echo esc_html(@$custom_field['position']); ?>
|
80 |
</td>
|
81 |
<td class="clear">
|
82 |
+
<?php
|
83 |
+
if (!empty($custom_field['clear_row'])) {
|
84 |
+
?>
|
85 |
+
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
86 |
+
<?php } else { ?>
|
87 |
+
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
88 |
+
<?php } ?>
|
89 |
</td>
|
90 |
+
<td class="label">
|
91 |
+
<strong><?php echo esc_html(@$custom_field['label']); ?></strong>
|
92 |
</td>
|
93 |
+
<td class="placeholder">
|
94 |
+
<?php echo esc_html(@$custom_field['placeholder']); ?>
|
95 |
</td>
|
96 |
+
<td class="action">
|
97 |
+
<a class="wooccm_billing_settings_edit button" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
|
98 |
+
<a class="wooccm_billing_settings_delete" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
|
99 |
</td>
|
100 |
</tr>
|
101 |
<?php
|
106 |
?>
|
107 |
</tbody>
|
108 |
</table>
|
109 |
+
|
110 |
</tr>
|
111 |
</tbody>
|
112 |
</table>
|
113 |
<script type="text/html" id='tmpl-wpmi-modal-backdrop'>
|
|
|
114 |
</script>
|
115 |
<script type="text/html" id='tmpl-wpmi-modal-window'>
|
116 |
+
<div class="media-modal-backdrop"> </div>
|
117 |
+
<div tabindex="0" id="<?php echo esc_attr(WOOCCM_PREFIX . '_modal'); ?>" class="media-modal wp-core-ui upload-php" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
|
118 |
+
<div class="media-modal-content" role="document">
|
119 |
+
<div class="edit-attachment-frame mode-select hide-menu hide-router">
|
|
|
|
|
|
|
|
|
120 |
<div class="edit-media-header">
|
121 |
+
<button data-field_id="{{ data.prev_id}}" class="media-modal-prev left dashicons <# if ( data.prev_id < 0 ) { #>disabled<# } #>"><span class="screen-reader-text">Edit previous media item</span></button>
|
122 |
+
<button data-field_id="{{ data.next_id}}" class="media-modal-next right dashicons <# if ( data.next_id == data.id ) { #>disabled<# } #>"><span class="screen-reader-text">Edit next media item</span></button>
|
123 |
+
<button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text">Close dialog</span></span>
|
124 |
+
</button>
|
125 |
</div>
|
126 |
+
<div class="media-frame-title">
|
127 |
+
<h1>Edit field #{{ data.id }}</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
</div>
|
129 |
+
<div class="media-frame-content" style="bottom:61px;">
|
130 |
+
|
131 |
+
<div class="attachment-details save-ready">
|
132 |
+
<div class="attachment-media-view landscape">
|
133 |
+
|
134 |
+
<div id="woocommerce-product-data">
|
135 |
+
<div class="panel-wrap product_data">
|
136 |
+
<ul class="product_data_tabs wc-tabs">
|
137 |
+
<li class="general_options active">
|
138 |
+
<a href="#general_product_data"><span><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></span></a>
|
139 |
+
</li>
|
140 |
+
<li class="inventory_options">
|
141 |
+
<a href="#inventory_product_data"><span><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></span></a>
|
142 |
+
</li>
|
143 |
+
<li class="shipping_options">
|
144 |
+
<a href="#shipping_product_data"><span><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></span></a>
|
145 |
+
</li>
|
146 |
+
<li class="linked_product_options">
|
147 |
+
<a href="#linked_product_data"><span><?php esc_html_e('Amount', 'woocommerce-checkout-manager'); ?></span></a>
|
148 |
+
</li>
|
149 |
+
<li class="attribute_options">
|
150 |
+
<a href="#product_attributes"><span><?php esc_html_e('Taxes', 'woocommerce-checkout-manager'); ?></span></a>
|
151 |
+
</li>
|
152 |
+
<li class="variations_options">
|
153 |
+
<a href="#variable_product_options"><span><?php esc_html_e('Display', 'woocommerce-checkout-manager'); ?></span></a>
|
154 |
+
</li>
|
155 |
+
<li class="advanced_options">
|
156 |
+
<a href="#advanced_product_data"><span><?php esc_html_e('Timing', 'woocommerce-checkout-manager'); ?></span></a>
|
157 |
+
</li>
|
158 |
+
<li class="marketplace-suggestions_options">
|
159 |
+
<a href="#marketplace_suggestions"><span><?php esc_html_e('Advanced', 'woocommerce-checkout-manager'); ?></span></a>
|
160 |
+
</li>
|
161 |
+
</ul>
|
162 |
+
|
163 |
+
<div id="general_product_data" class="panel woocommerce_options_panel" style="display: none;">
|
164 |
+
<div class="options_group">
|
165 |
+
<!--<p>
|
166 |
+
<td class="billing-wccs-order-hidden">
|
167 |
+
<input type="hidden" name="wccs_settings3[billing_buttons][{{data.id}}][order]" value="{{data.order}}">
|
168 |
+
</p>-->
|
169 |
+
<!--<p>
|
170 |
+
<label><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></label>
|
171 |
+
<input name="wccs_settings3[billing_buttons][{{data.id}}][disabled]" type="checkbox" value="{{data.disabled}}">
|
172 |
+
</p>-->
|
173 |
+
<!--<p>
|
174 |
+
<label><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></label>
|
175 |
+
<input name="wccs_settings3[billing_buttons][{{data.id}}][checkbox]" type="checkbox" title="Whether or not the checkout field is required" value="{{data.checkbox}}" checked="checked">
|
176 |
+
</p>-->
|
177 |
+
<p class="form-field">
|
178 |
+
<label><?php esc_html_e('Name', 'woocommerce-checkout-manager'); ?></label>
|
179 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][cow]" placeholder="<?php esc_html_e('MyField', 'woocommerce-checkout-managert'); ?>" value="{{data.cow}}" readonly="readonly">
|
180 |
+
<span class="description"><?php esc_html_e('To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-managert'); ?></span>
|
181 |
+
</p>
|
182 |
+
</div>
|
183 |
+
<div class="options_group">
|
184 |
+
<p class="form-field">
|
185 |
+
<label><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></label>
|
186 |
+
<select class="select short" name="wccs_settings3[billing_buttons][{{data.id}}][position]">
|
187 |
+
<option <# if ( data.position == 'form-row-wide' ) { #>selected<# } #> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-managert'); ?></option>
|
188 |
+
<option <# if ( data.position == 'form-row-first' ) { #>selected<# } #> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-managert'); ?></option>
|
189 |
+
<option <# if ( data.position == 'form-row-last' ) { #>selected<# } #> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-managert'); ?></option>
|
190 |
</select>
|
191 |
+
<span class="description"><?php esc_html_e('Placement of the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
192 |
+
</p>
|
193 |
+
<p class="form-field">
|
194 |
+
<label><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></label>
|
195 |
+
<input <# if ( data.clear_row == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][clear_row]" value="true">
|
196 |
+
<span class="description"><?php esc_html_e('Applies a clear fix to the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
197 |
+
</p>
|
198 |
+
<p class="form-field">
|
199 |
+
<label><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></label>
|
200 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][extra_class]" value="{{data.extra_class}}">
|
201 |
+
</p>
|
202 |
+
</div>
|
203 |
+
<div class="options_group">
|
204 |
+
<p class="form-field">
|
205 |
+
<label><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></label>
|
206 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][label]" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-managert'); ?>" value="{{data.label}}">
|
207 |
+
<span class="description"><?php esc_html_e('Placeholder text for the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
208 |
+
</p>
|
209 |
+
<p class="form-field">
|
210 |
+
<label><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></label>
|
211 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][placeholder]" title="" placeholder="<?php esc_html_e('Example red', 'woocommerce-checkout-managert'); ?>" value="{{data.placeholder}}">
|
212 |
+
<span class="description"><?php esc_html_e('Placeholder text for the checkout field.', 'woocommerce-checkout-managert'); ?></span>
|
213 |
+
</p>
|
214 |
+
</div>
|
215 |
+
</div>
|
216 |
+
<div id="inventory_product_data" class="panel woocommerce_options_panel hidden" style="display: none;">
|
217 |
+
|
218 |
+
<div class="options_group">
|
219 |
+
<p class="form-field">
|
220 |
+
<label><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></label>
|
221 |
+
<select class="select short" name="wccs_settings3[billing_buttons][{{data.id}}][type]">
|
222 |
+
<option <# if ( data.type == 'wooccmtext' ) { #>selected<# } #> value="wooccmtext">Text Input</option>
|
223 |
+
<option <# if ( data.type == 'wooccmtextarea' ) { #>selected<# } #> value="wooccmtextarea">Textarea</option>
|
224 |
+
<option <# if ( data.type == 'wooccmpassword' ) { #>selected<# } #> value="wooccmpassword">Password</option>
|
225 |
+
<option <# if ( data.type == 'wooccmradio' ) { #>selected<# } #> value="wooccmradio">Radio Buttons</option>
|
226 |
+
<option <# if ( data.type == 'checkbox_wccm' ) { #>selected<# } #> value="checkbox_wccm">Check Box</option>
|
227 |
+
<option <# if ( data.type == 'wooccmselect' ) { #>selected<# } #> value="wooccmselect">Select Options</option>
|
228 |
+
<option <# if ( data.type == 'datepicker' ) { #>selected<# } #> value="datepicker">Date Picker</option>
|
229 |
+
<option <# if ( data.type == 'time' ) { #>selected<# } #> value="time">Time Picker</option>
|
230 |
+
<option <# if ( data.type == 'colorpicker' ) { #>selected<# } #> value="colorpicker">Color Picker</option>
|
231 |
+
<option <# if ( data.type == 'heading' ) { #>selected<# } #> value="heading">Heading</option>
|
232 |
+
<option <# if ( data.type == 'multiselect' ) { #>selected<# } #> value="multiselect">Multi-Select</option>
|
233 |
+
<option <# if ( data.type == 'multicheckbox' ) { #>selected<# } #> value="multicheckbox">Multi-Checkbox</option>
|
234 |
+
<option <# if ( data.type == 'wooccmcountry' ) { #>selected<# } #> value="wooccmcountry">Country</option>
|
235 |
+
<option <# if ( data.type == 'wooccmstate' ) { #>selected<# } #> value="wooccmstate">State</option>
|
236 |
+
<option <# if ( data.type == 'wooccmupload' ) { #>selected<# } #> value="wooccmupload">File Picker</option>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
</select>
|
238 |
+
<span class="description"><?php esc_html_e('Type of the checkout field', 'woocommerce-checkout-managert'); ?></span>
|
239 |
+
</p>
|
240 |
+
</div>
|
241 |
+
<div class="options_group">
|
242 |
+
<!--
|
243 |
+
1326
|
244 |
+
<p class="form-field">
|
245 |
+
<label><?php esc_html_e('Adapt', 'woocommerce-checkout-manager'); ?></label>
|
246 |
+
<input <# if ( data.fancy == 'country_select' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][fancy]" value="country_select">
|
247 |
+
</p>
|
248 |
+
-->
|
249 |
+
<p class="form-field">
|
250 |
+
<label><?php esc_html_e('Title', 'woocommerce-checkout-manager'); ?></label>
|
251 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][force_title2]" placeholder="<?php esc_html_e('Name Guide', 'woocommerce-checkout-manager'); ?>" value="{{data.force_title2}}">
|
252 |
+
</p>
|
253 |
+
<p class="form-field">
|
254 |
+
<label><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></label>
|
255 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][option_array]" placeholder="Option 1||Option 2||Option 3" value="{{data.option_array}}">
|
256 |
+
</p>
|
257 |
+
</div>
|
258 |
+
</div>
|
259 |
+
|
260 |
+
<div id="shipping_product_data" class="panel woocommerce_options_panel hidden" style="display: none;">
|
261 |
+
<div class="options_group">
|
262 |
+
<p class="form-field">
|
263 |
+
<label><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></label>
|
264 |
+
<input <# if ( data.conditional_parent_use == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][conditional_parent_use]" value="true">
|
265 |
+
</p>
|
266 |
+
<p class="form-field">
|
267 |
+
<label><?php esc_html_e('Conditional Parent', 'woocommerce-checkout-manager'); ?></label>
|
268 |
+
<input <# if ( data.conditional_parent == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][conditional_parent]" value="true">
|
269 |
+
</p>
|
270 |
+
<p class="form-field">
|
271 |
+
<label><?php esc_html_e('Conditional Tie', 'woocommerce-checkout-manager'); ?></label>
|
272 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][conditional_tie]" placeholder="<?php esc_html_e('Parent Abbr. Name', 'woocommerce-checkout-manager'); ?>" value="{{data.conditional_tie}}">
|
273 |
+
</p>
|
274 |
+
<p class="form-field">
|
275 |
+
<label><?php esc_html_e('Chosen Value', 'woocommerce-checkout-manager'); ?></label>
|
276 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][chosen_valt]" placeholder="Yes" value="{{data.chosen_valt}}">
|
277 |
+
</p>
|
278 |
+
</div>
|
279 |
+
</div>
|
280 |
+
|
281 |
+
<div id="linked_product_data" class="panel woocommerce_options_panel hidden" style="display: none;">
|
282 |
+
|
283 |
+
<div class="options_group">
|
284 |
+
<p class="form-field">
|
285 |
+
<label><?php esc_html_e('Add Amount', 'woocommerce-checkout-manager'); ?></label>
|
286 |
+
<input <# if ( data.add_amount == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][add_amount]" value="true">
|
287 |
+
</p>
|
288 |
+
<p class="form-field">
|
289 |
+
<label><?php esc_html_e('Amount Name', 'woocommerce-checkout-manager'); ?></label>
|
290 |
+
<input class="short" name="wccs_settings3[billing_buttons][{{data.id}}][fee_name]" type="text" value="{{data.fee_name}}" placeholder="<?php esc_html_e('My Custom Charge', 'woocommerce-checkout-manager'); ?>">
|
291 |
+
</p>
|
292 |
+
<p class="form-field">
|
293 |
+
<label><?php esc_html_e('Amount Total', 'woocommerce-checkout-manager'); ?></label>
|
294 |
+
<input class="short" name="wccs_settings3[billing_buttons][{{data.id}}][add_amount_field]" type="text" value="{{data.add_amount_field}}" placeholder="50">
|
295 |
+
</p>
|
296 |
+
</div>
|
297 |
+
|
298 |
+
</div>
|
299 |
+
|
300 |
+
<div id="product_attributes" class="panel woocommerce_options_panel hidden" style="display: none;">
|
301 |
+
<div class="options_group">
|
302 |
+
<p class="form-field">
|
303 |
+
<label><?php esc_html_e('Deny Checkout', 'woocommerce-checkout-manager'); ?></label>
|
304 |
+
<input <# if ( data.deny_checkout == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][deny_checkout]" value="true">
|
305 |
+
<span class="description"><?php esc_html_e('1326.', 'woocommerce-checkout-managert'); ?></span>
|
306 |
+
</p>
|
307 |
+
<p class="form-field">
|
308 |
+
<label><?php esc_html_e('Tax Remove', 'woocommerce-checkout-manager'); ?></label>
|
309 |
+
<input <# if ( data.tax_remove == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][tax_remove]" value="true">
|
310 |
+
</p>
|
311 |
+
<p class="form-field">
|
312 |
+
<label><?php esc_html_e('Deny Receipt', 'woocommerce-checkout-manager'); ?></label>
|
313 |
+
<input <# if ( data.deny_receipt == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][deny_receipt]" value="true">
|
314 |
+
</p>
|
315 |
+
<p class="form-field">
|
316 |
+
<label><?php esc_html_e('Default Color', 'woocommerce-checkout-manager'); ?></label>
|
317 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][colorpickerd]" id="billing-colorpic0" placeholder="#000000" value="{{data.colorpickerd}}">
|
318 |
+
</p>
|
319 |
+
<p class="form-field">
|
320 |
+
<label><?php esc_html_e('Picker Type', 'woocommerce-checkout-manager'); ?></label>
|
321 |
+
<select class="select short" name="wccs_settings3[billing_buttons][{{data.id}}][colorpickertype]">
|
322 |
+
<option <# if ( data.colorpickertype == 'farbtastic' ) { #>selected<# } #> value="farbtastic" >Farbtastic</option>
|
323 |
+
<option <# if ( data.colorpickertype == 'iris' ) { #>selected<# } #> value="iris">Iris</option>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
</select>
|
325 |
+
</p>
|
326 |
+
</div>
|
327 |
+
</div>
|
328 |
+
|
329 |
+
<div id="variable_product_options" class="panel woocommerce_options_panel hidden" style="display: none;">
|
330 |
+
|
331 |
+
<div class="options_group">
|
332 |
+
<p class="form-field">
|
333 |
+
<label><?php esc_html_e('User Role', 'woocommerce-checkout-manager'); ?></label>
|
334 |
+
<input <# if ( data.user_role == 'user_role' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][user_role]" value="user_role">
|
335 |
+
</p>
|
336 |
+
<p class="form-field">
|
337 |
+
<label><?php esc_html_e('Show for Roles', 'woocommerce-checkout-manager'); ?></label>
|
338 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][role_options]" placeholder="Option 1||Option 2||Option 3" value="{{data.role_options}}">
|
339 |
+
</p>
|
340 |
+
<p class="form-field">
|
341 |
+
<label><?php esc_html_e('Hide for Roles', 'woocommerce-checkout-manager'); ?></label>
|
342 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][role_options2]" placeholder="Option 1||Option 2||Option 3" value="{{data.role_options2}}">
|
343 |
+
</p>
|
344 |
+
</div>
|
345 |
+
|
346 |
+
<div class="options_group">
|
347 |
+
<p class="form-field">
|
348 |
+
<label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
|
349 |
+
<input <# if ( data.more_content == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][more_content]" value="1">
|
350 |
+
</p>
|
351 |
+
<p class="form-field">
|
352 |
+
<label><?php esc_html_e('Hide Field from Product', 'woocommerce-checkout-manager'); ?></label>
|
353 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_p]" placeholder="Product ID(s) e.g 1674||1233" value="{{data.single_p}}">
|
354 |
+
</p>
|
355 |
+
<p class="form-field">
|
356 |
+
<label><?php esc_html_e('Show Field for Product', 'woocommerce-checkout-manager'); ?></label>
|
357 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_px]" placeholder="Product ID(s) e.g 1674||1233" value="{{data.single_px}}">
|
358 |
+
</p>
|
359 |
+
<p class="form-field">
|
360 |
+
<label><?php esc_html_e('Hide Field from Category', 'woocommerce-checkout-manager'); ?></label>
|
361 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_p_cat]" placeholder="Category Slug(s) e.g my-cat||my-cat2" value="{{data.single_p_cat}}">
|
362 |
+
</p>
|
363 |
+
<p class="form-field">
|
364 |
+
<label><?php esc_html_e('Show Field for Category', 'woocommerce-checkout-manager'); ?></label>
|
365 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_px_cat]" placeholder="Category Slug(s) e.g my-cat||my-cat2" value="{{data.sigle_px_cat}}">
|
366 |
+
</p>
|
367 |
+
</div>
|
368 |
+
</div>
|
369 |
+
|
370 |
+
<div id="advanced_product_data" class="panel woocommerce_options_panel hidden" style="display: none;">
|
371 |
+
|
372 |
+
<div class="options_group">
|
373 |
+
<p class="form-field">
|
374 |
+
<label><?php esc_html_e('Start Hour', 'woocommerce-checkout-manager'); ?></label>
|
375 |
+
<input class="short" type="text" placeholder="6" name="wccs_settings3[billing_buttons][{{data.id}}][start_hour]" value="{{data.start_hour}}">
|
376 |
+
</p>
|
377 |
+
<p class="form-field">
|
378 |
+
<label><?php esc_html_e('End Hour', 'woocommerce-checkout-manager'); ?></label>
|
379 |
+
<input class="short" type="text" placeholder="9" name="wccs_settings3[billing_buttons][{{data.id}}][end_hour]" value="{{data.end_hour}}">
|
380 |
+
</p>
|
381 |
+
<p class="form-field">
|
382 |
+
<label><?php esc_html_e('Interval Min.', 'woocommerce-checkout-manager'); ?></label>
|
383 |
+
<input class="short" type="text" placeholder="15" name="wccs_settings3[billing_buttons][{{data.id}}][interval_min]" value="{{data.interval_min}}">
|
384 |
+
</p>
|
385 |
+
<p class="form-field">
|
386 |
+
<label><?php esc_html_e('Manual Min.', 'woocommerce-checkout-manager'); ?></label>
|
387 |
+
<input class="short" type="text" placeholder="0, 10, 20, 30, 40" name="wccs_settings3[billing_buttons][{{data.id}}][manual_min]" value="{{data.manual_min}}">
|
388 |
+
</p>
|
389 |
+
</div>
|
390 |
+
|
391 |
+
<div class="options_group">
|
392 |
+
<p class="form-field">
|
393 |
+
<label><?php esc_html_e('Date Format', 'woocommerce-checkout-manager'); ?></label>
|
394 |
+
<input class="short" type="text" placeholder="dd-mm-yy" name="wccs_settings3[billing_buttons][{{data.id}}][format_date]" value="{{data.format_date}}">
|
395 |
+
</p>
|
396 |
+
<p class="form-field">
|
397 |
+
<label><?php esc_html_e('Days Before', 'woocommerce-checkout-manager'); ?></label>
|
398 |
+
<input class="short" type="text" placeholder="+3" name="wccs_settings3[billing_buttons][{{data.id}}][min_before]" value="{{data.min_before}}">
|
399 |
+
</p>
|
400 |
+
<p class="form-field">
|
401 |
+
<label><?php esc_html_e('Days After', 'woocommerce-checkout-manager'); ?></label>
|
402 |
+
<input class="short" type="text" placeholder="3" name="wccs_settings3[billing_buttons][{{data.id}}][max_after]" value="{{data.max_after}}">
|
403 |
+
</p>
|
404 |
+
<p class="form-field">
|
405 |
+
<label><?php esc_html_e('Days Enabler', 'woocommerce-checkout-manager'); ?></label>
|
406 |
+
<input <# if ( data.days_disabler == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler]" value="true">
|
407 |
+
</p>
|
408 |
+
<p class="form-field">
|
409 |
+
<label><?php esc_html_e('Sundays', 'woocommerce-checkout-manager'); ?></label>
|
410 |
+
<input <# if ( data.days_disabler0 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler0]" value="1">
|
411 |
+
</p>
|
412 |
+
<p class="form-field">
|
413 |
+
<label><?php esc_html_e('Mondays Mondays', 'woocommerce-checkout-manager'); ?></label>
|
414 |
+
<input <# if ( data.days_disabler1 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler1]" value="1">
|
415 |
+
</p>
|
416 |
+
<p class="form-field">
|
417 |
+
<label><?php esc_html_e('Tuesdays', 'woocommerce-checkout-manager'); ?></label>
|
418 |
+
<input <# if ( data.days_disabler2 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler2]" value="1">
|
419 |
+
</p>
|
420 |
+
<p class="form-field">
|
421 |
+
<label><?php esc_html_e('Wednesdays', 'woocommerce-checkout-manager'); ?></label>
|
422 |
+
<input <# if ( data.days_disabler3 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler3]" value="1">
|
423 |
+
</p>
|
424 |
+
<p class="form-field">
|
425 |
+
<label><?php esc_html_e('Thursdays', 'woocommerce-checkout-manager'); ?></label>
|
426 |
+
<input <# if ( data.days_disabler4 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler4]" value="1">
|
427 |
+
</p>
|
428 |
+
<p class="form-field">
|
429 |
+
<label><?php esc_html_e('Fridays', 'woocommerce-checkout-manager'); ?></label>
|
430 |
+
<input <# if ( data.days_disabler5 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler5]" value="1">
|
431 |
+
</p>
|
432 |
+
<p class="form-field">
|
433 |
+
<label><?php esc_html_e('Satudays', 'woocommerce-checkout-manager'); ?></label>
|
434 |
+
<input <# if ( data.days_disabler6 == '1' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][days_disabler6]" value="1">
|
435 |
+
</p>
|
436 |
+
</div>
|
437 |
+
|
438 |
+
<div class="options_group">
|
439 |
+
<span class="spongagge">Min Date</span>
|
440 |
+
<p class="form-field">
|
441 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_yy]" placeholder="2013" title="yy" value="{{data.single_yy}}">
|
442 |
+
</p>
|
443 |
+
<p class="form-field">
|
444 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_mm]" placeholder="10" title="mm" value="{{data.single_mm}}">
|
445 |
+
</p>
|
446 |
+
<p class="form-field">
|
447 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_dd]" placeholder="25" title="dd" value="{{data.single_dd}}">
|
448 |
+
</p>
|
449 |
+
</div>
|
450 |
+
<div class="options_group">
|
451 |
+
<span class="spongagge">Max Date</span>
|
452 |
+
<p class="form-field">
|
453 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_max_yy]" placeholder="2013" title="yy" value="{{data.single_max_yy}}">
|
454 |
+
</p>
|
455 |
+
<p class="form-field">
|
456 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_max_mm]" placeholder="10" title="mm" value="{{data.single_max_mm}}">
|
457 |
+
</p>
|
458 |
+
<p class="form-field">
|
459 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][single_max_dd]" placeholder="25" title="dd" value="{{data.single_max_dd}}">
|
460 |
+
</p>
|
461 |
+
</div>
|
462 |
+
|
463 |
+
</div>
|
464 |
+
|
465 |
+
<div id="marketplace_suggestions" class="panel woocommerce_options_panel hidden" style="display: none;">
|
466 |
+
<div class="marketplace-suggestions-container showing-suggestion" data-marketplace-suggestions-context="product-edit-meta-tab-header">
|
467 |
+
<div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-meta-tab-header">
|
468 |
+
<div class="marketplace-suggestion-container-content">
|
469 |
+
<h4>Recommended extensions</h4></div>
|
470 |
+
<div class="marketplace-suggestion-container-cta"></div>
|
471 |
+
</div>
|
472 |
+
</div>
|
473 |
+
<div class="marketplace-suggestions-container showing-suggestion" data-marketplace-suggestions-context="product-edit-meta-tab-body">
|
474 |
+
<div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-name-your-price"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/name-your-price.svg" class="marketplace-suggestion-icon">
|
475 |
+
<div class="marketplace-suggestion-container-content">
|
476 |
+
<h4>Name Your Price</h4>
|
477 |
+
<p>Let customers pay what they want - useful for donations, tips and more</p>
|
478 |
+
</div>
|
479 |
+
<div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/name-your-price/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&wccom-woo-version=3.7.0&utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="button">Learn More</a>
|
480 |
+
<a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
|
481 |
+
</div>
|
482 |
+
</div>
|
483 |
+
<div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-variation-images"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/additional-variation-images.svg" class="marketplace-suggestion-icon">
|
484 |
+
<div class="marketplace-suggestion-container-content">
|
485 |
+
<h4>Additional Variation Images</h4>
|
486 |
+
<p>Showcase your products in the best light with a image for each variation</p>
|
487 |
+
</div>
|
488 |
+
<div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/woocommerce-additional-variation-images/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&wccom-woo-version=3.7.0&utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="button">Learn More</a>
|
489 |
+
<a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
|
490 |
+
</div>
|
491 |
+
</div>
|
492 |
+
<div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-woocommerce-one-page-checkout"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/one-page-checkout.svg" class="marketplace-suggestion-icon">
|
493 |
+
<div class="marketplace-suggestion-container-content">
|
494 |
+
<h4>One Page Checkout</h4>
|
495 |
+
<p>Don't make customers click around - let them choose products, checkout & pay all on one page</p>
|
496 |
+
</div>
|
497 |
+
<div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/woocommerce-one-page-checkout/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&wccom-woo-version=3.7.0&utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="button">Learn More</a>
|
498 |
+
<a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
|
499 |
+
</div>
|
500 |
+
</div>
|
501 |
+
<div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-min-max-quantities"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/min-max-quantities.svg" class="marketplace-suggestion-icon">
|
502 |
+
<div class="marketplace-suggestion-container-content">
|
503 |
+
<h4>Min/Max Quantities</h4>
|
504 |
+
<p>Specify minimum and maximum allowed product quantities for orders to be completed</p>
|
505 |
+
</div>
|
506 |
+
<div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/min-max-quantities/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&wccom-woo-version=3.7.0&utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="button">Learn More</a>
|
507 |
+
<a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
|
508 |
+
</div>
|
509 |
+
</div>
|
510 |
+
</div>
|
511 |
+
<div class="marketplace-suggestions-container showing-suggestion" data-marketplace-suggestions-context="product-edit-meta-tab-footer">
|
512 |
+
<div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-meta-tab-footer-browse-all">
|
513 |
+
<div class="marketplace-suggestion-container-content has-manage-link"><a class="marketplace-suggestion-manage-link linkout" href="http://localhost/woocommerce-checkout/wp-admin/admin.php?page=wc-settings&tab=advanced&section=woocommerce_com">Manage suggestions</a></div>
|
514 |
+
<div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/product-category/woocommerce-extensions/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&wccom-woo-version=3.7.0&utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="linkout">Browse all extensions<span class="dashicons dashicons-external"></span></a></div>
|
515 |
+
</div>
|
516 |
+
</div>
|
517 |
+
<div class="marketplace-suggestions-metabox-nosuggestions-placeholder hidden">
|
518 |
+
<img src="https://woocommerce.com/wp-content/plugins/wccom-plugins/marketplace-suggestions/icons/get_more_options.svg" class="marketplace-suggestion-icon">
|
519 |
+
<div class="marketplace-suggestion-placeholder-content">
|
520 |
+
<h4>Enhance your products</h4>
|
521 |
+
<p>Extensions can add new functionality to your product pages that make your store stand out</p>
|
522 |
+
</div>
|
523 |
+
<a href="https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=editproduct&utm_campaign=marketplacesuggestions&utm_medium=product" target="blank" class="button">Browse the Marketplace</a>
|
524 |
+
<br>
|
525 |
+
<a class="marketplace-suggestion-manage-link" href="http://localhost/woocommerce-checkout/wp-admin/admin.php?page=wc-settings&tab=advanced&section=woocommerce_com">Manage suggestions</a>
|
526 |
+
</div>
|
527 |
+
</div>
|
528 |
+
<div class="clear"></div>
|
529 |
+
</div>
|
530 |
+
</div>
|
531 |
|
532 |
+
</div>
|
533 |
+
<div class="attachment-info">
|
534 |
+
<span class="settings-save-status">
|
535 |
+
<span class="spinner"></span>
|
536 |
+
<span class="saved">Saved.</span>
|
537 |
+
</span>
|
538 |
+
<div class="details">
|
539 |
+
<div class="filename"><strong>Field id:</strong> #{{data.id}}</div>
|
540 |
+
<div class="filename"><strong>Filed slug:</strong> {{data.cow}}</div>
|
541 |
</div>
|
|
|
|
|
542 |
|
543 |
+
<div class="settings">
|
544 |
+
<label class="setting" data-setting="alt">
|
545 |
+
<span class="name"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></span>
|
546 |
+
<input type="text" name="wccs_settings3[billing_buttons][{{data.id}}][label]" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-managert'); ?>" value="{{data.label}}">
|
547 |
+
</label>
|
548 |
+
<p class="description"><?php esc_html_e('Label text for the checkout field.', 'woocommerce-checkout-managert'); ?></p>
|
549 |
+
<label class="setting" data-setting="title">
|
550 |
+
<span class="name"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></span>
|
551 |
+
<input type="text" name="wccs_settings3[billing_buttons][{{data.id}}][placeholder]" title="" placeholder="<?php esc_html_e('Example red', 'woocommerce-checkout-managert'); ?>" value="{{data.placeholder}}">
|
552 |
+
</label>
|
553 |
+
<p class="description"><?php esc_html_e('Placeholder text for the checkout field.', 'woocommerce-checkout-managert'); ?></p>
|
554 |
+
<label class="setting">
|
555 |
+
<span class="name"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></span>
|
556 |
+
<select class="select short" name="wccs_settings3[billing_buttons][{{data.id}}][position]">
|
557 |
+
<option <# if ( data.position == 'form-row-wide' ) { #>selected<# } #> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-managert'); ?></option>
|
558 |
+
<option <# if ( data.position == 'form-row-first' ) { #>selected<# } #> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-managert'); ?></option>
|
559 |
+
<option <# if ( data.position == 'form-row-last' ) { #>selected<# } #> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-managert'); ?></option>
|
560 |
+
</select>
|
561 |
+
</label>
|
562 |
+
<p class="description"><?php esc_html_e('Placement of the checkout field.', 'woocommerce-checkout-managert'); ?></p>
|
563 |
+
<label class="setting">
|
564 |
+
<span class="name"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></span>
|
565 |
+
<input <# if ( data.clear_row == 'true' ) { #>checked<# } #> type="checkbox" name="wccs_settings3[billing_buttons][{{data.id}}][clear_row]" value="true">
|
566 |
+
</label>
|
567 |
+
<p class="description"><?php esc_html_e('Applies a clear fix to the checkout field.', 'woocommerce-checkout-managert'); ?></p>
|
568 |
+
<label class="setting">
|
569 |
+
<span class="name"><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></span>
|
570 |
+
<input class="short" type="text" name="wccs_settings3[billing_buttons][{{data.id}}][extra_class]" value="{{data.extra_class}}">
|
571 |
+
</label>
|
572 |
+
|
573 |
+
<div class="attachment-compat">
|
574 |
+
<form class="compat-item"></form>
|
575 |
</div>
|
576 |
</div>
|
577 |
+
|
578 |
+
<div class="actions">
|
579 |
+
<a target="_blank" class="view-attachment" href="<?php echo wc_get_page_permalink('checkout'); ?>"><?php esc_html_e('View checkout page', 'woocommerce-checkout-managert'); ?></a> |
|
580 |
+
<a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e('Get premium version', 'woocommerce-checkout-managert'); ?></a> |
|
581 |
+
<a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e('Get premium version', 'woocommerce-checkout-managert'); ?></a>
|
582 |
+
</div>
|
583 |
+
|
584 |
</div>
|
585 |
</div>
|
586 |
+
|
587 |
+
</div>
|
588 |
+
<div class="media-frame-toolbar" style="left:0;">
|
589 |
+
<div class="media-toolbar">
|
590 |
+
<div class="media-toolbar-secondary"></div>
|
591 |
+
<div class="media-toolbar-primary search-form">
|
592 |
+
<button type="button" class="media-modal-save button button-primary media-button button-large"><?php esc_html_e('Save'); ?></button>
|
593 |
+
<button type="button" class="media-modal-delete button button-secondary media-button button-large"><?php esc_html_e('Delete'); ?></button>
|
594 |
</div>
|
595 |
</div>
|
596 |
</div>
|
new/fields_handler.php
CHANGED
@@ -91,6 +91,25 @@ if (!class_exists('WOOCCM_Fields_Handler')) {
|
|
91 |
return $fields;
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
function init() {
|
95 |
|
96 |
// Remove fields
|
@@ -103,6 +122,10 @@ if (!class_exists('WOOCCM_Fields_Handler')) {
|
|
103 |
|
104 |
// Fix address fields priority
|
105 |
add_filter('woocommerce_get_country_locale_default', array($this, 'remove_fields_priority'));
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
|
108 |
public static function instance() {
|
91 |
return $fields;
|
92 |
}
|
93 |
|
94 |
+
function remove_address_fields($data) {
|
95 |
+
|
96 |
+
$remove = array(
|
97 |
+
'shipping_country',
|
98 |
+
'shipping_address_1',
|
99 |
+
'shipping_city',
|
100 |
+
'shipping_state',
|
101 |
+
'shipping_postcode'
|
102 |
+
);
|
103 |
+
|
104 |
+
foreach ($remove as $key) {
|
105 |
+
if (empty($data[$key])) {
|
106 |
+
unset($data[$key]);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
return $data;
|
111 |
+
}
|
112 |
+
|
113 |
function init() {
|
114 |
|
115 |
// Remove fields
|
122 |
|
123 |
// Fix address fields priority
|
124 |
add_filter('woocommerce_get_country_locale_default', array($this, 'remove_fields_priority'));
|
125 |
+
|
126 |
+
// Fix required country notice when shipping address is activated
|
127 |
+
// -----------------------------------------------------------------------
|
128 |
+
add_filter('woocommerce_checkout_posted_data', array($this, 'remove_address_fields'));
|
129 |
}
|
130 |
|
131 |
public static function instance() {
|
new/fields_register.php
CHANGED
@@ -209,7 +209,7 @@ if (!class_exists('WOOCCM_Fields_Register')) {
|
|
209 |
if ($buttons = $options['buttons']) {
|
210 |
|
211 |
foreach ($buttons as $key => $custom_field) {
|
212 |
-
woocommerce_form_field($custom_field['cow'], $this->add_checkout_field_filter($key, $
|
213 |
}
|
214 |
}
|
215 |
}
|
209 |
if ($buttons = $options['buttons']) {
|
210 |
|
211 |
foreach ($buttons as $key => $custom_field) {
|
212 |
+
woocommerce_form_field($custom_field['cow'], $this->add_checkout_field_filter($key, $custom_field, $custom_field), $checkout->get_value($custom_field['cow']));
|
213 |
}
|
214 |
}
|
215 |
}
|
new/fields_required.php
CHANGED
@@ -47,7 +47,7 @@ if (!class_exists('WOOCCM_Fields_Required')) {
|
|
47 |
//}
|
48 |
|
49 |
function init() {
|
50 |
-
add_action('woocommerce_checkout_process', array($this, 'add_checkout_additional_required'));
|
51 |
//add_action('woocommerce_checkout_process', array($this, 'add_checkout_billing_required'));
|
52 |
//add_action('woocommerce_checkout_process', array($this, 'add_checkout_shipping_required'));
|
53 |
}
|
47 |
//}
|
48 |
|
49 |
function init() {
|
50 |
+
//add_action('woocommerce_checkout_process', array($this, 'add_checkout_additional_required'));
|
51 |
//add_action('woocommerce_checkout_process', array($this, 'add_checkout_billing_required'));
|
52 |
//add_action('woocommerce_checkout_process', array($this, 'add_checkout_shipping_required'));
|
53 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/
|
|
4 |
Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.2.3
|
7 |
-
Stable tag: 4.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -137,6 +137,11 @@ Example:
|
|
137 |
|
138 |
== Changelog ==
|
139 |
|
|
|
|
|
|
|
|
|
|
|
140 |
= 4.4.0 =
|
141 |
* Fix: woocommerce checkout address fields priority
|
142 |
|
4 |
Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.2.3
|
7 |
+
Stable tag: 4.4.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
137 |
|
138 |
== Changelog ==
|
139 |
|
140 |
+
= 4.4.1 =
|
141 |
+
* Fix: Undefined variable: custom_fields
|
142 |
+
* Fix: woocommerce checkout country required when is removed
|
143 |
+
* Fix: woocommerce checkout additional fields required notice duplicated
|
144 |
+
|
145 |
= 4.4.0 =
|
146 |
* Fix: woocommerce checkout address fields priority
|
147 |
|
woocommerce-checkout-manager.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: WooCommerce Checkout Manager
|
4 |
* Description: Manages WooCommerce Checkout, the advanced way.
|
5 |
-
* Version: 4.4.
|
6 |
* Author: QuadLayers
|
7 |
* Author URI: https://www.quadlayers.com
|
8 |
* Copyright: 2019 QuadLayers (https://www.quadlayers.com)
|
@@ -16,7 +16,7 @@ if (!defined('WOOCCM_PLUGIN_NAME')) {
|
|
16 |
define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
|
17 |
}
|
18 |
if (!defined('WOOCCM_PLUGIN_VERSION')) {
|
19 |
-
define('WOOCCM_PLUGIN_VERSION', '4.4.
|
20 |
}
|
21 |
if (!defined('WOOCCM_PLUGIN_FILE')) {
|
22 |
define('WOOCCM_PLUGIN_FILE', __FILE__);
|
@@ -158,7 +158,9 @@ if (!class_exists('WOOCCM')) {
|
|
158 |
|
159 |
function register_scripts() {
|
160 |
|
161 |
-
wp_register_script('
|
|
|
|
|
162 |
|
163 |
wp_register_script('wooccm-admin', plugins_url('assets/js/wooccm-admin.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
|
164 |
|
@@ -201,7 +203,7 @@ if (!class_exists('WOOCCM')) {
|
|
201 |
// only for panel
|
202 |
wp_enqueue_media();
|
203 |
wp_enqueue_script('wooccm-modal');
|
204 |
-
|
205 |
// 1326
|
206 |
// only for orders
|
207 |
wp_enqueue_script('wooccm-admin');
|
@@ -397,12 +399,9 @@ add_action('woocommerce_checkout_process', 'wooccm_billing_custom_checkout_proce
|
|
397 |
add_action('woocommerce_checkout_process', 'wooccm_shipping_custom_checkout_process');
|
398 |
|
399 |
//1326
|
400 |
-
//add_action('woocommerce_before_checkout_form', 'wooccm_upload_billing_scripts');
|
401 |
-
//add_action('woocommerce_before_checkout_form', 'wooccm_upload_shipping_scripts');
|
402 |
-
//add_action('woocommerce_before_checkout_form', 'wooccm_upload_scripts');
|
403 |
add_action('woocommerce_before_checkout_form', 'wooccm_billing_scripts');
|
404 |
-
add_action('woocommerce_before_checkout_form', 'wooccm_shipping_scripts');
|
405 |
add_action('woocommerce_before_checkout_form', 'wooccm_billing_override_this');
|
|
|
406 |
add_action('woocommerce_before_checkout_form', 'wooccm_shipping_override_this');
|
407 |
add_action('woocommerce_before_checkout_form', 'wooccm_scripts');
|
408 |
//add_action('woocommerce_before_checkout_form', 'wooccm_upload_scripts');
|
2 |
/**
|
3 |
* Plugin Name: WooCommerce Checkout Manager
|
4 |
* Description: Manages WooCommerce Checkout, the advanced way.
|
5 |
+
* Version: 4.4.1
|
6 |
* Author: QuadLayers
|
7 |
* Author URI: https://www.quadlayers.com
|
8 |
* Copyright: 2019 QuadLayers (https://www.quadlayers.com)
|
16 |
define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
|
17 |
}
|
18 |
if (!defined('WOOCCM_PLUGIN_VERSION')) {
|
19 |
+
define('WOOCCM_PLUGIN_VERSION', '4.4.1');
|
20 |
}
|
21 |
if (!defined('WOOCCM_PLUGIN_FILE')) {
|
22 |
define('WOOCCM_PLUGIN_FILE', __FILE__);
|
158 |
|
159 |
function register_scripts() {
|
160 |
|
161 |
+
wp_register_script('wc-admin-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes.js', array('jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'accounting', 'round', 'wc-enhanced-select', 'plupload-all', 'stupidtable', 'jquery-tiptip'), WC_VERSION);
|
162 |
+
|
163 |
+
wp_register_script('wooccm-modal', plugins_url('assets/js/wooccm-modal.js', WOOCCM_PLUGIN_FILE), array('jquery', 'wc-admin-meta-boxes', 'backbone'), WOOCCM_PLUGIN_VERSION, true);
|
164 |
|
165 |
wp_register_script('wooccm-admin', plugins_url('assets/js/wooccm-admin.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
|
166 |
|
203 |
// only for panel
|
204 |
wp_enqueue_media();
|
205 |
wp_enqueue_script('wooccm-modal');
|
206 |
+
|
207 |
// 1326
|
208 |
// only for orders
|
209 |
wp_enqueue_script('wooccm-admin');
|
399 |
add_action('woocommerce_checkout_process', 'wooccm_shipping_custom_checkout_process');
|
400 |
|
401 |
//1326
|
|
|
|
|
|
|
402 |
add_action('woocommerce_before_checkout_form', 'wooccm_billing_scripts');
|
|
|
403 |
add_action('woocommerce_before_checkout_form', 'wooccm_billing_override_this');
|
404 |
+
add_action('woocommerce_before_checkout_form', 'wooccm_shipping_scripts');
|
405 |
add_action('woocommerce_before_checkout_form', 'wooccm_shipping_override_this');
|
406 |
add_action('woocommerce_before_checkout_form', 'wooccm_scripts');
|
407 |
//add_action('woocommerce_before_checkout_form', 'wooccm_upload_scripts');
|