WooCommerce Checkout Manager - Version 4.4.0

Version Description

  • Fix: woocommerce checkout address fields priority
Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WooCommerce Checkout Manager
Version 4.4.0
Comparing to
See all releases

Code changes from version 4.3.9 to 4.4.0

assets/js/wooccm-admin.js CHANGED
@@ -1,43 +1,44 @@
1
  (function ($) {
2
 
3
- // Toggle gateway on/off.
4
- $('#wooccm_billing_settings_add').on('click', function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- var $button = $(this),
7
- $table = $('table#wooccm_billing_fields'),
8
- $tr = $table.find('tbody > tr'),
9
- $new = $tr.last().clone();
10
-
11
- // $table.find('tbody').append($new);
12
-
13
- var data = {
14
- action: 'wooccm_add_field',
15
- nonce: wooccm.nonce,
16
- //field_id: $tr.data('field_id')
17
- };
18
-
19
- $.ajax({
20
- url: woocommerce_admin.ajax_url,
21
- data: data,
22
- dataType: 'json',
23
- type: 'POST',
24
- success: function (response) {
25
-
26
- if (true === response.data) {
27
- //$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
28
- //$toggle.addClass('woocommerce-input-toggle--enabled');
29
- //$toggle.removeClass('woocommerce-input-toggle--loading');
30
- } else if (true !== response.data) {
31
- //$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
32
- //$toggle.addClass('woocommerce-input-toggle--disabled');
33
- //$toggle.removeClass('woocommerce-input-toggle--loading');
34
- } //else if ('needs_setup' === response.data) {
35
- //window.location.href = $link.attr('href');
36
- //}
37
- }
38
- });
39
- return false;
40
- });
41
  $('#wooccm_billing_fields').on('click', '.wooccm-field-toggle-enabled', function () {
42
 
43
  var $link = $(this),
1
  (function ($) {
2
 
3
+ /* Toggle gateway on/off.
4
+ $('#wooccm_billing_settings_add').on('click', function () {
5
+
6
+ var $button = $(this),
7
+ $table = $('table#wooccm_billing_fields'),
8
+ $tr = $table.find('tbody > tr'),
9
+ $new = $tr.last().clone();
10
+
11
+ // $table.find('tbody').append($new);
12
+
13
+ var data = {
14
+ action: 'wooccm_add_field',
15
+ nonce: wooccm.nonce,
16
+ //field_id: $tr.data('field_id')
17
+ };
18
+
19
+ $.ajax({
20
+ url: woocommerce_admin.ajax_url,
21
+ data: data,
22
+ dataType: 'json',
23
+ type: 'POST',
24
+ success: function (response) {
25
+
26
+ if (true === response.data) {
27
+ //$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
28
+ //$toggle.addClass('woocommerce-input-toggle--enabled');
29
+ //$toggle.removeClass('woocommerce-input-toggle--loading');
30
+ } else if (true !== response.data) {
31
+ //$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
32
+ //$toggle.addClass('woocommerce-input-toggle--disabled');
33
+ //$toggle.removeClass('woocommerce-input-toggle--loading');
34
+ } //else if ('needs_setup' === response.data) {
35
+ //window.location.href = $link.attr('href');
36
+ //}
37
+ }
38
+ });
39
+ return false;
40
+ });*/
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  $('#wooccm_billing_fields').on('click', '.wooccm-field-toggle-enabled', function () {
43
 
44
  var $link = $(this),
assets/js/wooccm-admin.min.js CHANGED
@@ -1 +1 @@
1
- (function(a){a("#wooccm_billing_settings_add").on("click",function(){var f=a(this),b=a("table#wooccm_billing_fields"),c=b.find("tbody > tr"),e=c.last().clone();var d={action:"wooccm_add_field",nonce:wooccm.nonce,};a.ajax({url:woocommerce_admin.ajax_url,data:d,dataType:"json",type:"POST",success:function(g){if(true===g.data){}else{if(true!==g.data){}}}});return false});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");var e={action:"wooccm_toggle_field_enabled",nonce:wooccm.nonce,field_id:d.data("field_id")};c.addClass("woocommerce-input-toggle--loading");a.ajax({url:woocommerce_admin.ajax_url,data:e,dataType:"json",type:"POST",success:function(f){if(true===f.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!==f.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);
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");var e={action:"wooccm_toggle_field_enabled",nonce:wooccm.nonce,field_id:d.data("field_id")};c.addClass("woocommerce-input-toggle--loading");a.ajax({url:woocommerce_admin.ajax_url,data:e,dataType:"json",type:"POST",success:function(f){if(true===f.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!==f.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 ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+
3
+ var wpmi = {
4
+ __instance: undefined
5
+ };
6
+
7
+ wpmi.Application = Backbone.View.extend(
8
+ {
9
+ id: 'wpmi_modal',
10
+ events: {
11
+ 'click .close': 'Close',
12
+ 'click .remove': 'Remove',
13
+ 'click .save': 'Save',
14
+ // 'click .attachments .attachment': 'Select',
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
+ $(document).on('click', '#wpmi_metabox', function (e) {
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
+ e.preventDefault();
191
+
192
+ $.ajax({
193
+ type: 'POST',
194
+ url: ajaxurl,
195
+ data: {
196
+ action: 'wpmi_save_nav_menu',
197
+ menu_id: menu_id,
198
+ menu_font: menu_font,
199
+ nonce: wpmi_l10n.nonce
200
+ },
201
+ beforeSend: function () {
202
+ },
203
+ complete: function () {
204
+ },
205
+ error: function () {
206
+ alert('Error!');
207
+ },
208
+ success: function (response) {
209
+ location.reload();
210
+ }
211
+ });
212
+
213
+ }
214
+ });
215
+
216
+ })(jQuery);
assets/js/wooccm-modal.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(b){var a={__instance:undefined};a.Application=Backbone.View.extend({id:"wpmi_modal",events:{"click .close":"Close","click .remove":"Remove","click .save":"Save",},ui:{nav:undefined,content:undefined,media:undefined},templates:{},initialize:function(c){_.bindAll(this,"render","preserveFocus","Close","Save");this.initialize_templates();this.render(c);this.backdrop(c)},backdrop:function(d){var c=this;b(document).on("click",".media-modal-backdrop",function(f){c.Close(f)})},initialize_templates:function(){this.templates.window=wp.template("wpmi-modal-window");this.templates.backdrop=wp.template("wpmi-modal-backdrop")},render:function(c){this.$el.attr("tabindex","0").append(this.templates.window()).append(this.templates.backdrop());b(document).on("focusin",this.preserveFocus);b("body").addClass("modal-open").append(this.$el);this.$el.focus()},preserveFocus:function(c){if(this.$el[0]!==c.target&&!this.$el.has(c.target).length){this.$el.focus()}},Close:function(c){c.preventDefault();this.undelegateEvents();b(document).off("focusin");b("body").removeClass("modal-open");this.remove();a.__instance=undefined},Save:function(i){i.preventDefault();var h=this,d=b("form",this.$el),f=this.$el.data("menu_item_id");if(!f){return}if(!d.length){return}var j=b("#menu-to-edit").find("#menu-item-"+f),g=j.find(".menu-item-wpmi_plus"),c=j.find(".menu-item-wpmi_icon");if(!j.length){return}d.find(".wpmi-input").each(function(k){var e=b(this).prop("id").match(/wpmi-input-([a-z]+)/)[1],l=b(this).val();j.find("input#wpmi-input-"+e).val(l);if(e==="icon"){if(c.length){c.remove()}g.before('<i class="menu-item-wpmi_icon '+l+'"></i>')}});h.Close(i)},Remove:function(h){h.preventDefault();var g=this,d=b("form",this.$el),f=this.$el.data("menu_item_id");if(!f){return}if(!d.length){return}var i=b("#menu-to-edit").find("#menu-item-"+f),c=i.find(".menu-item-wpmi_icon");if(!i.length){return}d.find(".wpmi-input").each(function(j){var e=b(this).prop("id").match(/wpmi-input-([a-z]+)/)[1];i.find("input#wpmi-input-"+e).val("")});c.remove();g.Close(h)}});b("#wooccm_billing_settings_add").on("click",function(c){c.preventDefault();alert("test");if(a.__instance===undefined){a.__instance=new a.Application(c)}});b(document).on("click","#wpmi_metabox",function(f){var d=b("input:checked",b(this)).val(),c=b("#menu").val();if(b(f.target).hasClass("save")&&d&&c){f.preventDefault();b.ajax({type:"POST",url:ajaxurl,data:{action:"wpmi_save_nav_menu",menu_id:c,menu_font:d,nonce:wpmi_l10n.nonce},beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(e){location.reload()}})}})})(jQuery);
new/admin/pages/billing.php CHANGED
@@ -103,4 +103,360 @@
103
  </td>
104
  </tr>
105
  </tbody>
106
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  </td>
104
  </tr>
105
  </tbody>
106
+ </table>
107
+ <script type="text/html" id='tmpl-wpmi-modal-backdrop'>
108
+ <div class="media-modal-backdrop">&nbsp;</div>
109
+ </script>
110
+ <script type="text/html" id='tmpl-wpmi-modal-window'>
111
+ <div id="<?php echo esc_attr(WOOCCM_PREFIX . '_modal'); ?>" class="media-modal wp-core-ui">
112
+ <button type="button" class="media-modal-close close">
113
+ <span class="media-modal-icon">
114
+ <span class="screen-reader-text"><?php esc_html_e('Close media panel'); ?></span>
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></button>
123
+ </div>
124
+ </div>-->
125
+ <div class="media-frame-title">
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
+ </div>
137
+ <div class="media-modal-content">
138
+ <div class="media-frame mode-select wp-core-ui">
139
+ <div class="media-frame-menu">
140
+ <div class="media-menu">
141
+ <a href="#" class="media-menu-item active"><?php esc_html_e('Featured Image'); ?></a>
142
+ </div>
143
+ </div>
144
+ <div class="media-frame-content" data-columns="8">
145
+ <div class="attachments-browser">
146
+ <div class="media-toolbar">
147
+
148
+ </div>
149
+ <div tabindex="-1" class="attachments">
150
+
151
+ <table class="form-table">
152
+ <tbody>
153
+ <tr>
154
+ <th scope="row"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></th>
155
+ <td>
156
+ <select name="wccs_settings3[billing_buttons][0][position]">
157
+ <option value="form-row-wide" selected="selected">Wide</option>
158
+ <option value="form-row-first">Left</option>
159
+ <option value="form-row-last">Right</option>
160
+ </select>
161
+ <p class="description"><?php esc_html_e('Placement of the Checkout field.', 'woocommerce-checkout-managert'); ?></p>
162
+ </td>
163
+ </tr>
164
+ <tr>
165
+ <th scope="row"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></th>
166
+ <td>
167
+ <input name="wccs_settings3[billing_buttons][0][clear_row]" type="checkbox" value="true">
168
+ <p class="description"><?php esc_html_e('Applies a clear fix to the Checkout field.', 'woocommerce-checkout-managert'); ?></p>
169
+ </td>
170
+ </tr>
171
+ <tr>
172
+ <th scope="row"><?php esc_html_e('Deny Checkout', 'woocommerce-checkout-manager'); ?></th>
173
+ <td>
174
+ <input name="wccs_settings3[billing_buttons][0][deny_checkout]" type="checkbox" value="true">
175
+ <p class="description"><?php esc_html_e('1326.', 'woocommerce-checkout-managert'); ?></p>
176
+ </td>
177
+ </tr>
178
+ <tr>
179
+ <th scope="row"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
180
+ <td>
181
+ <input type="text" name="wccs_settings3[billing_buttons][0][label]" placeholder="My Field Name" value="Country">
182
+ <p class="description"><?php esc_html_e('Placeholder text for the Checkout field.', 'woocommerce-checkout-managert'); ?></p>
183
+ </td>
184
+ </tr>
185
+ <tr>
186
+ <th scope="row"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
187
+ <td>
188
+ <input type="text" name="wccs_settings3[billing_buttons][0][placeholder]" title="" placeholder="Example red" value="" readonly="readonly">
189
+ <p class="description"><?php esc_html_e('Placeholder text for the Checkout field.', 'woocommerce-checkout-managert'); ?></p>
190
+ </td>
191
+ </tr>
192
+ <tr>
193
+ <th scope="row"><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></th>
194
+ <td>
195
+ <input type="text" name="wccs_settings3[billing_buttons][0][extra_class]" value="">
196
+ <p class="description"><?php esc_html_e('1326.', 'woocommerce-checkout-managert'); ?></p>
197
+ </td>
198
+ </tr>
199
+ <tr>
200
+
201
+ <td class="hide_stuff_op wccm1" style="">
202
+ <label>Options</label>
203
+ <input type="text" name="wccs_settings3[billing_buttons][0][option_array]" placeholder="Option 1||Option 2||Option 3" value="">
204
+ </td>
205
+ <td class="more_toggler1">
206
+ <label>Type</label>
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
+ </td>
225
+ <td class="more_toggler1">
226
+ <label>ID</label>
227
+ <input type="text" name="wccs_settings3[billing_buttons][0][cow]" placeholder="MyField" title="To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields." value="country" readonly="readonly" style="pointer-events:none;">
228
+ </td>
229
+ <td style="text-align:center;">
230
+ <label>Disabled</label>
231
+ <input name="wccs_settings3[billing_buttons][0][disabled]" type="checkbox" value="true">
232
+ </td>
233
+ </tr>
234
+ </tbody>
235
+ </table>
236
+
237
+ <table class="form-table">
238
+ <tbody>
239
+ <tr>
240
+ <td class="billing-wccs-order-hidden">
241
+ <input type="hidden" name="wccs_settings3[billing_buttons][0][order]" value="1">
242
+ </td>
243
+ </tr>
244
+ <tr>
245
+
246
+ <td class="filter_field_tog add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="">
247
+ Filter Toggler</td>
248
+
249
+ <td class="filter_field" style="text-align:center;">
250
+ <input name="wccs_settings3[billing_buttons][0][tax_remove]" type="checkbox" value="true">
251
+ </td>
252
+
253
+ <td class="filter_field" style="text-align:center;">
254
+ <input name="wccs_settings3[billing_buttons][0][deny_receipt]" type="checkbox" value="true">
255
+ </td>
256
+
257
+ <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="text-align:center;">
258
+ <input name="wccs_settings3[billing_buttons][0][add_amount]" type="checkbox" value="true">
259
+ </td>
260
+
261
+ <td class="add_amount_field" style="text-align:center;">
262
+ <input name="wccs_settings3[billing_buttons][0][fee_name]" type="text" value="" placeholder="My Custom Charge">
263
+ </td>
264
+
265
+ <td class="add_amount_field" style="text-align:center;">
266
+ <input name="wccs_settings3[billing_buttons][0][add_amount_field]" type="text" value="" placeholder="50">
267
+ </td>
268
+
269
+ <td class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field">
270
+ <input type="text" name="wccs_settings3[billing_buttons][0][chosen_valt]" placeholder="Yes" value="">
271
+ </td>
272
+
273
+ <td class="filter_field add_amount_field hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_time hide_stuff_color more_toggler1 more_toggler1c" style="text-align:center;">
274
+ <input name="wccs_settings3[billing_buttons][0][conditional_parent_use]" type="checkbox" value="true">
275
+ </td>
276
+
277
+ <td class="condition_tick" style="text-align:center;">
278
+ <input name="wccs_settings3[billing_buttons][0][conditional_parent]" type="checkbox" value="true">
279
+ </td>
280
+
281
+ <td class="condition_tick">
282
+ <input type="text" name="wccs_settings3[billing_buttons][0][conditional_tie]" placeholder="Parent Abbr. Name" value="">
283
+ </td>
284
+
285
+
286
+ </tr>
287
+
288
+ <tr>
289
+
290
+ <td class="filter_field">
291
+ <input name="wccs_settings3[billing_buttons][0][user_role]" type="checkbox" value="user_role">
292
+ </td>
293
+
294
+ <td class="filter_field" style="">
295
+ <input type="text" name="wccs_settings3[billing_buttons][0][role_options]" placeholder="Option 1||Option 2||Option 3" value="">
296
+ </td>
297
+
298
+ <td class="filter_field" style="">
299
+ <input type="text" name="wccs_settings3[billing_buttons][0][role_options2]" placeholder="Option 1||Option 2||Option 3" value="">
300
+ </td>
301
+
302
+ </tr>
303
+
304
+
305
+ <tr>
306
+
307
+ <td class="more_toggler1c">
308
+ <input name="wccs_settings3[billing_buttons][0][more_content]" type="checkbox" value="1">
309
+ </td>
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
+ </td>
430
+ <td class="hide_stuff_op wccm1">
431
+ <input name="wccs_settings3[billing_buttons][0][fancy]" type="checkbox" value="country_select">
432
+ </td>
433
+
434
+ <td class="hide_stuff_op wccm1" style="">
435
+ <input type="text" name="wccs_settings3[billing_buttons][0][force_title2]" placeholder="Name Guide" value="">
436
+ </td>
437
+ </tr>
438
+ </tbody>
439
+ </table>
440
+ </li>
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
+ <div class="media-frame-toolbar">
450
+ <div class="media-toolbar">
451
+ <div class="media-toolbar-secondary"></div>
452
+ <div class="media-toolbar-primary search-form">
453
+ <button type="button" class="button media-button button-large button-primary media-button-select save"><?php esc_html_e('Save'); ?></button>
454
+ <button type="button" class="button media-button button-large button-secondary close"><?php esc_html_e('Close'); ?></button>
455
+ </div>
456
+ </div>
457
+ </div>
458
+ </div>
459
+ </div>
460
+ </div>
461
+ </div>
462
+ </script>
new/fields_handler.php CHANGED
@@ -82,6 +82,15 @@ if (!class_exists('WOOCCM_Fields_Handler')) {
82
  return 'required';
83
  }
84
 
 
 
 
 
 
 
 
 
 
85
  function init() {
86
 
87
  // Remove fields
@@ -92,7 +101,8 @@ if (!class_exists('WOOCCM_Fields_Handler')) {
92
  // -----------------------------------------------------------------------
93
  add_filter('default_option_woocommerce_checkout_address_2_field', array($this, 'woocommerce_checkout_address_2_field'));
94
 
95
- //add_filter('woocommerce_form_field', array($this, 'field_user_roles'), 10, 4);
 
96
  }
97
 
98
  public static function instance() {
82
  return 'required';
83
  }
84
 
85
+ function remove_fields_priority($fields) {
86
+
87
+ foreach ($fields as $key => $field) {
88
+ unset($fields[$key]['priority']);
89
+ }
90
+
91
+ return $fields;
92
+ }
93
+
94
  function init() {
95
 
96
  // Remove fields
101
  // -----------------------------------------------------------------------
102
  add_filter('default_option_woocommerce_checkout_address_2_field', array($this, 'woocommerce_checkout_address_2_field'));
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() {
new/fields_register.php CHANGED
@@ -37,7 +37,7 @@ if (!class_exists('WOOCCM_Fields_Register')) {
37
  // Priority
38
  // -----------------------------------------------------------------------
39
  if (isset($custom_field['order'])) {
40
- $fields[$key]['priority'] = $fields[$key]['order'];
41
  }
42
 
43
  // Color
@@ -51,7 +51,6 @@ if (!class_exists('WOOCCM_Fields_Register')) {
51
  //if (!empty($custom_field['option_array'])) {
52
  $fields[$key]['options'] = @$custom_field['option_array'];
53
  //}
54
-
55
  // Default
56
  // -----------------------------------------------------------------------
57
  if (isset($custom_field['force_title2'])) {
37
  // Priority
38
  // -----------------------------------------------------------------------
39
  if (isset($custom_field['order'])) {
40
+ $fields[$key]['priority'] = $fields[$key]['order'] * 10;
41
  }
42
 
43
  // Color
51
  //if (!empty($custom_field['option_array'])) {
52
  $fields[$key]['options'] = @$custom_field['option_array'];
53
  //}
 
54
  // Default
55
  // -----------------------------------------------------------------------
56
  if (isset($custom_field['force_title2'])) {
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.3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -137,6 +137,9 @@ Example:
137
 
138
  == Changelog ==
139
 
 
 
 
140
  = 4.3.9 =
141
  * Fix: woocommerce checkout multiple options
142
  * Fix: woocommerce checkout roles dependency
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.0
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.0 =
141
+ * Fix: woocommerce checkout address fields priority
142
+
143
  = 4.3.9 =
144
  * Fix: woocommerce checkout multiple options
145
  * Fix: woocommerce checkout roles dependency
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.3.9
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.3.9');
20
  }
21
  if (!defined('WOOCCM_PLUGIN_FILE')) {
22
  define('WOOCCM_PLUGIN_FILE', __FILE__);
@@ -158,6 +158,8 @@ if (!class_exists('WOOCCM')) {
158
 
159
  function register_scripts() {
160
 
 
 
161
  wp_register_script('wooccm-admin', plugins_url('assets/js/wooccm-admin.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
162
 
163
  wp_localize_script('wooccm-admin', 'wooccm', array(
@@ -195,6 +197,11 @@ if (!class_exists('WOOCCM')) {
195
 
196
  $this->register_scripts();
197
 
 
 
 
 
 
198
  // 1326
199
  // only for orders
200
  wp_enqueue_script('wooccm-admin');
@@ -325,7 +332,7 @@ if (!class_exists('WOOCCM')) {
325
 
326
  public static function do_activation() {
327
  set_transient('wooccm-first-rating', true, MONTH_IN_SECONDS);
328
-
329
  if (class_exists('WOOCCM_Install')) {
330
  WOOCCM_Install::do_activation();
331
  } else {
2
  /**
3
  * Plugin Name: WooCommerce Checkout Manager
4
  * Description: Manages WooCommerce Checkout, the advanced way.
5
+ * Version: 4.4.0
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.0');
20
  }
21
  if (!defined('WOOCCM_PLUGIN_FILE')) {
22
  define('WOOCCM_PLUGIN_FILE', __FILE__);
158
 
159
  function register_scripts() {
160
 
161
+ wp_register_script('wooccm-modal', plugins_url('assets/js/wooccm-modal.js', WOOCCM_PLUGIN_FILE), array('jquery', 'backbone'), WOOCCM_PLUGIN_VERSION, true);
162
+
163
  wp_register_script('wooccm-admin', plugins_url('assets/js/wooccm-admin.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
164
 
165
  wp_localize_script('wooccm-admin', 'wooccm', array(
197
 
198
  $this->register_scripts();
199
 
200
+ //1326
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');
332
 
333
  public static function do_activation() {
334
  set_transient('wooccm-first-rating', true, MONTH_IN_SECONDS);
335
+
336
  if (class_exists('WOOCCM_Install')) {
337
  WOOCCM_Install::do_activation();
338
  } else {