WooCommerce Checkout Manager - Version 4.8.5

Version Description

  • Fix: woocommerce checkout manager modal tab
  • New: woocommerce checkout manager field description
Download this release

Release Info

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

Code changes from version 4.8.4 to 4.8.5

assets/backend/js/wooccm-admin-field.js CHANGED
@@ -26,19 +26,9 @@
26
  this.templates.window = wp.template('wooccm-modal-tabs');
27
  },
28
  render: function () {
 
29
  this.$el.html(this.templates.window(this.model.attributes));
30
- this.$el.trigger('wooccm-tab-panels');
31
- }
32
- });
33
- var FieldViewDatePickerLimit = Backbone.View.extend({
34
- templates: {},
35
- initialize: function () {
36
- this.templates.window = wp.template('wooccm-modal-datepicker-limit');
37
- },
38
- render: function () {
39
- this.$el.html(this.templates.window(this.model.attributes));
40
- this.$el.trigger('wooccm-enhanced-between-dates');
41
- this.$el.trigger('init_tooltips');
42
  }
43
  });
44
  var FieldViewPanels = Backbone.View.extend({
@@ -66,24 +56,23 @@
66
  });
67
  var FieldView = Backbone.View.extend({
68
  events: {
69
- 'change input': 'enable',
70
- 'change textarea': 'enable',
71
- 'change select': 'enable',
72
  'click .media-modal-backdrop': 'close',
73
  'click .media-modal-close': 'close',
74
  'click .media-modal-prev': 'edit',
75
  'click .media-modal-next': 'edit',
76
- 'change .media-modal-change': 'change',
77
  'change .media-modal-parent': 'parent',
78
  'change .media-modal-render-tabs': 'renderTabs',
79
  'change .media-modal-render-panels': 'renderPanels',
80
  'change .media-modal-render-info': 'renderInfo',
81
- 'change .media-modal-render-datepicker-limit': 'renderDate',
82
  'submit .media-modal-form': 'submit',
83
  },
84
  templates: {},
85
  initialize: function () {
86
- _.bindAll(this, 'open', 'edit', 'parent', 'change', 'load', 'render', 'close', 'submit');
87
  this.init();
88
  this.open();
89
  },
@@ -94,26 +83,19 @@
94
  view.setElement(this.$(selector)).render();
95
  },
96
  render: function () {
97
-
98
  var modal = this;
99
  modal.$el.html(modal.templates.window(modal.model.attributes));
100
  this.tabs = new FieldViewTabs({model: modal.model});
101
  this.panels = new FieldViewPanels({model: modal.model});
102
- this.datepickerLimit = new FieldViewDatePickerLimit({model: modal.model});
103
  this.info = new FieldViewInfo({model: modal.model});
104
  this.assign(this.tabs, '#wooccm-modal-tabs');
105
  this.assign(this.panels, '#wooccm-modal-panels');
106
- this.assign(this.datepickerLimit, '#wooccm-modal-datepicker-limit');
107
  this.assign(this.info, '#wooccm-modal-info');
108
- // _.delay(function () {
109
- // modal.$el.trigger('wooccm-tab-panels');
110
- // }, 100);
111
-
112
  },
113
  load: function () {
114
 
115
  var modal = this;
116
-
117
  block();
118
 
119
  $.ajax({
@@ -170,55 +152,57 @@
170
  }, 300);
171
  },
172
  open: function (e) {
173
-
174
- this.load();
175
  $('body').addClass('modal-open').append(this.$el);
 
 
 
 
 
 
 
176
  },
177
- update: function (e) {
178
-
179
  e.preventDefault();
 
180
  var $field = $(e.target),
181
  name = $field.attr('name'),
182
  value = $field.val();
 
183
  if (e.target.type === 'checkbox') {
184
  value = $field.prop('checked') === true ? 1 : 0;
185
  }
186
-
187
  this.model.attributes[name] = value;
188
  this.model.changed[name] = value;
189
  },
190
- change: function (e) {
191
  e.preventDefault();
192
- this.update(e);
193
- this.enable();
 
 
 
 
 
 
 
 
 
 
 
 
194
  },
195
- renderTabs: function () {
 
196
  this.tabs.render();
197
  },
198
- renderPanels: function () {
 
199
  this.panels.render();
200
  },
201
  renderInfo: function () {
202
  this.info.render();
203
  },
204
- renderDate: function () {
205
- this.assign(this.datepickerLimit, '#wooccm-modal-datepicker-limit');
206
- this.datepickerLimit.render();
207
- },
208
- // table: function (e) {
209
- // e.preventDefault();
210
- //
211
- // var $field = $(e.target),
212
- // name = $field.attr('name'),
213
- // value = $field.val();
214
- //
215
- // if (e.target.type === 'checkbox') {
216
- // value = $field.prop('checked') === true ? 1 : 0;
217
- // }
218
- //
219
- // //$('tr[data-field_id="' + this.model.attributes.id + '"]').find('td.' + name).html(value);
220
- //
221
- // },
222
  close: function (e) {
223
  e.preventDefault();
224
  this.undelegateEvents();
@@ -231,7 +215,7 @@
231
  var modal = this,
232
  $modal = modal.$el.find('#wooccm_modal'),
233
  $details = $modal.find('.attachment-details');
234
- this.update(e);
235
  $.ajax({
236
  url: wooccm_field.ajax_url,
237
  data: {
@@ -242,14 +226,13 @@
242
  dataType: 'json',
243
  type: 'POST',
244
  beforeSend: function () {
245
- $('.media-modal-submit').attr('disabled', true);
246
  $details.addClass('save-waiting');
247
- //block($details);
248
  },
249
  complete: function () {
250
  $details.addClass('save-complete');
251
  $details.removeClass('save-waiting');
252
- //unblock($details);
253
  },
254
  error: function () {
255
  alert('Error!');
@@ -282,14 +265,18 @@
282
  this.reload(e);
283
  return;
284
  },
285
- enable: function (e) {
286
  $('.media-modal-submit').removeProp('disabled');
287
  },
 
 
 
288
  submit: function (e) {
289
  e.preventDefault();
290
  var modal = this,
291
  $modal = modal.$el.find('#wooccm_modal'),
292
  $details = $modal.find('.attachment-details');
 
293
  $.ajax({
294
  url: wooccm_field.ajax_url,
295
  data: {
26
  this.templates.window = wp.template('wooccm-modal-tabs');
27
  },
28
  render: function () {
29
+ this.model.attributes.panel = 'general';
30
  this.$el.html(this.templates.window(this.model.attributes));
31
+ //this.$el.trigger('wooccm-tab-panels');
 
 
 
 
 
 
 
 
 
 
 
32
  }
33
  });
34
  var FieldViewPanels = Backbone.View.extend({
56
  });
57
  var FieldView = Backbone.View.extend({
58
  events: {
59
+ 'change input': 'enableSave',
60
+ 'change textarea': 'enableSave',
61
+ 'change select': 'enableSave',
62
  'click .media-modal-backdrop': 'close',
63
  'click .media-modal-close': 'close',
64
  'click .media-modal-prev': 'edit',
65
  'click .media-modal-next': 'edit',
66
+ 'click .media-modal-tab': 'tab',
67
  'change .media-modal-parent': 'parent',
68
  'change .media-modal-render-tabs': 'renderTabs',
69
  'change .media-modal-render-panels': 'renderPanels',
70
  'change .media-modal-render-info': 'renderInfo',
 
71
  'submit .media-modal-form': 'submit',
72
  },
73
  templates: {},
74
  initialize: function () {
75
+ _.bindAll(this, 'tab', 'open', 'edit', 'parent', 'load', 'render', 'close', 'submit');
76
  this.init();
77
  this.open();
78
  },
83
  view.setElement(this.$(selector)).render();
84
  },
85
  render: function () {
 
86
  var modal = this;
87
  modal.$el.html(modal.templates.window(modal.model.attributes));
88
  this.tabs = new FieldViewTabs({model: modal.model});
89
  this.panels = new FieldViewPanels({model: modal.model});
 
90
  this.info = new FieldViewInfo({model: modal.model});
91
  this.assign(this.tabs, '#wooccm-modal-tabs');
92
  this.assign(this.panels, '#wooccm-modal-panels');
 
93
  this.assign(this.info, '#wooccm-modal-info');
 
 
 
 
94
  },
95
  load: function () {
96
 
97
  var modal = this;
98
+
99
  block();
100
 
101
  $.ajax({
152
  }, 300);
153
  },
154
  open: function (e) {
 
 
155
  $('body').addClass('modal-open').append(this.$el);
156
+ if (this.model.attributes.id == undefined) {
157
+ _.delay(function () {
158
+ unblock();
159
+ }, 100);
160
+ return;
161
+ }
162
+ this.load();
163
  },
164
+ updateModel: function (e) {
 
165
  e.preventDefault();
166
+
167
  var $field = $(e.target),
168
  name = $field.attr('name'),
169
  value = $field.val();
170
+
171
  if (e.target.type === 'checkbox') {
172
  value = $field.prop('checked') === true ? 1 : 0;
173
  }
174
+
175
  this.model.attributes[name] = value;
176
  this.model.changed[name] = value;
177
  },
178
+ tab: function (e) {
179
  e.preventDefault();
180
+
181
+ var modal = this,
182
+ $modal = modal.$el.find('#wooccm_modal'),
183
+ $tab = $(e.currentTarget),
184
+ $tabs = $modal.find('ul.wc-tabs'),
185
+ panel = $tab.find('a').attr('href').replace('#', '');
186
+
187
+ $tabs.find('.active').removeClass('active');
188
+ $tab.addClass('active');
189
+
190
+ this.model.attributes['panel'] = panel;
191
+ this.model.changed['panel'] = panel;
192
+
193
+ this.renderPanels(e);
194
  },
195
+ renderTabs: function (e) {
196
+ this.renderPanels(e);
197
  this.tabs.render();
198
  },
199
+ renderPanels: function (e) {
200
+ this.updateModel(e);
201
  this.panels.render();
202
  },
203
  renderInfo: function () {
204
  this.info.render();
205
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  close: function (e) {
207
  e.preventDefault();
208
  this.undelegateEvents();
215
  var modal = this,
216
  $modal = modal.$el.find('#wooccm_modal'),
217
  $details = $modal.find('.attachment-details');
218
+ this.updateModel(e);
219
  $.ajax({
220
  url: wooccm_field.ajax_url,
221
  data: {
226
  dataType: 'json',
227
  type: 'POST',
228
  beforeSend: function () {
229
+ modal.disableSave();
230
  $details.addClass('save-waiting');
 
231
  },
232
  complete: function () {
233
  $details.addClass('save-complete');
234
  $details.removeClass('save-waiting');
235
+ modal.enableSave();
236
  },
237
  error: function () {
238
  alert('Error!');
265
  this.reload(e);
266
  return;
267
  },
268
+ enableSave: function (e) {
269
  $('.media-modal-submit').removeProp('disabled');
270
  },
271
+ disableSave: function (e) {
272
+ $('.media-modal-submit').prop('disabled', true);
273
+ },
274
  submit: function (e) {
275
  e.preventDefault();
276
  var modal = this,
277
  $modal = modal.$el.find('#wooccm_modal'),
278
  $details = $modal.find('.attachment-details');
279
+
280
  $.ajax({
281
  url: wooccm_field.ajax_url,
282
  data: {
assets/backend/js/wooccm-admin-field.min.js CHANGED
@@ -1 +1 @@
1
- (function(f){var h=0,b;var e=function(n){return n.is(".processing")||n.parents(".processing").length};var d=function(){f("#wooccm_modal").addClass("processing")};var g=function(){f("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(n){return _.sortBy(n,function(p){return p.order})}});var c=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-tabs")},render:function(){this.$el.html(this.templates.window(this.model.attributes));this.$el.trigger("wooccm-tab-panels")}});var l=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-datepicker-limit")},render:function(){this.$el.html(this.templates.window(this.model.attributes));this.$el.trigger("wooccm-enhanced-between-dates");this.$el.trigger("init_tooltips")}});var m=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes));this.$el.trigger("wooccm-enhanced-options");this.$el.trigger("wooccm-enhanced-select");this.$el.trigger("init_tooltips")}});var k=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-info")},render:function(){this.$el.html(this.templates.window(this.model.attributes));this.$el.trigger("wooccm-enhanced-select");this.$el.trigger("init_tooltips")}});var j=Backbone.View.extend({events:{"change input":"enable","change textarea":"enable","change select":"enable","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","change .media-modal-change":"change","change .media-modal-parent":"parent","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","change .media-modal-render-info":"renderInfo","change .media-modal-render-datepicker-limit":"renderDate","submit .media-modal-form":"submit",},templates:{},initialize:function(){_.bindAll(this,"open","edit","parent","change","load","render","close","submit");this.init();this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(o,n){o.setElement(this.$(n)).render()},render:function(){var n=this;n.$el.html(n.templates.window(n.model.attributes));this.tabs=new c({model:n.model});this.panels=new m({model:n.model});this.datepickerLimit=new l({model:n.model});this.info=new k({model:n.model});this.assign(this.tabs,"#wooccm-modal-tabs");this.assign(this.panels,"#wooccm-modal-panels");this.assign(this.datepickerLimit,"#wooccm-modal-datepicker-limit");this.assign(this.info,"#wooccm-modal-info")},load:function(){var n=this;d();f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_field",nonce:wooccm_field.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){g()},error:function(){alert("Error!")},success:function(o){if(o.success){n.model.set(o.data);n.render()}else{alert(o.data)}}})},edit:function(r){r.preventDefault();var p=this,q=f(r.target),o=parseInt(f(".wc_gateways tr[data-field_id]").length),n=parseInt(p.model.get("order"));h++;if(b){clearTimeout(b)}b=setTimeout(function(){if(q.hasClass("media-modal-next")){n=Math.min(n+h,o)}else{n=Math.max(n-h,1)}p.model.set({id:parseInt(f(".wc_gateways tr[data-field_order="+n+"]").data("field_id"))});h=0;p.load()},300)},open:function(n){this.load();f("body").addClass("modal-open").append(this.$el)},update:function(q){q.preventDefault();var o=f(q.target),n=o.attr("name"),p=o.val();if(q.target.type==="checkbox"){p=o.prop("checked")===true?1:0}this.model.attributes[n]=p;this.model.changed[n]=p},change:function(n){n.preventDefault();this.update(n);this.enable()},renderTabs:function(){this.tabs.render()},renderPanels:function(){this.panels.render()},renderInfo:function(){this.info.render()},renderDate:function(){this.assign(this.datepickerLimit,"#wooccm-modal-datepicker-limit");this.datepickerLimit.render()},close:function(n){n.preventDefault();this.undelegateEvents();f(document).off("focusin");f("body").removeClass("modal-open");this.remove()},parent:function(q){q.preventDefault();var p=this,o=p.$el.find("#wooccm_modal"),n=o.find(".attachment-details");this.update(q);f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:p.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){f(".media-modal-submit").attr("disabled",true);n.addClass("save-waiting")},complete:function(){n.addClass("save-complete");n.removeClass("save-waiting")},error:function(){alert("Error!")},success:function(r){if(r.success){p.model.attributes.parent=r.data;p.model.changed.parent=r.data;p.renderInfo()}else{alert(r.data)}}});return false},reload:function(n){if(this.$el.find("#wooccm_modal").hasClass("reload")){location.reload();return}this.remove();return},close:function(n){n.preventDefault();this.undelegateEvents();f(document).off("focusin");f("body").removeClass("modal-open");this.reload(n);return},enable:function(n){f(".media-modal-submit").removeProp("disabled")},submit:function(q){q.preventDefault();var p=this,o=p.$el.find("#wooccm_modal"),n=o.find(".attachment-details");f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_id:p.model.attributes.id,field_data:f("form",this.$el).serialize()},dataType:"json",type:"POST",beforeSend:function(){f(".media-modal-submit").prop("disabled",true);n.addClass("save-waiting");d()},complete:function(){n.addClass("save-complete");n.removeClass("save-waiting");g()},error:function(){alert("Error!")},success:function(r){if(r.success){if(p.model.attributes.id==undefined){o.addClass("reload");p.close(q)}p.model.set(r.data)}else{alert(r.data)}}});return false}});var i=Backbone.Model.extend({defaults:wooccm_field.args});var a=Backbone.View.extend({initialize:function(q){var p=f(q.target),o=p.closest("[data-field_id]").data("field_id");var n=new i();n.set({id:o});new j({model:n}).render()},});f("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",function(n){n.preventDefault();new a(n)});f("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",function(o){o.preventDefault();var n=f(o.target);var p=confirm(wooccm_field.message.reset);if(!p){return false}f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_reset_fields",nonce:wooccm_field.nonce},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(q){if(q.success){location.reload()}else{alert(q.data)}}});return false});f(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",function(n){n.preventDefault();new a(n)});f(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",function(q){q.preventDefault();var p=f(q.target),o=p.closest("[data-field_id]"),n=o.data("field_id");var r=confirm(wooccm_field.message.remove);if(!r){return false}f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:n,},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(s){if(s.success){o.remove()}else{alert(s.data)}}});return false});f(document).on("click",".wooccm-field-toggle-attribute",function(q){q.preventDefault();var n=f(this),p=n.closest("tr"),o=n.find(".woocommerce-input-toggle");f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:f(this).data("field_attr"),field_id:p.data("field_id")},dataType:"json",type:"POST",beforeSend:function(r){o.addClass("woocommerce-input-toggle--loading")},success:function(r){if(true===r.data){o.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");o.addClass("woocommerce-input-toggle--enabled");o.removeClass("woocommerce-input-toggle--loading")}else{if(true!==r.data){o.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");o.addClass("woocommerce-input-toggle--disabled");o.removeClass("woocommerce-input-toggle--loading")}}}});return false});f(document).on("change",".wooccm-field-change-attribute",function(p){p.preventDefault();var n=f(this),o=n.closest("tr");f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:n.data("field_attr"),field_value:n.val(),field_id:o.data("field_id"),},dataType:"json",type:"POST",beforeSend:function(q){n.prop("disabled",true)},success:function(q){console.log(q.data)},complete:function(q){n.prop("disabled",false)},});return false})})(jQuery);
1
+ (function(f){var h=0,b;var e=function(m){return m.is(".processing")||m.parents(".processing").length};var d=function(){f("#wooccm_modal").addClass("processing")};var g=function(){f("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(m){return _.sortBy(m,function(n){return n.order})}});var c=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-tabs")},render:function(){this.model.attributes.panel="general";this.$el.html(this.templates.window(this.model.attributes))}});var l=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes));this.$el.trigger("wooccm-enhanced-options");this.$el.trigger("wooccm-enhanced-select");this.$el.trigger("init_tooltips")}});var k=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-info")},render:function(){this.$el.html(this.templates.window(this.model.attributes));this.$el.trigger("wooccm-enhanced-select");this.$el.trigger("init_tooltips")}});var j=Backbone.View.extend({events:{"change input":"enableSave","change textarea":"enableSave","change select":"enableSave","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","click .media-modal-tab":"tab","change .media-modal-parent":"parent","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","change .media-modal-render-info":"renderInfo","submit .media-modal-form":"submit",},templates:{},initialize:function(){_.bindAll(this,"tab","open","edit","parent","load","render","close","submit");this.init();this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(n,m){n.setElement(this.$(m)).render()},render:function(){var m=this;m.$el.html(m.templates.window(m.model.attributes));this.tabs=new c({model:m.model});this.panels=new l({model:m.model});this.info=new k({model:m.model});this.assign(this.tabs,"#wooccm-modal-tabs");this.assign(this.panels,"#wooccm-modal-panels");this.assign(this.info,"#wooccm-modal-info")},load:function(){var m=this;d();f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_field",nonce:wooccm_field.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){g()},error:function(){alert("Error!")},success:function(n){if(n.success){m.model.set(n.data);m.render()}else{alert(n.data)}}})},edit:function(q){q.preventDefault();var o=this,p=f(q.target),n=parseInt(f(".wc_gateways tr[data-field_id]").length),m=parseInt(o.model.get("order"));h++;if(b){clearTimeout(b)}b=setTimeout(function(){if(p.hasClass("media-modal-next")){m=Math.min(m+h,n)}else{m=Math.max(m-h,1)}o.model.set({id:parseInt(f(".wc_gateways tr[data-field_order="+m+"]").data("field_id"))});h=0;o.load()},300)},open:function(m){f("body").addClass("modal-open").append(this.$el);if(this.model.attributes.id==undefined){_.delay(function(){g()},100);return}this.load()},updateModel:function(p){p.preventDefault();var n=f(p.target),m=n.attr("name"),o=n.val();if(p.target.type==="checkbox"){o=n.prop("checked")===true?1:0}this.model.attributes[m]=o;this.model.changed[m]=o},tab:function(r){r.preventDefault();var p=this,o=p.$el.find("#wooccm_modal"),q=f(r.currentTarget),m=o.find("ul.wc-tabs"),n=q.find("a").attr("href").replace("#","");m.find(".active").removeClass("active");q.addClass("active");this.model.attributes.panel=n;this.model.changed.panel=n;this.renderPanels(r)},renderTabs:function(m){this.renderPanels(m);this.tabs.render()},renderPanels:function(m){this.updateModel(m);this.panels.render()},renderInfo:function(){this.info.render()},close:function(m){m.preventDefault();this.undelegateEvents();f(document).off("focusin");f("body").removeClass("modal-open");this.remove()},parent:function(p){p.preventDefault();var o=this,n=o.$el.find("#wooccm_modal"),m=n.find(".attachment-details");this.updateModel(p);f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:o.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){o.disableSave();m.addClass("save-waiting")},complete:function(){m.addClass("save-complete");m.removeClass("save-waiting");o.enableSave()},error:function(){alert("Error!")},success:function(q){if(q.success){o.model.attributes.parent=q.data;o.model.changed.parent=q.data;o.renderInfo()}else{alert(q.data)}}});return false},reload:function(m){if(this.$el.find("#wooccm_modal").hasClass("reload")){location.reload();return}this.remove();return},close:function(m){m.preventDefault();this.undelegateEvents();f(document).off("focusin");f("body").removeClass("modal-open");this.reload(m);return},enableSave:function(m){f(".media-modal-submit").removeProp("disabled")},disableSave:function(m){f(".media-modal-submit").prop("disabled",true)},submit:function(p){p.preventDefault();var o=this,n=o.$el.find("#wooccm_modal"),m=n.find(".attachment-details");f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_id:o.model.attributes.id,field_data:f("form",this.$el).serialize()},dataType:"json",type:"POST",beforeSend:function(){f(".media-modal-submit").prop("disabled",true);m.addClass("save-waiting");d()},complete:function(){m.addClass("save-complete");m.removeClass("save-waiting");g()},error:function(){alert("Error!")},success:function(q){if(q.success){if(o.model.attributes.id==undefined){n.addClass("reload");o.close(p)}o.model.set(q.data)}else{alert(q.data)}}});return false}});var i=Backbone.Model.extend({defaults:wooccm_field.args});var a=Backbone.View.extend({initialize:function(p){var o=f(p.target),n=o.closest("[data-field_id]").data("field_id");var m=new i();m.set({id:n});new j({model:m}).render()},});f("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",function(m){m.preventDefault();new a(m)});f("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",function(n){n.preventDefault();var m=f(n.target);var o=confirm(wooccm_field.message.reset);if(!o){return false}f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_reset_fields",nonce:wooccm_field.nonce},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(p){if(p.success){location.reload()}else{alert(p.data)}}});return false});f(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",function(m){m.preventDefault();new a(m)});f(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",function(p){p.preventDefault();var o=f(p.target),n=o.closest("[data-field_id]"),m=n.data("field_id");var q=confirm(wooccm_field.message.remove);if(!q){return false}f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:m,},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(r){if(r.success){n.remove()}else{alert(r.data)}}});return false});f(document).on("click",".wooccm-field-toggle-attribute",function(p){p.preventDefault();var m=f(this),o=m.closest("tr"),n=m.find(".woocommerce-input-toggle");f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:f(this).data("field_attr"),field_id:o.data("field_id")},dataType:"json",type:"POST",beforeSend:function(q){n.addClass("woocommerce-input-toggle--loading")},success:function(q){if(true===q.data){n.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");n.addClass("woocommerce-input-toggle--enabled");n.removeClass("woocommerce-input-toggle--loading")}else{if(true!==q.data){n.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");n.addClass("woocommerce-input-toggle--disabled");n.removeClass("woocommerce-input-toggle--loading")}}}});return false});f(document).on("change",".wooccm-field-change-attribute",function(o){o.preventDefault();var m=f(this),n=m.closest("tr");f.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:m.data("field_attr"),field_value:m.val(),field_id:n.data("field_id"),},dataType:"json",type:"POST",beforeSend:function(p){m.prop("disabled",true)},success:function(p){console.log(p.data)},complete:function(p){m.prop("disabled",false)},});return false})})(jQuery);
assets/backend/js/wooccm-admin.js CHANGED
@@ -56,36 +56,6 @@
56
  };
57
  }
58
 
59
- $(document).on('wooccm-tab-panels', function (e, active) {
60
-
61
- var $modal = $(e.target),
62
- $tabs = $modal.find('ul.wc-tabs'),
63
- $active = $tabs.find('a[href="' + active + '"]');
64
-
65
- $tabs.show();
66
-
67
- $tabs.find('a').click(function (e) {
68
- e.preventDefault();
69
-
70
- var panel_wrap = $(this).closest('div.panel-wrap');
71
-
72
- $tabs.find('li', panel_wrap).removeClass('active');
73
-
74
- $(this).parent().addClass('active');
75
-
76
- $('div.panel', panel_wrap).hide();
77
-
78
- $($(this).attr('href')).show();
79
- });
80
-
81
- if ($active.length && $($active.attr('href')).length) {
82
- $active.click();
83
- } else {
84
- $tabs.find('li.active').find('a').click();
85
- }
86
-
87
- });
88
-
89
  $(document).on('wooccm-enhanced-between-dates', function (e) {
90
 
91
  $('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
56
  };
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  $(document).on('wooccm-enhanced-between-dates', function (e) {
60
 
61
  $('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
assets/backend/js/wooccm-admin.min.js CHANGED
@@ -1 +1 @@
1
- (function(b){b(".wooccm-premium-field").closest("tr").addClass("wooccm-premium");function c(f){var e=b(f).next().is(".hasDatepicker")?"minDate":"maxDate",g="minDate"===e?b(f).next():b(f).prev(),d=b(f).datepicker("getDate");b(g).datepicker("option",e,d);b(f).change()}function a(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(d){var e=d.input.length-d.maximum;if(1===e){return wc_enhanced_select_params.i18n_input_too_long_1}return wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",e)},inputTooShort:function(d){var e=d.minimum-d.input.length;if(1===e){return wc_enhanced_select_params.i18n_input_too_short_1}return wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",e)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(d){if(d.maximum===1){return wc_enhanced_select_params.i18n_selection_too_long_1}return wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",d.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}b(document).on("wooccm-tab-panels",function(i,h){var g=b(i.target),f=g.find("ul.wc-tabs"),d=f.find('a[href="'+h+'"]');f.show();f.find("a").click(function(k){k.preventDefault();var j=b(this).closest("div.panel-wrap");f.find("li",j).removeClass("active");b(this).parent().addClass("active");b("div.panel",j).hide();b(b(this).attr("href")).show()});if(d.length&&b(d.attr("href")).length){d.click()}else{f.find("li.active").find("a").click()}});b(document).on("wooccm-enhanced-between-dates",function(d){b(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each(function(){b(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:true,onSelect:function(){c(b(this))}});b(this).find("input").each(function(){c(b(this))})})});b(document).on("wooccm-enhanced-options",function(d){b("table.wc_gateways tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(e,f){f.children().each(function(){b(this).width(b(this).width())});f.css("left","0");return f},start:function(e,f){f.item.css("background-color","#f6f6f6")},stop:function(e,f){f.item.removeAttr("style");f.item.trigger("updateMoveButtons")},update:function(e,f){b(this).find("tr").each(function(g,h){b(h).find("input.add-order").val(g).trigger("change")})}});b(".wooccm-enhanced-options").each(function(){var f=b(this),g=f.find(".add-option"),e=f.find(".remove-options");g.on("click",function(j){var h=f.find("tbody > tr"),k=h.length,i=h.first().clone().html().replace(/options\[([0-9]+)\]/g,"options["+k+"]").replace('disabled="disabled"',"").replace('checked="checked"',"").replace('<input value="0"','<input value="'+k+'"').replace('<input value="0"','<input value="'+k+'"');h.last().after(b("<tr>"+i+"</tr>")).find("input").trigger("change");e.removeProp("disabled")});e.on("click",function(i){f.find("tr > td.check-column input:checked").closest("tr").remove();var h=f.find("tbody > tr");if(h.length<2){b(this).prop("disabled",true)}})})});b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-select").filter(":not(.enhanced)").each(function(){var e=b.extend({minimumResultsForSearch:10,allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder")},a());b(this).selectWoo(e).addClass("enhanced")});b(".wooccm-product-search").filter(":not(.enhanced)").each(function(){var g={allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder"),minimumInputLength:b(this).data("minimum_input_length")?b(this).data("minimum_input_length"):"3",escapeMarkup:function(h){return h},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(h){return{term:h.term,action:b(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:b(this).select2("val")||0,exclude:b(this).data("exclude"),include:b(this).data("include"),limit:b(this).data("limit"),display_stock:b(this).data("display_stock")}},processResults:function(i){var h=[];if(i){b.each(i,function(k,j){h.push({id:k,text:j})})}return{results:h}},cache:true}};g=b.extend(g,a());b(this).selectWoo(g).addClass("enhanced");if(b(this).data("sortable")){var f=b(this);var e=b(this).next(".select2-container").find("ul.select2-selection__rendered");e.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:true,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){b(e.find(".select2-selection__choice").get().reverse()).each(function(){var i=b(this).data("data").id;var h=f.find('option[value="'+i+'"]')[0];f.prepend(h)})}})}else{if(b(this).prop("multiple")){b(this).on("change",function(){var h=b(this).children();h.sort(function(j,i){var l=j.text.toLowerCase();var k=i.text.toLowerCase();if(l>k){return 1}if(l<k){return -1}return 0});b(this).html(h)})}}})});b(".wooccm-enhanced-search").filter(":not(.enhanced)").each(function(){var d={allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder"),minimumInputLength:b(this).data("minimum_input_length")||"3",escapeMarkup:function(e){return e},ajax:{url:wooccm_admin.ajax_url,dataType:"json",cache:true,delay:250,data:function(e){return{term:e.term,key:b(this).data("key"),action:"wooccm_search_field",nonce:wooccm_admin.nonce,}},processResults:function(f,g){var e=[];if(f){b.each(f,function(i,h){e.push({id:i,text:h})})}return{results:e}}}};d=b.extend(d,a());b(this).select2(d).addClass("enhanced")})})(jQuery);
1
+ (function(b){b(".wooccm-premium-field").closest("tr").addClass("wooccm-premium");function c(f){var e=b(f).next().is(".hasDatepicker")?"minDate":"maxDate",g="minDate"===e?b(f).next():b(f).prev(),d=b(f).datepicker("getDate");b(g).datepicker("option",e,d);b(f).change()}function a(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(d){var e=d.input.length-d.maximum;if(1===e){return wc_enhanced_select_params.i18n_input_too_long_1}return wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",e)},inputTooShort:function(d){var e=d.minimum-d.input.length;if(1===e){return wc_enhanced_select_params.i18n_input_too_short_1}return wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",e)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(d){if(d.maximum===1){return wc_enhanced_select_params.i18n_selection_too_long_1}return wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",d.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}b(document).on("wooccm-enhanced-between-dates",function(d){b(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each(function(){b(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:true,onSelect:function(){c(b(this))}});b(this).find("input").each(function(){c(b(this))})})});b(document).on("wooccm-enhanced-options",function(d){b("table.wc_gateways tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(e,f){f.children().each(function(){b(this).width(b(this).width())});f.css("left","0");return f},start:function(e,f){f.item.css("background-color","#f6f6f6")},stop:function(e,f){f.item.removeAttr("style");f.item.trigger("updateMoveButtons")},update:function(e,f){b(this).find("tr").each(function(g,h){b(h).find("input.add-order").val(g).trigger("change")})}});b(".wooccm-enhanced-options").each(function(){var f=b(this),g=f.find(".add-option"),e=f.find(".remove-options");g.on("click",function(j){var h=f.find("tbody > tr"),k=h.length,i=h.first().clone().html().replace(/options\[([0-9]+)\]/g,"options["+k+"]").replace('disabled="disabled"',"").replace('checked="checked"',"").replace('<input value="0"','<input value="'+k+'"').replace('<input value="0"','<input value="'+k+'"');h.last().after(b("<tr>"+i+"</tr>")).find("input").trigger("change");e.removeProp("disabled")});e.on("click",function(i){f.find("tr > td.check-column input:checked").closest("tr").remove();var h=f.find("tbody > tr");if(h.length<2){b(this).prop("disabled",true)}})})});b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-select").filter(":not(.enhanced)").each(function(){var e=b.extend({minimumResultsForSearch:10,allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder")},a());b(this).selectWoo(e).addClass("enhanced")});b(".wooccm-product-search").filter(":not(.enhanced)").each(function(){var g={allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder"),minimumInputLength:b(this).data("minimum_input_length")?b(this).data("minimum_input_length"):"3",escapeMarkup:function(h){return h},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(h){return{term:h.term,action:b(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:b(this).select2("val")||0,exclude:b(this).data("exclude"),include:b(this).data("include"),limit:b(this).data("limit"),display_stock:b(this).data("display_stock")}},processResults:function(i){var h=[];if(i){b.each(i,function(k,j){h.push({id:k,text:j})})}return{results:h}},cache:true}};g=b.extend(g,a());b(this).selectWoo(g).addClass("enhanced");if(b(this).data("sortable")){var f=b(this);var e=b(this).next(".select2-container").find("ul.select2-selection__rendered");e.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:true,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){b(e.find(".select2-selection__choice").get().reverse()).each(function(){var i=b(this).data("data").id;var h=f.find('option[value="'+i+'"]')[0];f.prepend(h)})}})}else{if(b(this).prop("multiple")){b(this).on("change",function(){var h=b(this).children();h.sort(function(j,i){var l=j.text.toLowerCase();var k=i.text.toLowerCase();if(l>k){return 1}if(l<k){return -1}return 0});b(this).html(h)})}}})});b(".wooccm-enhanced-search").filter(":not(.enhanced)").each(function(){var d={allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder"),minimumInputLength:b(this).data("minimum_input_length")||"3",escapeMarkup:function(e){return e},ajax:{url:wooccm_admin.ajax_url,dataType:"json",cache:true,delay:250,data:function(e){return{term:e.term,key:b(this).data("key"),action:"wooccm_search_field",nonce:wooccm_admin.nonce,}},processResults:function(f,g){var e=[];if(f){b.each(f,function(i,h){e.push({id:i,text:h})})}return{results:e}}}};d=b.extend(d,a());b(this).select2(d).addClass("enhanced")})})(jQuery);
includes/controller/class-wooccm-field.php CHANGED
@@ -23,9 +23,9 @@ class WOOCCM_Field_Controller {
23
 
24
  global $current_section;
25
 
26
- wp_register_script('wooccm-field', plugins_url('assets/backend/js/wooccm-admin-field.js', WOOCCM_PLUGIN_FILE), array('jquery', 'jquery-ui-datepicker', 'backbone', 'wp-util'), WOOCCM_PLUGIN_VERSION, true);
27
 
28
- wp_localize_script('wooccm-field', 'wooccm_field', array(
29
  'ajax_url' => admin_url('admin-ajax.php?section=' . $current_section),
30
  'nonce' => wp_create_nonce('wooccm_field'),
31
  'args' => WOOCCM()->billing->get_args(),
@@ -37,7 +37,7 @@ class WOOCCM_Field_Controller {
37
 
38
  if (isset($_GET['tab']) && $_GET['tab'] === WOOCCM_PREFIX) {
39
  wp_enqueue_style('media-views');
40
- wp_enqueue_script('wooccm-field');
41
  }
42
  }
43
 
@@ -505,6 +505,7 @@ class WOOCCM_Field_Controller {
505
  $option = WOOCCM()->billing->get_option_types();
506
  $multiple = WOOCCM()->billing->get_multiple_types();
507
  $template = WOOCCM()->billing->get_template_types();
 
508
  $product_categories = $this->get_product_categories();
509
 
510
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/billing.php' );
@@ -545,6 +546,7 @@ class WOOCCM_Field_Controller {
545
  $option = WOOCCM()->billing->get_option_types();
546
  $multiple = WOOCCM()->billing->get_multiple_types();
547
  $template = WOOCCM()->billing->get_template_types();
 
548
  $product_categories = $this->get_product_categories();
549
 
550
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/shipping.php' );
@@ -564,6 +566,7 @@ class WOOCCM_Field_Controller {
564
  $option = WOOCCM()->billing->get_option_types();
565
  $multiple = WOOCCM()->billing->get_multiple_types();
566
  $template = WOOCCM()->billing->get_template_types();
 
567
  $product_categories = $this->get_product_categories();
568
  $settings = $this->get_additional_settings();
569
 
@@ -581,7 +584,7 @@ class WOOCCM_Field_Controller {
581
  if (!is_admin()) {
582
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-register.php' );
583
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-additional.php' );
584
- include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-display.php' );
585
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-conditional.php' );
586
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-handler.php' );
587
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-i18n.php' );
23
 
24
  global $current_section;
25
 
26
+ wp_register_script('wooccm-admin-field', plugins_url('assets/backend/js/wooccm-admin-field.js', WOOCCM_PLUGIN_FILE), array('jquery', 'jquery-ui-datepicker', 'backbone', 'wp-util'), WOOCCM_PLUGIN_VERSION, true);
27
 
28
+ wp_localize_script('wooccm-admin-field', 'wooccm_field', array(
29
  'ajax_url' => admin_url('admin-ajax.php?section=' . $current_section),
30
  'nonce' => wp_create_nonce('wooccm_field'),
31
  'args' => WOOCCM()->billing->get_args(),
37
 
38
  if (isset($_GET['tab']) && $_GET['tab'] === WOOCCM_PREFIX) {
39
  wp_enqueue_style('media-views');
40
+ wp_enqueue_script('wooccm-admin-field');
41
  }
42
  }
43
 
505
  $option = WOOCCM()->billing->get_option_types();
506
  $multiple = WOOCCM()->billing->get_multiple_types();
507
  $template = WOOCCM()->billing->get_template_types();
508
+ $disabled = WOOCCM()->billing->get_disabled_types();
509
  $product_categories = $this->get_product_categories();
510
 
511
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/billing.php' );
546
  $option = WOOCCM()->billing->get_option_types();
547
  $multiple = WOOCCM()->billing->get_multiple_types();
548
  $template = WOOCCM()->billing->get_template_types();
549
+ $disabled = WOOCCM()->billing->get_disabled_types();
550
  $product_categories = $this->get_product_categories();
551
 
552
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/shipping.php' );
566
  $option = WOOCCM()->billing->get_option_types();
567
  $multiple = WOOCCM()->billing->get_multiple_types();
568
  $template = WOOCCM()->billing->get_template_types();
569
+ $disabled = WOOCCM()->billing->get_disabled_types();
570
  $product_categories = $this->get_product_categories();
571
  $settings = $this->get_additional_settings();
572
 
584
  if (!is_admin()) {
585
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-register.php' );
586
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-additional.php' );
587
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-disable.php' );
588
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-conditional.php' );
589
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-handler.php' );
590
  include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-i18n.php' );
includes/model/class-wooccm-field.php CHANGED
@@ -82,18 +82,28 @@ class WOOCCM_Field {
82
 
83
  return array(
84
  'heading',
85
- 'button',
86
  'message',
 
87
  'file',
88
- 'country',
89
- 'state'
90
  );
91
  }
92
 
 
 
 
 
 
 
 
 
93
  public function get_types() {
94
 
95
- return apply_filters('wooccm_fields_fields_types', array(
96
  'heading' => 'Heading',
 
 
97
  'text' => 'Text',
98
  'textarea' => 'Textarea',
99
  'password' => 'Password',
@@ -108,9 +118,6 @@ class WOOCCM_Field {
108
  'multicheckbox' => 'Multicheckbox',
109
  'colorpicker' => 'Colorpicker',
110
  'file' => 'File',
111
- //'button' => 'Button',
112
- //'datepicker' => 'Datepicker',
113
- //'timepicker' => 'Timepicker',
114
  ));
115
  }
116
 
@@ -126,6 +133,7 @@ class WOOCCM_Field {
126
  'priority' => null,
127
  'label' => '',
128
  'placeholder' => '',
 
129
  'default' => '',
130
  'position' => '',
131
  'clear' => false,
@@ -140,9 +148,14 @@ class WOOCCM_Field {
140
  )
141
  ),
142
  'required' => false,
 
 
 
143
  'class' => array(),
144
  // Display
145
  // -------------------------------------------------------------------
 
 
146
  'show_role' => array(),
147
  'hide_role' => array(),
148
  'more_product' => false,
@@ -154,7 +167,8 @@ class WOOCCM_Field {
154
  'hide_checkout' => false,
155
  'hide_email' => false,
156
  'hide_order' => false,
157
- // Timing
 
158
  // -------------------------------------------------------------------
159
  'time_limit_start' => null,
160
  'time_limit_end' => null,
82
 
83
  return array(
84
  'heading',
 
85
  'message',
86
+ 'button',
87
  'file',
88
+ // 'country',
89
+ // 'state'
90
  );
91
  }
92
 
93
+ public function get_disabled_types() {
94
+
95
+ return apply_filters('wooccm_fields_disabled_types', array(
96
+ 'message',
97
+ 'button',
98
+ ));
99
+ }
100
+
101
  public function get_types() {
102
 
103
+ return apply_filters('wooccm_fields_types', array(
104
  'heading' => 'Heading',
105
+ 'message' => 'Message',
106
+ 'button' => 'Button',
107
  'text' => 'Text',
108
  'textarea' => 'Textarea',
109
  'password' => 'Password',
118
  'multicheckbox' => 'Multicheckbox',
119
  'colorpicker' => 'Colorpicker',
120
  'file' => 'File',
 
 
 
121
  ));
122
  }
123
 
133
  'priority' => null,
134
  'label' => '',
135
  'placeholder' => '',
136
+ 'description' => '',
137
  'default' => '',
138
  'position' => '',
139
  'clear' => false,
148
  )
149
  ),
150
  'required' => false,
151
+ 'message_type' => 'info',
152
+ 'button_type' => '',
153
+ 'button_link' => '',
154
  'class' => array(),
155
  // Display
156
  // -------------------------------------------------------------------
157
+ 'show_cart_minimum' => 0,
158
+ 'show_cart_maximun' => 0,
159
  'show_role' => array(),
160
  'hide_role' => array(),
161
  'more_product' => false,
167
  'hide_checkout' => false,
168
  'hide_email' => false,
169
  'hide_order' => false,
170
+ 'hide_invoice' => false,
171
+ // Pickers
172
  // -------------------------------------------------------------------
173
  'time_limit_start' => null,
174
  'time_limit_end' => null,
includes/view/backend/pages/modals/field.php CHANGED
@@ -6,27 +6,15 @@
6
  </script>
7
  <script type="text/html" id='tmpl-wooccm-modal-panels'>
8
  <?php include_once( 'parts/panel-general.php' ); ?>
9
- <# if ( _.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
10
  <?php include_once( 'parts/panel-select2.php' ); ?>
11
- <# } #>
12
- <# if ( _.contains(<?php echo json_encode($option); ?>, data.type)) { #>
13
  <?php include_once( 'parts/panel-options.php' ); ?>
14
- <# } #>
15
  <?php include_once( 'parts/panel-display.php' ); ?>
16
- <# if ( !_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
17
  <?php include_once( 'parts/panel-price.php' ); ?>
18
- <# } #>
19
- <# if (data.type == 'date') { #>
20
  <?php include_once( 'parts/panel-datepicker.php' ); ?>
21
- <# } #>
22
- <# if (data.type == 'time') { #>
23
  <?php include_once( 'parts/panel-timepicker.php' ); ?>
24
- <# } #>
25
  <?php include_once( 'parts/panel-admin.php' ); ?>
26
  </script>
27
- <script type="text/html" id='tmpl-wooccm-modal-datepicker-limit'>
28
- <?php include_once( 'parts/panel-datepicker-limit.php' ); ?>
29
- </script>
30
  <script type="text/html" id='tmpl-wooccm-modal-info'>
31
  <?php include_once( 'parts/info.php' ); ?>
32
  </script>
6
  </script>
7
  <script type="text/html" id='tmpl-wooccm-modal-panels'>
8
  <?php include_once( 'parts/panel-general.php' ); ?>
 
9
  <?php include_once( 'parts/panel-select2.php' ); ?>
 
 
10
  <?php include_once( 'parts/panel-options.php' ); ?>
11
+ <?php include_once( 'parts/panel-filter.php' ); ?>
12
  <?php include_once( 'parts/panel-display.php' ); ?>
 
13
  <?php include_once( 'parts/panel-price.php' ); ?>
 
 
14
  <?php include_once( 'parts/panel-datepicker.php' ); ?>
 
 
15
  <?php include_once( 'parts/panel-timepicker.php' ); ?>
 
16
  <?php include_once( 'parts/panel-admin.php' ); ?>
17
  </script>
 
 
 
18
  <script type="text/html" id='tmpl-wooccm-modal-info'>
19
  <?php include_once( 'parts/info.php' ); ?>
20
  </script>
includes/view/backend/pages/modals/parts/main.php CHANGED
@@ -18,7 +18,7 @@
18
  <h1><?php esc_html_e('Edit field', 'woocommerce-checkout-manager'); ?> #<# if ( data.id != undefined ) { #>{{data.id}}<# } else { #><?php echo esc_html_e('New', 'woocommerce-checkout-manager'); ?><# } #></h1>
19
  </div>
20
  <div class="media-frame-content" style="bottom:61px;">
21
- <div class="attachment-details">
22
  <div class="attachment-media-view landscape">
23
  <div id="woocommerce-product-data" style="height:100%;">
24
  <div class="panel-wrap" style="height:100%;">
@@ -37,7 +37,7 @@
37
  <div class="media-toolbar">
38
  <div class="media-toolbar-secondary"></div>
39
  <div class="media-toolbar-primary search-form">
40
- <button type="submit" class="media-modal-submit button button-primary media-button button-large" disabled="disabled"><?php esc_html_e('Save'); ?></button>
41
  <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
42
  height: auto;
43
  float: none;
18
  <h1><?php esc_html_e('Edit field', 'woocommerce-checkout-manager'); ?> #<# if ( data.id != undefined ) { #>{{data.id}}<# } else { #><?php echo esc_html_e('New', 'woocommerce-checkout-manager'); ?><# } #></h1>
19
  </div>
20
  <div class="media-frame-content" style="bottom:61px;">
21
+ <div class="attachment-details" style="overflow: hidden;">
22
  <div class="attachment-media-view landscape">
23
  <div id="woocommerce-product-data" style="height:100%;">
24
  <div class="panel-wrap" style="height:100%;">
37
  <div class="media-toolbar">
38
  <div class="media-toolbar-secondary"></div>
39
  <div class="media-toolbar-primary search-form">
40
+ <button type="submit" class="media-modal-submit button button-primary media-button button-large" <# if ( data.id != undefined ) { #>disabled="disabled"<# } #>><?php esc_html_e('Save'); ?></button>
41
  <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
42
  height: auto;
43
  float: none;
includes/view/backend/pages/modals/parts/panel-admin.php CHANGED
@@ -1,22 +1,24 @@
1
- <div id="tab_panel_admin" class="panel woocommerce_options_panel hidden" style="display: none;">
2
- <div class="options_group wooccm-premium">
 
3
  <p class="form-field">
4
  <label><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></label>
5
  <input <# if ( data.listable ) { #>checked="checked"<# } #> type="checkbox" name="listable" value="1">
6
- <span class="description hidden"><?php esc_html_e('Display in View Orders screen', 'woocommerce-checkout-manager'); ?></span>
7
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
8
  </p>
9
  <p class="form-field">
10
  <label><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></label>
11
  <input <# if ( data.sortable ) { #>checked="checked"<# } #> type="checkbox" name="sortable" value="1">
12
- <span class="description hidden"><?php esc_html_e('Allow Sorting on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
13
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
14
  </p>
15
  <p class="form-field">
16
  <label><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></label>
17
  <input <# if ( data.filterable ) { #>checked="checked"<# } #> type="checkbox" name="filterable" value="1">
18
- <span class="description hidden"><?php esc_html_e('Allow Filtering on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
19
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
20
  </p>
21
  </div>
22
- </div>
 
1
+ <# if (!_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'admin') { #>hidden<# } #>>
3
+ <div class="options_group wooccm-premium">
4
  <p class="form-field">
5
  <label><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></label>
6
  <input <# if ( data.listable ) { #>checked="checked"<# } #> type="checkbox" name="listable" value="1">
7
+ <span class="description hidden"><?php esc_html_e('Display in View Orders screen', 'woocommerce-checkout-manager'); ?></span>
8
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
9
  </p>
10
  <p class="form-field">
11
  <label><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></label>
12
  <input <# if ( data.sortable ) { #>checked="checked"<# } #> type="checkbox" name="sortable" value="1">
13
+ <span class="description hidden"><?php esc_html_e('Allow Sorting on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
14
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
15
  </p>
16
  <p class="form-field">
17
  <label><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></label>
18
  <input <# if ( data.filterable ) { #>checked="checked"<# } #> type="checkbox" name="filterable" value="1">
19
+ <span class="description hidden"><?php esc_html_e('Allow Filtering on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
20
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
21
  </p>
22
  </div>
23
+ </div>
24
+ <# } #>
includes/view/backend/pages/modals/parts/panel-datepicker-limit.php DELETED
@@ -1,23 +0,0 @@
1
- <# if ( data.date_limit == 'variable' ) { #>
2
- <div class="options_group wooccm-premium wooccm-enhanced-between-days">
3
- <p class="form-field dimensions_field">
4
- <label for="product_length"><?php esc_html_e('Between days', 'woocommerce-checkout-manager'); ?></label>
5
- <span class="wrap">
6
- <input style="width:48.1%" type="number" placeholder="-3" min="-365" max="365" class="short " name="date_limit_variable_min" value="{{data.date_limit_variable_min}}">
7
- <input style="width:48.1%;margin: 0;" type="number" placeholder="3" min="-365" max="365" class="short" name="date_limit_variable_max" value="{{data.date_limit_variable_max}}">
8
- </span>
9
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
10
- </p>
11
- </div>
12
- <# } else { #>
13
- <div class="options_group wooccm-premium wooccm-enhanced-between-dates">
14
- <p class="form-field dimensions_field">
15
- <label for="product_length"><?php esc_html_e('Between dates', 'woocommerce-checkout-manager'); ?></label>
16
- <span class="wrap">
17
- <input style="width:48.1%" type="text" class="short " name="date_limit_fixed_min" value="{{data.date_limit_fixed_min}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
18
- <input style="width:48.1%;margin: 0;" type="text" class="short" name="date_limit_fixed_max" value="{{data.date_limit_fixed_max}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
19
- </span>
20
- <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
21
- </p>
22
- </div>
23
- <# } #>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/view/backend/pages/modals/parts/panel-datepicker.php CHANGED
@@ -1,16 +1,25 @@
1
- <div id="tab_panel_datepicker" class="panel woocommerce_options_panel hidden" style="display: none;">
 
 
 
 
 
 
 
 
 
2
  <div class="options_group wooccm-premium">
3
  <p class="form-field">
4
  <label><?php esc_html_e('Date format', 'woocommerce-checkout-manager'); ?></label>
5
- <input class="short" type="text" placeholder="dd-mm-yy" name="date_format" value="{{data.date_format}}">
6
- <span class="description"><a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.</span>
7
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
8
  </p>
9
  </div>
10
  <div class="options_group wooccm-premium">
11
  <p class="form-field">
12
  <label><?php esc_html_e('Date limit', 'woocommerce-checkout-manager'); ?></label>
13
- <select class="media-modal-change media-modal-render-datepicker-limit select short" name="date_limit">
14
  <option <# if ( data.date_limit == 'variable' ) { #>selected="selected"<# } #> value="variable"><?php esc_html_e('Since current date', 'woocommerce-checkout-manager'); ?></option>
15
  <option <# if ( data.date_limit == 'fixed' ) { #>selected="selected"<# } #> value="fixed"><?php esc_html_e('Between fixed dates', 'woocommerce-checkout-manager'); ?></option>
16
  </select>
@@ -20,14 +29,36 @@
20
  <div class="options_group wooccm-premium">
21
  <p class="form-field">
22
  <label><?php esc_html_e('Days disable', 'woocommerce-checkout-manager'); ?></label>
23
- <select class="wooccm-enhanced-select" name="date_limit_days[]" data-placeholder="<?php esc_attr_e('Disable week days', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
24
- <?php for ($day_index = 0; $day_index <= 6; $day_index++) : ?>
25
  <option <# if ( _.contains(data.date_limit_days, '<?php echo esc_attr($day_index); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($day_index); ?>"><?php echo $wp_locale->get_weekday($day_index); ?></option>
26
- <?php endfor; ?>
27
  </select>
28
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
29
  </p>
30
  </div>
31
- <div id="wooccm-modal-datepicker-limit">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  </div>
33
- </div>
 
 
1
+ <# if (data.type == 'date') { #>
2
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'datepicker') { #>hidden<# } #>>
3
+ <div class="options_group wooccm-premium">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Enhance', 'woocommerce-checkout-manager'); ?></label>
6
+ <input <# if ( data.select2 ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="select2" value="1">
7
+ <span class="description hidden"><?php esc_html_e('Enhance date behaviour with datepicker.', 'woocommerce-checkout-manager'); ?></span>
8
+ <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
9
+ </p>
10
+ </div>
11
  <div class="options_group wooccm-premium">
12
  <p class="form-field">
13
  <label><?php esc_html_e('Date format', 'woocommerce-checkout-manager'); ?></label>
14
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="text" placeholder="dd-mm-yy" name="date_format" value="{{data.date_format}}">
15
+ <span class="description"><a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.</span>
16
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
17
  </p>
18
  </div>
19
  <div class="options_group wooccm-premium">
20
  <p class="form-field">
21
  <label><?php esc_html_e('Date limit', 'woocommerce-checkout-manager'); ?></label>
22
+ <select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="media-modal-render-panels select short" name="date_limit">
23
  <option <# if ( data.date_limit == 'variable' ) { #>selected="selected"<# } #> value="variable"><?php esc_html_e('Since current date', 'woocommerce-checkout-manager'); ?></option>
24
  <option <# if ( data.date_limit == 'fixed' ) { #>selected="selected"<# } #> value="fixed"><?php esc_html_e('Between fixed dates', 'woocommerce-checkout-manager'); ?></option>
25
  </select>
29
  <div class="options_group wooccm-premium">
30
  <p class="form-field">
31
  <label><?php esc_html_e('Days disable', 'woocommerce-checkout-manager'); ?></label>
32
+ <select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="wooccm-enhanced-select" name="date_limit_days[]" data-placeholder="<?php esc_attr_e('Disable week days', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
33
+ <?php for ($day_index = 0; $day_index <= 6; $day_index++) : ?>
34
  <option <# if ( _.contains(data.date_limit_days, '<?php echo esc_attr($day_index); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($day_index); ?>"><?php echo $wp_locale->get_weekday($day_index); ?></option>
35
+ <?php endfor; ?>
36
  </select>
37
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
38
  </p>
39
  </div>
40
+ <# if ( data.date_limit == 'variable' ) { #>
41
+ <div class="options_group wooccm-premium wooccm-enhanced-between-days">
42
+ <p class="form-field dimensions_field">
43
+ <label><?php esc_html_e('Between days', 'woocommerce-checkout-manager'); ?></label>
44
+ <span class="wrap">
45
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="number" placeholder="-3" min="-365" max="365" class="short " name="date_limit_variable_min" value="{{data.date_limit_variable_min}}">
46
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="number" placeholder="3" min="-365" max="365" class="short" name="date_limit_variable_max" value="{{data.date_limit_variable_max}}">
47
+ </span>
48
+ <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
49
+ </p>
50
+ </div>
51
+ <# } else { #>
52
+ <div class="options_group wooccm-premium wooccm-enhanced-between-dates">
53
+ <p class="form-field dimensions_field">
54
+ <label><?php esc_html_e('Between dates', 'woocommerce-checkout-manager'); ?></label>
55
+ <span class="wrap">
56
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="text" class="short " name="date_limit_fixed_min" value="{{data.date_limit_fixed_min}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
57
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="text" class="short" name="date_limit_fixed_max" value="{{data.date_limit_fixed_max}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
58
+ </span>
59
+ <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
60
+ </p>
61
  </div>
62
+ <# } #>
63
+ </div>
64
+ <# } #>
includes/view/backend/pages/modals/parts/panel-display.php CHANGED
@@ -1,73 +1,4 @@
1
- <div id="tab_panel_display" class="panel woocommerce_options_panel hidden" style="display: none;">
2
- <div class="options_group">
3
- <p class="form-field">
4
- <label><?php esc_html_e('Show for roles', 'woocommerce-checkout-manager'); ?></label>
5
- <select class="wooccm-enhanced-select" name="show_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
6
- <?php foreach ($wp_roles->roles as $key => $value): ?>
7
- <option <# if ( _.contains(data.show_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
8
- <?php endforeach; ?>
9
- </select>
10
- </p>
11
- <p class="form-field">
12
- <label><?php esc_html_e('Hide for roles', 'woocommerce-checkout-manager'); ?></label>
13
- <select class="wooccm-enhanced-select" name="hide_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
14
- <?php foreach ($wp_roles->roles as $key => $value): ?>
15
- <option <# if ( _.contains(data.hide_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
16
- <?php endforeach; ?>
17
- </select>
18
- </p>
19
- </div>
20
-
21
- <div class="options_group">
22
- <p class="form-field">
23
- <label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
24
- <input <# if (data.more_product) { #>checked="checked"<# } #> type="checkbox" name="more_product" value="1">
25
- <span class="description"><?php esc_html_e('Apply conditions event it there is more than one product', 'woocommerce-checkout-manager'); ?></span>
26
- </p>
27
- </div>
28
-
29
- <div class="options_group">
30
- <p class="form-field">
31
- <label><?php esc_html_e('Show for products', 'woocommerce-checkout-manager'); ?></label>
32
- <select class="wooccm-product-search" name="show_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product}}" data-allow_clear="true" multiple="multiple">
33
- <# _.each(data.show_product_selected, function(title, id){ #>
34
- <option value="{{id}}" selected="selected">{{title}}</option>
35
- <# }); #>
36
- </select>
37
- </p>
38
- <p class="form-field">
39
- <label><?php esc_html_e('Hide for products', 'woocommerce-checkout-manager'); ?></label>
40
- <select class="wooccm-product-search" name="hide_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product}}" data-allow_clear="true" multiple="multiple">
41
- <# _.each(data.hide_product_selected, function(title, id){ #>
42
- <option value="{{id}}" selected="selected">{{title}}</option>
43
- <# }); #>
44
- </select>
45
- </p>
46
- </div>
47
-
48
- <div class="options_group">
49
- <p class="form-field">
50
- <label><?php esc_html_e('Show for category', 'woocommerce-checkout-manager'); ?></label>
51
- <select class="wooccm-enhanced-select" name="show_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product_cat}}" data-allow_clear="true" multiple="multiple">
52
- <?php if ($product_categories) : ?>
53
- <?php foreach ($product_categories as $category): ?>
54
- <option <# if ( _.contains(data.show_product_cat, '<?php echo esc_attr($category->slug); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->slug); ?>"><?php echo esc_html($category->name); ?></option>
55
- <?php endforeach; ?>
56
- <?php endif; ?>
57
- </select>
58
- </p>
59
- <p class="form-field">
60
- <label><?php esc_html_e('Hide for category', 'woocommerce-checkout-manager'); ?></label>
61
- <select class="wooccm-enhanced-select" name="hide_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product_cat}}" data-allow_clear="true" multiple="multiple">
62
- <?php if ($product_categories) : ?>
63
- <?php foreach ($product_categories as $category): ?>
64
- <option <# if ( _.contains(data.hide_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
65
- <?php endforeach; ?>
66
- <?php endif; ?>
67
- </select>
68
- </p>
69
- </div>
70
-
71
  <div class="options_group wooccm-premium">
72
  <p class="form-field">
73
  <label><?php esc_html_e('Hide on account', 'woocommerce-checkout-manager'); ?></label>
@@ -81,16 +12,22 @@
81
  <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the checkout page', 'woocommerce-checkout-manager'); ?></span>
82
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
83
  </p>
 
 
 
 
 
 
84
  <p class="form-field">
85
  <label><?php esc_html_e('Hide on emails', 'woocommerce-checkout-manager'); ?></label>
86
- <input <# if (data.hide_checkout) { #>checked="checked"<# } #> type="checkbox" name="hide_email" value="1">
87
  <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user email', 'woocommerce-checkout-manager'); ?></span>
88
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
89
  </p>
90
  <p class="form-field">
91
- <label><?php esc_html_e('Hide on orders', 'woocommerce-checkout-manager'); ?></label>
92
- <input <# if (data.hide_checkout) { #>checked="checked"<# } #> type="checkbox" name="hide_order" value="1">
93
- <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user order', 'woocommerce-checkout-manager'); ?></span>
94
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
95
  </p>
96
  </div>
1
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'display') { #>hidden<# } #>>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  <div class="options_group wooccm-premium">
3
  <p class="form-field">
4
  <label><?php esc_html_e('Hide on account', 'woocommerce-checkout-manager'); ?></label>
12
  <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the checkout page', 'woocommerce-checkout-manager'); ?></span>
13
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
14
  </p>
15
+ <p class="form-field">
16
+ <label><?php esc_html_e('Hide on orders', 'woocommerce-checkout-manager'); ?></label>
17
+ <input <# if (data.hide_order) { #>checked="checked"<# } #> type="checkbox" name="hide_order" value="1">
18
+ <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user order', 'woocommerce-checkout-manager'); ?></span>
19
+ <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
20
+ </p>
21
  <p class="form-field">
22
  <label><?php esc_html_e('Hide on emails', 'woocommerce-checkout-manager'); ?></label>
23
+ <input <# if (data.hide_email) { #>checked="checked"<# } #> type="checkbox" name="hide_email" value="1">
24
  <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user email', 'woocommerce-checkout-manager'); ?></span>
25
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
26
  </p>
27
  <p class="form-field">
28
+ <label><?php esc_html_e('Hide on invoices', 'woocommerce-checkout-manager'); ?></label>
29
+ <input <# if (data.hide_invoice) { #>checked="checked"<# } #> type="checkbox" name="hide_invoice" value="1">
30
+ <span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the order invoice', 'woocommerce-checkout-manager'); ?></span>
31
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
32
  </p>
33
  </div>
includes/view/backend/pages/modals/parts/panel-filter.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'filter') { #>hidden<# } #>>
2
+ <div class="options_group wooccm-premium wooccm-enhanced-between-days">
3
+ <p class="form-field dimensions_field">
4
+ <label><?php esc_html_e('Cart subtotal', 'woocommerce-checkout-manager'); ?></label>
5
+ <span class="wrap">
6
+ <input style="width:48.1%" type="number" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" placeholder="<?php esc_attr_e('minimun', 'woocommerce-checkout-manager'); ?>" min="0" class="short " name="show_cart_minimum" value="{{data.show_cart_minimum}}">
7
+ <input style="width:48.1%;margin: 0;" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" type="number" placeholder="<?php esc_attr_e('maximun', 'woocommerce-checkout-manager'); ?>" min="0" class="short" name="show_cart_maximun" value="{{data.show_cart_maximun}}">
8
+ </span>
9
+ <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
10
+ </p>
11
+ </div>
12
+ <div class="options_group">
13
+ <p class="form-field">
14
+ <label><?php esc_html_e('Show for roles', 'woocommerce-checkout-manager'); ?></label>
15
+ <select class="wooccm-enhanced-select" name="show_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
16
+ <?php foreach ($wp_roles->roles as $key => $value): ?>
17
+ <option <# if ( _.contains(data.show_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
18
+ <?php endforeach; ?>
19
+ </select>
20
+ </p>
21
+ <p class="form-field">
22
+ <label><?php esc_html_e('Hide for roles', 'woocommerce-checkout-manager'); ?></label>
23
+ <select class="wooccm-enhanced-select" name="hide_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
24
+ <?php foreach ($wp_roles->roles as $key => $value): ?>
25
+ <option <# if ( _.contains(data.hide_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
26
+ <?php endforeach; ?>
27
+ </select>
28
+ </p>
29
+ </div>
30
+
31
+ <div class="options_group">
32
+ <p class="form-field">
33
+ <label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
34
+ <input <# if (data.more_product) { #>checked="checked"<# } #> type="checkbox" name="more_product" value="1">
35
+ <span class="description"><?php esc_html_e('Apply conditions event it there is more than one product', 'woocommerce-checkout-manager'); ?></span>
36
+ </p>
37
+ </div>
38
+
39
+ <div class="options_group">
40
+ <p class="form-field">
41
+ <label><?php esc_html_e('Show for products', 'woocommerce-checkout-manager'); ?></label>
42
+ <select class="wooccm-product-search" name="show_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product}}" data-allow_clear="true" multiple="multiple">
43
+ <# _.each(data.show_product_selected, function(title, id){ #>
44
+ <option value="{{id}}" selected="selected">{{title}}</option>
45
+ <# }); #>
46
+ </select>
47
+ </p>
48
+ <p class="form-field">
49
+ <label><?php esc_html_e('Hide for products', 'woocommerce-checkout-manager'); ?></label>
50
+ <select class="wooccm-product-search" name="hide_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product}}" data-allow_clear="true" multiple="multiple">
51
+ <# _.each(data.hide_product_selected, function(title, id){ #>
52
+ <option value="{{id}}" selected="selected">{{title}}</option>
53
+ <# }); #>
54
+ </select>
55
+ </p>
56
+ </div>
57
+
58
+ <div class="options_group">
59
+ <p class="form-field">
60
+ <label><?php esc_html_e('Show for category', 'woocommerce-checkout-manager'); ?></label>
61
+ <select class="wooccm-enhanced-select" name="show_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product_cat}}" data-allow_clear="true" multiple="multiple">
62
+ <?php if ($product_categories) : ?>
63
+ <?php foreach ($product_categories as $category): ?>
64
+ <option <# if ( _.contains(data.show_product_cat, '<?php echo esc_attr($category->slug); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->slug); ?>"><?php echo esc_html($category->name); ?></option>
65
+ <?php endforeach; ?>
66
+ <?php endif; ?>
67
+ </select>
68
+ </p>
69
+ <p class="form-field">
70
+ <label><?php esc_html_e('Hide for category', 'woocommerce-checkout-manager'); ?></label>
71
+ <select class="wooccm-enhanced-select" name="hide_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product_cat}}" data-allow_clear="true" multiple="multiple">
72
+ <?php if ($product_categories) : ?>
73
+ <?php foreach ($product_categories as $category): ?>
74
+ <option <# if ( _.contains(data.hide_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
75
+ <?php endforeach; ?>
76
+ <?php endif; ?>
77
+ </select>
78
+ </p>
79
+ </div>
80
+ </div>
includes/view/backend/pages/modals/parts/panel-general.php CHANGED
@@ -1,12 +1,12 @@
1
- <div id="tab_panel_general" class="panel woocommerce_options_panel">
2
- <div class="options_group">
3
  <p class="form-field">
4
  <label><?php esc_html_e('Name', 'woocommerce-checkout-manager'); ?></label>
5
  <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
6
  <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('You can\'t change the slug of default fields.', 'woocommerce-checkout-manager'); ?>"></span>
7
  <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly">
8
  <# } else { #>
9
- <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Currently is not possible to change the name of the fields.', 'woocommerce-checkout-manager'); ?><?php //esc_html_e('To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-manager'); ?>"></span>
10
  <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly" <?php /* if (empty($options['checkness']['abbreviation'])) { ?>readonly="readonly"<?php } */ ?>>
11
  <# } #>
12
  </p>
@@ -17,10 +17,10 @@
17
  <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
18
  <input class="short" type="text" name="type" value="{{data.type}}" readonly="readonly">
19
  <# } else { #>
20
- <select class="media-modal-change media-modal-render-panels media-modal-render-tabs wooccm-enhanced-select" name="type">
21
  <?php if ($types): ?>
22
  <?php foreach ($types as $type => $name) : ?>
23
- <option <# if ( data.type == '<?php echo esc_attr($type); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($name); ?></option>
24
  <?php endforeach; ?>
25
  <?php endif; ?>
26
  </select>
@@ -40,24 +40,70 @@
40
  <div class="options_group">
41
  <p class="form-field">
42
  <label><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></label>
43
- <input class="short media-modal-table" type="text" name="label" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-manager'); ?>" value="{{data.label}}">
44
  <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Label text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
45
  </p>
46
  <# if ( !_.contains(<?php echo json_encode($template); ?>, data.type )) { #>
47
  <p class="form-field">
48
  <label><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></label>
49
- <input class="short media-modal-table" type="text" name="placeholder" placeholder="<?php esc_html_e('This is a placeholder', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
50
  <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Placeholder text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
51
  </p>
52
  <# } #>
53
  <# if ( data.type == 'file' ) { #>
54
  <p class="form-field">
55
  <label><?php esc_html_e('Button', 'woocommerce-checkout-manager'); ?></label>
56
- <input class="short media-modal-table" type="text" name="placeholder" placeholder="<?php esc_html_e('Upload your files', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
57
  <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Text for the button name.', 'woocommerce-checkout-manager'); ?>"></span>
58
  </p>
59
  <# } #>
60
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  <# if ( !_.contains(<?php echo json_encode(array_merge($template, $option)); ?>, data.type)) { #>
62
  <div class="options_group">
63
  <p class="form-field">
@@ -83,7 +129,7 @@
83
  <p class="form-field">
84
  <select class="wooccm-enhanced-select" name="file_types" multiple="multiple" data-placeholder="<?php esc_attr_e('Choose the allowed types&hellip;', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" >
85
  <?php foreach (wp_get_mime_types() as $type => $name) : ?>
86
- <option <# if ( _.contains(data.file_types, '<?php echo esc_attr($type); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($type); ?></option>
87
  <?php endforeach; ?>
88
  </select>
89
  </p>
1
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'general') { #>hidden<# } #>>
2
+ <div class="options_group">
3
  <p class="form-field">
4
  <label><?php esc_html_e('Name', 'woocommerce-checkout-manager'); ?></label>
5
  <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
6
  <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('You can\'t change the slug of default fields.', 'woocommerce-checkout-manager'); ?>"></span>
7
  <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly">
8
  <# } else { #>
9
+ <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Currently is not possible to change the name of the fields.', 'woocommerce-checkout-manager'); ?><?php //esc_html_e('To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-manager'); ?>"></span>
10
  <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly" <?php /* if (empty($options['checkness']['abbreviation'])) { ?>readonly="readonly"<?php } */ ?>>
11
  <# } #>
12
  </p>
17
  <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
18
  <input class="short" type="text" name="type" value="{{data.type}}" readonly="readonly">
19
  <# } else { #>
20
+ <select class="media-modal-render-tabs wooccm-enhanced-select" name="type">
21
  <?php if ($types): ?>
22
  <?php foreach ($types as $type => $name) : ?>
23
+ <option <# if ( data.type == '<?php echo esc_attr($type); ?>' ) { #>selected="selected"<# } #> <# if ( _.contains(<?php echo json_encode($disabled); ?>, '<?php echo esc_attr($type); ?>' )) { #>disabled="disabled"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($name); ?></option>
24
  <?php endforeach; ?>
25
  <?php endif; ?>
26
  </select>
40
  <div class="options_group">
41
  <p class="form-field">
42
  <label><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></label>
43
+ <input class="short "type="text" name="label" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-manager'); ?>" value="{{data.label}}">
44
  <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Label text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
45
  </p>
46
  <# if ( !_.contains(<?php echo json_encode($template); ?>, data.type )) { #>
47
  <p class="form-field">
48
  <label><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></label>
49
+ <input class="short" type="text" name="placeholder" placeholder="<?php esc_html_e('This is a placeholder', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
50
  <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Placeholder text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
51
  </p>
52
  <# } #>
53
  <# if ( data.type == 'file' ) { #>
54
  <p class="form-field">
55
  <label><?php esc_html_e('Button', 'woocommerce-checkout-manager'); ?></label>
56
+ <input class="short" type="text" name="placeholder" placeholder="<?php esc_html_e('Upload your files', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
57
  <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Text for the button name.', 'woocommerce-checkout-manager'); ?>"></span>
58
  </p>
59
  <# } #>
60
  </div>
61
+ <# if ( !_.contains(<?php echo json_encode($template); ?>, data.type )) { #>
62
+ <div class="options_group">
63
+ <p class="form-field">
64
+ <label><?php esc_html_e('Description', 'woocommerce-checkout-manager'); ?></label>
65
+ <textarea class="short" type="text" name="description" placeholder="<?php esc_html_e('Description of the checkout field', 'woocommerce-checkout-manager'); ?>">{{data.description}}</textarea>
66
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Placeholder text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
67
+ </p>
68
+ </div>
69
+ <# } #>
70
+ <# if ( data.type == 'message') { #>
71
+ <div class="options_group">
72
+ <p class="form-field">
73
+ <label><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></label>
74
+ <select class="wooccm-enhanced-select" name="message_type">
75
+ <option <# if ( 'info' == data.message_type ) { #>selected="selected"<# } #> value="info"><?php esc_html_e('Info', 'woocommerce-checkout-manager'); ?></option>
76
+ <option <# if ( 'message' == data.message_type ) { #>selected="selected"<# } #> value="message"><?php esc_html_e('Success', 'woocommerce-checkout-manager'); ?></option>
77
+ <option <# if ( 'error' == data.message_type ) { #>selected="selected"<# } #> value="error"><?php esc_html_e('Error', 'woocommerce-checkout-manager'); ?></option>
78
+ </select>
79
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Message alert type.', 'woocommerce-checkout-manager'); ?>"></span>
80
+ </p>
81
+ <p class="form-field">
82
+ <label><?php esc_html_e('Message', 'woocommerce-checkout-manager'); ?></label>
83
+ <textarea class="short" name="description" placeholder="<?php esc_html_e('Message content', 'woocommerce-checkout-manager'); ?>">{{data.description}}</textarea>
84
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Message content.', 'woocommerce-checkout-manager'); ?>"></span>
85
+ </p>
86
+ </div>
87
+ <# } #>
88
+
89
+ <# if ( data.type == 'button') { #>
90
+ <div class="options_group">
91
+ <p class="form-field">
92
+ <label><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></label>
93
+ <select class="wooccm-enhanced-select" name="button_type">
94
+ <option <# if ( '' == data.button_type ) { #>selected="selected"<# } #> value=""><?php esc_html_e('Default', 'woocommerce-checkout-manager'); ?></option>
95
+ <option <# if ( 'alt' == data.button_type ) { #>selected="selected"<# } #> value="alt"><?php esc_html_e('Alt', 'woocommerce-checkout-manager'); ?></option>
96
+ </select>
97
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Message alert type.', 'woocommerce-checkout-manager'); ?>"></span>
98
+ </p>
99
+ <p class="form-field">
100
+ <label><?php esc_html_e('Link', 'woocommerce-checkout-manager'); ?></label>
101
+ <input class="short" type="text" name="button_link" placeholder="<?php esc_html_e('URL', 'woocommerce-checkout-manager'); ?>" value="{{data.button_link}}"/>
102
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Button URL.', 'woocommerce-checkout-manager'); ?>"></span>
103
+ </p>
104
+ </div>
105
+ <# } #>
106
+
107
  <# if ( !_.contains(<?php echo json_encode(array_merge($template, $option)); ?>, data.type)) { #>
108
  <div class="options_group">
109
  <p class="form-field">
129
  <p class="form-field">
130
  <select class="wooccm-enhanced-select" name="file_types" multiple="multiple" data-placeholder="<?php esc_attr_e('Choose the allowed types&hellip;', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" >
131
  <?php foreach (wp_get_mime_types() as $type => $name) : ?>
132
+ <option <# if ( _.contains(data.file_types, '<?php echo esc_attr($type); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($type); ?></option>
133
  <?php endforeach; ?>
134
  </select>
135
  </p>
includes/view/backend/pages/modals/parts/panel-options.php CHANGED
@@ -1,6 +1,7 @@
1
- <div id="tab_panel_options" class="panel woocommerce_options_panel" style="display: none;">
2
- <# if ( _.isObject(data.options)) { #>
3
- <div class="options_group">
 
4
  <table class="wc_gateways widefat wooccm-enhanced-options" style="border:none;box-shadow: none">
5
  <thead>
6
  <tr>
@@ -70,4 +71,5 @@
70
  </table>
71
  </div>
72
  <# } #>
73
- </div>
 
1
+ <# if ( _.contains(<?php echo json_encode($option); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'options') { #>hidden<# } #>>
3
+ <# if ( _.isObject(data.options)) { #>
4
+ <div class="options_group">
5
  <table class="wc_gateways widefat wooccm-enhanced-options" style="border:none;box-shadow: none">
6
  <thead>
7
  <tr>
71
  </table>
72
  </div>
73
  <# } #>
74
+ </div>
75
+ <# } #>
includes/view/backend/pages/modals/parts/panel-price.php CHANGED
@@ -1,5 +1,6 @@
1
- <div id="tab_panel_price" class="panel woocommerce_options_panel hidden" style="display: none;">
2
- <div class="options_group wooccm-premium">
 
3
  <p class="form-field">
4
  <label><?php esc_html_e('Price', 'woocommerce-checkout-manager'); ?></label>
5
  <input <# if (data.add_price) { #>checked="checked"<# } #> type="checkbox" name="add_price" value="1">
@@ -27,4 +28,5 @@
27
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
28
  </p>
29
  </div>
30
- </div>
 
1
+ <# if (!_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'price') { #>hidden<# } #>>
3
+ <div class="options_group wooccm-premium">
4
  <p class="form-field">
5
  <label><?php esc_html_e('Price', 'woocommerce-checkout-manager'); ?></label>
6
  <input <# if (data.add_price) { #>checked="checked"<# } #> type="checkbox" name="add_price" value="1">
28
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
29
  </p>
30
  </div>
31
+ </div>
32
+ <# } #>
includes/view/backend/pages/modals/parts/panel-select2.php CHANGED
@@ -1,5 +1,6 @@
1
- <div id="tab_panel_select2" class="panel woocommerce_options_panel hidden" style="display: none;">
2
- <div class="options_group wooccm-premium">
 
3
  <p class="form-field">
4
  <label><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></label>
5
  <input <# if ( data.select2 ) { #>checked="checked"<# } #> type="checkbox" name="select2" value="1">
@@ -35,4 +36,5 @@
35
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
36
  </p>
37
  </div>
38
- </div>
 
1
+ <# if (_.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
2
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'select2') { #>hidden<# } #>>
3
+ <div class="options_group wooccm-premium">
4
  <p class="form-field">
5
  <label><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></label>
6
  <input <# if ( data.select2 ) { #>checked="checked"<# } #> type="checkbox" name="select2" value="1">
36
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
37
  </p>
38
  </div>
39
+ </div>
40
+ <# } #>
includes/view/backend/pages/modals/parts/panel-timepicker.php CHANGED
@@ -1,19 +1,29 @@
1
- <div id="tab_panel_timepicker" class="panel woocommerce_options_panel hidden" style="display: none;">
 
 
 
 
 
 
 
 
 
2
  <div class="options_group wooccm-premium">
3
  <p class="form-field">
4
  <label><?php esc_html_e('Hour start', 'woocommerce-checkout-manager'); ?></label>
5
- <input class="short" type="number" min="0" max="24" placeholder="6" name="time_limit_start" value="{{data.time_limit_start}}">
6
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
7
  </p>
8
  <p class="form-field">
9
  <label><?php esc_html_e('Hour end', 'woocommerce-checkout-manager'); ?></label>
10
- <input class="short" type="number" min="0" max="24" placeholder="9" name="time_limit_end" value="{{data.time_limit_end}}">
11
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
12
  </p>
13
  <p class="form-field">
14
  <label><?php esc_html_e('Minutes interval', 'woocommerce-checkout-manager'); ?></label>
15
- <input class="short" type="number" min="0" max="60" step="5" placeholder="15" name="time_limit_interval" value="{{data.time_limit_interval}}">
16
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
17
  </p>
18
  </div>
19
- </div>
 
1
+ <# if (data.type == 'time') { #>
2
+ <div class="panel woocommerce_options_panel" <# if (data.panel != 'timepicker') { #>hidden<# } #>>
3
+ <div class="options_group wooccm-premium">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Enhance', 'woocommerce-checkout-manager'); ?></label>
6
+ <input <# if ( data.select2 ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="select2" value="1">
7
+ <span class="description hidden"><?php esc_html_e('Enhance time behaviour with timepicker.', 'woocommerce-checkout-manager'); ?></span>
8
+ <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
9
+ </p>
10
+ </div>
11
  <div class="options_group wooccm-premium">
12
  <p class="form-field">
13
  <label><?php esc_html_e('Hour start', 'woocommerce-checkout-manager'); ?></label>
14
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="24" placeholder="6" name="time_limit_start" value="{{data.time_limit_start}}">
15
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
16
  </p>
17
  <p class="form-field">
18
  <label><?php esc_html_e('Hour end', 'woocommerce-checkout-manager'); ?></label>
19
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="24" placeholder="9" name="time_limit_end" value="{{data.time_limit_end}}">
20
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
21
  </p>
22
  <p class="form-field">
23
  <label><?php esc_html_e('Minutes interval', 'woocommerce-checkout-manager'); ?></label>
24
+ <input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="60" step="5" placeholder="15" name="time_limit_interval" value="{{data.time_limit_interval}}">
25
  <span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
26
  </p>
27
  </div>
28
+ </div>
29
+ <# } #>
includes/view/backend/pages/modals/parts/tabs.php CHANGED
@@ -1,39 +1,41 @@
1
  <ul class="wc-tabs">
2
- <li class="general_options active">
3
- <a href="#tab_panel_general"><span><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></span></a>
4
  </li>
5
- <# if ( _.contains(<?php echo json_encode($option); ?>, data.type)) { #>
6
- <li class="options_options">
7
- <a href="#tab_panel_options"><span><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></span></a>
8
  </li>
9
  <# } #>
10
- <# if ( _.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
11
- <li class="price_options">
12
- <a href="#tab_panel_select2"><span><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></span></a>
13
  </li>
14
  <# } #>
15
- <li class="display_options">
16
- <a href="#tab_panel_display"><span><?php esc_html_e('Display', 'woocommerce-checkout-manager'); ?></span></a>
 
 
 
17
  </li>
18
  <# if ( !_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
19
- <li class="price_options">
20
- <a href="#tab_panel_price"><span><?php esc_html_e('Price', 'woocommerce-checkout-manager'); ?></span></a>
21
  </li>
22
  <# } #>
23
  <# if (data.type == 'time') { #>
24
- <li class="timepicker_options">
25
- <a href="#tab_panel_timepicker"><span><?php esc_html_e('Timepicker', 'woocommerce-checkout-manager'); ?></span></a>
26
  </li>
27
  <# } #>
28
  <# if (data.type == 'date') { #>
29
- <li class="datepicker_options">
30
- <a href="#tab_panel_datepicker"><span><?php esc_html_e('Datepicker', 'woocommerce-checkout-manager'); ?></span></a>
31
  </li>
32
  <# } #>
33
- <li class="admin_options">
34
- <a href="#tab_panel_admin"><span><?php esc_html_e('Admin', 'woocommerce-checkout-manager'); ?></span></a>
 
35
  </li>
36
- <!-- <li class="suggestions_options">
37
- <a href="#tab_panel_suggestions"><span><?php esc_html_e('Suggestions', 'woocommerce-checkout-manager'); ?></span></a>
38
- </li>-->
39
  </ul>
1
  <ul class="wc-tabs">
2
+ <li class="media-modal-tab" class="active">
3
+ <a href="#general"><span><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></span></a>
4
  </li>
5
+ <# if ( _.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
6
+ <li class="media-modal-tab">
7
+ <a href="#select2"><span><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></span></a>
8
  </li>
9
  <# } #>
10
+ <# if ( _.contains(<?php echo json_encode($option); ?>, data.type)) { #>
11
+ <li class="media-modal-tab">
12
+ <a href="#options"><span><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></span></a>
13
  </li>
14
  <# } #>
15
+ <li class="media-modal-tab">
16
+ <a href="#filter"><span><?php esc_html_e('Filter', 'woocommerce-checkout-manager'); ?></span></a>
17
+ </li>
18
+ <li class="media-modal-tab">
19
+ <a href="#display"><span><?php esc_html_e('Display', 'woocommerce-checkout-manager'); ?></span></a>
20
  </li>
21
  <# if ( !_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
22
+ <li class="media-modal-tab">
23
+ <a href="#price"><span><?php esc_html_e('Price', 'woocommerce-checkout-manager'); ?></span></a>
24
  </li>
25
  <# } #>
26
  <# if (data.type == 'time') { #>
27
+ <li class="media-modal-tab">
28
+ <a href="#timepicker"><span><?php esc_html_e('Timepicker', 'woocommerce-checkout-manager'); ?></span></a>
29
  </li>
30
  <# } #>
31
  <# if (data.type == 'date') { #>
32
+ <li class="media-modal-tab">
33
+ <a href="#datepicker"><span><?php esc_html_e('Datepicker', 'woocommerce-checkout-manager'); ?></span></a>
34
  </li>
35
  <# } #>
36
+ <# if ( !_.contains(<?php echo json_encode(array_merge($option, $template)); ?>, data.type)) { #>
37
+ <li class="media-modal-tab">
38
+ <a href="#admin"><span><?php esc_html_e('Admin', 'woocommerce-checkout-manager'); ?></span></a>
39
  </li>
40
+ <# } #>
 
 
41
  </ul>
includes/view/frontend/{class-wooccm-fields-display.php → class-wooccm-fields-disable.php} RENAMED
File without changes
includes/view/frontend/class-wooccm-fields-filters.php CHANGED
@@ -145,8 +145,6 @@ class WOOCCM_Fields_Filter {
145
 
146
  break;
147
 
148
-
149
-
150
  case 'file' :
151
 
152
  $field = '';
@@ -183,7 +181,7 @@ class WOOCCM_Fields_Filter {
183
  return $field;
184
  }
185
 
186
- // Colorpicker
187
  // ---------------------------------------------------------------------------
188
  public function heading_field($field = '', $key, $args, $value) {
189
 
145
 
146
  break;
147
 
 
 
148
  case 'file' :
149
 
150
  $field = '';
181
  return $field;
182
  }
183
 
184
+ // Heading
185
  // ---------------------------------------------------------------------------
186
  public function heading_field($field = '', $key, $args, $value) {
187
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: quadlayers
3
  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: 4.6
6
- Tested up to: 5.3.0
7
- Stable tag: 4.8.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -99,6 +99,10 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
99
 
100
  == Changelog ==
101
 
 
 
 
 
102
  = 4.8.4 =
103
  * Fix: bad spelling
104
  * Fix: woocommerce checkout manager modal open
3
  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: 4.6
6
+ Tested up to: 5.3.2
7
+ Stable tag: 4.8.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
99
 
100
  == Changelog ==
101
 
102
+ = 4.8.5 =
103
+ * Fix: woocommerce checkout manager modal tab
104
+ * New: woocommerce checkout manager field description
105
+
106
  = 4.8.4 =
107
  * Fix: bad spelling
108
  * Fix: woocommerce checkout manager modal open
woocommerce-checkout-manager.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: WooCommerce Checkout Manager
5
  * Description: Manages WooCommerce Checkout, the advanced way.
6
- * Version: 4.8.4
7
  * Author: QuadLayers
8
  * Author URI: https://www.quadlayers.com
9
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
@@ -17,7 +17,7 @@ if (!defined('WOOCCM_PLUGIN_NAME')) {
17
  define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
18
  }
19
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
20
- define('WOOCCM_PLUGIN_VERSION', '4.8.4');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_FILE')) {
23
  define('WOOCCM_PLUGIN_FILE', __FILE__);
3
  /**
4
  * Plugin Name: WooCommerce Checkout Manager
5
  * Description: Manages WooCommerce Checkout, the advanced way.
6
+ * Version: 4.8.5
7
  * Author: QuadLayers
8
  * Author URI: https://www.quadlayers.com
9
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
17
  define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
18
  }
19
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
20
+ define('WOOCCM_PLUGIN_VERSION', '4.8.5');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_FILE')) {
23
  define('WOOCCM_PLUGIN_FILE', __FILE__);