WooCommerce Checkout Manager - Version 5.2.1

Version Description

  • Fix: premium compatibility
Download this release

Release Info

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

Code changes from version 5.2.0 to 5.2.1

assets/backend/js/wooccm-admin-field.js CHANGED
@@ -14,6 +14,8 @@
14
  $('#wooccm_modal').removeClass('processing');
15
  };
16
 
 
 
17
  _.mixin({
18
  sortOptions: function (object) {
19
  return _.sortBy(object, function (o) {
@@ -28,12 +30,16 @@
28
  .replace(/'/g, "'");
29
  },
30
  getFormData: function ($form) {
31
- return $form.serializeJSON({ checkboxUncheckedValue: 'false', parseBooleans: true, parseNulls: true });
 
 
 
 
32
  }
33
  });
34
 
35
  var FieldModel = Backbone.Model.extend({
36
- defaults: wooccm_field.args
37
  });
38
 
39
  var FieldModal = Backbone.View.extend({
@@ -83,6 +89,7 @@
83
  var modal = this,
84
  $form = modal.$el.find('#wooccm_modal').find('form');
85
  var model = _.getFormData($form);
 
86
  this.model.set(model);
87
  },
88
  reload: function (e) {
14
  $('#wooccm_modal').removeClass('processing');
15
  };
16
 
17
+ console.log('wooccm_field.args', wooccm_field.args)
18
+
19
  _.mixin({
20
  sortOptions: function (object) {
21
  return _.sortBy(object, function (o) {
30
  .replace(/'/g, "'");
31
  },
32
  getFormData: function ($form) {
33
+ let form = $form.serializeJSON({ checkboxUncheckedValue: 'false', parseBooleans: true, parseNulls: true });
34
+ let defaults = Object.assign({}, wooccm_field.args);
35
+ let merged = Object.assign(defaults, form)
36
+ return merged
37
+
38
  }
39
  });
40
 
41
  var FieldModel = Backbone.Model.extend({
42
+ defaults: Object.create(wooccm_field.args)
43
  });
44
 
45
  var FieldModal = Backbone.View.extend({
89
  var modal = this,
90
  $form = modal.$el.find('#wooccm_modal').find('form');
91
  var model = _.getFormData($form);
92
+ console.log('model', model)
93
  this.model.set(model);
94
  },
95
  reload: function (e) {
assets/backend/js/wooccm-admin-field.min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";var count=0,timer,is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function(){$("#wooccm_modal").addClass("processing")},unblock=function(){$("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(object){return _.sortBy(object,(function(o){return o.order}))},escapeHtml:function(attribute){return attribute.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function($form){return $form.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0})}});var FieldModel=Backbone.Model.extend({defaults:wooccm_field.args}),FieldModal=Backbone.View.extend({initialize:function(e){var $button,field_id=$(e.target).closest("[data-field_id]").data("field_id"),model=new FieldModel;model.set({id:field_id}),new FieldView({model:model}).render()}}),FieldView=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,"open","tab","edit","load","render","close","submit","parent"),this.init(),this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(view,selector){view.setElement(this.$(selector)).render()},updateModel:function(e){e.preventDefault();var modal=this,$form=this.$el.find("#wooccm_modal").find("form"),model=_.getFormData($form);this.model.set(model)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(e){e.preventDefault(),this.undelegateEvents(),$(document).off("focusin"),$("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(e)},enableSave:function(e){$(".media-modal-submit").removeProp("disabled"),this.updateModel(e)},disableSave:function(e){$(".media-modal-submit").prop("disabled",!0)},tab:function(e){e.preventDefault();var modal=this,$modal=this.$el.find("#wooccm_modal"),$tab=$(e.currentTarget),$tabs=$modal.find("ul.wc-tabs"),panel=$tab.find("a").attr("href").replace("#","");$tabs.find(".active").removeClass("active"),$tab.addClass("active"),this.model.attributes.panel=panel,this.model.changed.panel=panel,this.renderPanels(e)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){var modal=this;this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new FieldViewTabs({model:this.model}),this.panels=new FieldViewPanels({model:this.model}),this.info=new FieldViewInfo({model:this.model}),this.assign(this.tabs,"#wooccm-modal-tabs"),this.assign(this.panels,"#wooccm-modal-panels"),this.assign(this.info,"#wooccm-modal-info")},open:function(e){$("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){unblock()}),100)},load:function(){var modal=this;null!=modal.model.attributes.id?$.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",complete:function(){unblock()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.set(response.data),modal.render()):alert(response.data)}}):modal.render()},edit:function(e){e.preventDefault();var modal=this,$button=$(e.target),field_count=parseInt($(".wc_gateways tr[data-field_id]").length),order=parseInt(modal.model.get("order"));count++,timer&&clearTimeout(timer),timer=setTimeout((function(){order=$button.hasClass("media-modal-next")?Math.min(order+count,field_count):Math.max(order-count,1),modal.model.set({id:parseInt($(".wc_gateways tr[data-field_order="+order+"]").data("field_id"))}),count=0,modal.load()}),300)},submit:function(e){e.preventDefault();var modal=this,$modal=modal.$el.find("#wooccm_modal"),$spinner=$modal.find(".settings-save-status .spinner"),$saved=$modal.find(".settings-save-status .saved");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(modal.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){$(".media-modal-submit").prop("disabled",!0),$spinner.addClass("is-active")},complete:function(){$saved.addClass("is-active"),$spinner.removeClass("is-active"),_.delay((function(){$saved.removeClass("is-active")}),1e3)},error:function(response){alert("Error!")},success:function(response){console.log(response),response.success?null==modal.model.attributes.id&&($modal.addClass("reload"),modal.reload(e),modal.close(e)):alert(response.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(e){e.preventDefault();var modal=this,$modal,$details=modal.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(e),$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:modal.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){modal.disableSave(),$details.addClass("save-waiting")},complete:function(){$details.addClass("save-complete"),$details.removeClass("save-waiting"),modal.enableSave()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.attributes.parent=response.data,modal.model.changed.parent=response.data,modal.renderInfo()):alert(response.data)}}),!1}}),FieldViewTabs=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))}}),FieldViewPanels=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")}}),FieldViewInfo=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")}});$("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(e){e.preventDefault();var $button=$(e.target),c;return!!confirm(wooccm_field.message.reset)&&($.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(response){response.success?location.reload():alert(response.data)}}),!1)})),$(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(e){e.preventDefault();var $button,$field=$(e.target).closest("[data-field_id]"),field_id=$field.data("field_id"),c;return!!confirm(wooccm_field.message.remove)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:field_id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?$field.remove():alert(response.data)}}),!1)})),$(document).on("click",".wooccm-field-toggle-attribute",(function(e){e.preventDefault();var $link=$(this),$tr=$link.closest("tr"),$toggle=$link.find(".woocommerce-input-toggle");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:$(this).data("field_attr"),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$toggle.addClass("woocommerce-input-toggle--loading")},success:function(response){!0===response.data?($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--enabled"),$toggle.removeClass("woocommerce-input-toggle--loading")):!0!==response.data&&($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--disabled"),$toggle.removeClass("woocommerce-input-toggle--loading"))}}),!1})),$(document).on("change",".wooccm-field-change-attribute",(function(e){e.preventDefault();var $change=$(this),$tr=$change.closest("tr");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:$change.data("field_attr"),field_value:$change.val(),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$change.prop("disabled",!0)},success:function(response){console.log(response.data)},complete:function(response){$change.prop("disabled",!1)}}),!1}))}(jQuery);
1
+ !function($){"use strict";var count=0,timer,is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function(){$("#wooccm_modal").addClass("processing")},unblock=function(){$("#wooccm_modal").removeClass("processing")};console.log("wooccm_field.args",wooccm_field.args),_.mixin({sortOptions:function(object){return _.sortBy(object,(function(o){return o.order}))},escapeHtml:function(attribute){return attribute.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function($form){let form=$form.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0}),defaults=Object.assign({},wooccm_field.args),merged;return Object.assign(defaults,form)}});var FieldModel=Backbone.Model.extend({defaults:Object.create(wooccm_field.args)}),FieldModal=Backbone.View.extend({initialize:function(e){var $button,field_id=$(e.target).closest("[data-field_id]").data("field_id"),model=new FieldModel;model.set({id:field_id}),new FieldView({model:model}).render()}}),FieldView=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,"open","tab","edit","load","render","close","submit","parent"),this.init(),this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(view,selector){view.setElement(this.$(selector)).render()},updateModel:function(e){e.preventDefault();var modal=this,$form=this.$el.find("#wooccm_modal").find("form"),model=_.getFormData($form);console.log("model",model),this.model.set(model)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(e){e.preventDefault(),this.undelegateEvents(),$(document).off("focusin"),$("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(e)},enableSave:function(e){$(".media-modal-submit").removeProp("disabled"),this.updateModel(e)},disableSave:function(e){$(".media-modal-submit").prop("disabled",!0)},tab:function(e){e.preventDefault();var modal=this,$modal=this.$el.find("#wooccm_modal"),$tab=$(e.currentTarget),$tabs=$modal.find("ul.wc-tabs"),panel=$tab.find("a").attr("href").replace("#","");$tabs.find(".active").removeClass("active"),$tab.addClass("active"),this.model.attributes.panel=panel,this.model.changed.panel=panel,this.renderPanels(e)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){var modal=this;this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new FieldViewTabs({model:this.model}),this.panels=new FieldViewPanels({model:this.model}),this.info=new FieldViewInfo({model:this.model}),this.assign(this.tabs,"#wooccm-modal-tabs"),this.assign(this.panels,"#wooccm-modal-panels"),this.assign(this.info,"#wooccm-modal-info")},open:function(e){$("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){unblock()}),100)},load:function(){var modal=this;null!=modal.model.attributes.id?$.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",complete:function(){unblock()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.set(response.data),modal.render()):alert(response.data)}}):modal.render()},edit:function(e){e.preventDefault();var modal=this,$button=$(e.target),field_count=parseInt($(".wc_gateways tr[data-field_id]").length),order=parseInt(modal.model.get("order"));count++,timer&&clearTimeout(timer),timer=setTimeout((function(){order=$button.hasClass("media-modal-next")?Math.min(order+count,field_count):Math.max(order-count,1),modal.model.set({id:parseInt($(".wc_gateways tr[data-field_order="+order+"]").data("field_id"))}),count=0,modal.load()}),300)},submit:function(e){e.preventDefault();var modal=this,$modal=modal.$el.find("#wooccm_modal"),$spinner=$modal.find(".settings-save-status .spinner"),$saved=$modal.find(".settings-save-status .saved");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(modal.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){$(".media-modal-submit").prop("disabled",!0),$spinner.addClass("is-active")},complete:function(){$saved.addClass("is-active"),$spinner.removeClass("is-active"),_.delay((function(){$saved.removeClass("is-active")}),1e3)},error:function(response){alert("Error!")},success:function(response){console.log(response),response.success?null==modal.model.attributes.id&&($modal.addClass("reload"),modal.reload(e),modal.close(e)):alert(response.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(e){e.preventDefault();var modal=this,$modal,$details=modal.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(e),$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:modal.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){modal.disableSave(),$details.addClass("save-waiting")},complete:function(){$details.addClass("save-complete"),$details.removeClass("save-waiting"),modal.enableSave()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.attributes.parent=response.data,modal.model.changed.parent=response.data,modal.renderInfo()):alert(response.data)}}),!1}}),FieldViewTabs=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))}}),FieldViewPanels=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")}}),FieldViewInfo=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")}});$("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(e){e.preventDefault();var $button=$(e.target),c;return!!confirm(wooccm_field.message.reset)&&($.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(response){response.success?location.reload():alert(response.data)}}),!1)})),$(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(e){e.preventDefault();var $button,$field=$(e.target).closest("[data-field_id]"),field_id=$field.data("field_id"),c;return!!confirm(wooccm_field.message.remove)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:field_id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?$field.remove():alert(response.data)}}),!1)})),$(document).on("click",".wooccm-field-toggle-attribute",(function(e){e.preventDefault();var $link=$(this),$tr=$link.closest("tr"),$toggle=$link.find(".woocommerce-input-toggle");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:$(this).data("field_attr"),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$toggle.addClass("woocommerce-input-toggle--loading")},success:function(response){!0===response.data?($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--enabled"),$toggle.removeClass("woocommerce-input-toggle--loading")):!0!==response.data&&($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--disabled"),$toggle.removeClass("woocommerce-input-toggle--loading"))}}),!1})),$(document).on("change",".wooccm-field-change-attribute",(function(e){e.preventDefault();var $change=$(this),$tr=$change.closest("tr");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:$change.data("field_attr"),field_value:$change.val(),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$change.prop("disabled",!0)},success:function(response){console.log(response.data)},complete:function(response){$change.prop("disabled",!1)}}),!1}))}(jQuery);
assets/backend/js/wooccm-admin.js CHANGED
@@ -153,9 +153,9 @@
153
  var name = $(this).attr('name');
154
 
155
  // fix serializeJSON empty select and multiselect
156
- if (name.indexOf('[]') >= 0) {
157
- $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
158
- }
159
 
160
  $(this).selectWoo(select2_args).addClass('enhanced');
161
  });
@@ -206,9 +206,9 @@
206
  var name = $(this).attr('name');
207
 
208
  // fix serializeJSON empty select and multiselect
209
- if (name.indexOf('[]') >= 0) {
210
- $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
211
- }
212
 
213
  $(this).selectWoo(select2_args).addClass('enhanced');
214
 
153
  var name = $(this).attr('name');
154
 
155
  // fix serializeJSON empty select and multiselect
156
+ //if (name.indexOf('[]') >= 0) {
157
+ // $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
158
+ //}
159
 
160
  $(this).selectWoo(select2_args).addClass('enhanced');
161
  });
206
  var name = $(this).attr('name');
207
 
208
  // fix serializeJSON empty select and multiselect
209
+ //if (name.indexOf('[]') >= 0) {
210
+ // $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
211
+ //}
212
 
213
  $(this).selectWoo(select2_args).addClass('enhanced');
214
 
assets/backend/js/wooccm-admin.min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";function date_picker_select(datepicker){var option=$(datepicker).next().is(".hasDatepicker")?"minDate":"maxDate",otherDateField="minDate"===option?$(datepicker).next():$(datepicker).prev(),date=$(datepicker).datepicker("getDate");$(otherDateField).datepicker("option",option,date),$(datepicker).change()}function getEnhancedSelectFormatString(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}$(".wooccm-premium-field").closest("tr").addClass("wooccm-premium"),$(document).on("wooccm-enhanced-between-dates",(function(e){$(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each((function(){$(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,onSelect:function(){date_picker_select($(this))}}),$(this).find("input").each((function(){date_picker_select($(this))}))}))})),$(document).on("wooccm-enhanced-options",(function(e){$("table.wc_gateways tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(event,ui){return ui.children().each((function(){$(this).width($(this).width())})),ui.css("left","0"),ui},start:function(event,ui){ui.item.css("background-color","#f6f6f6")},stop:function(event,ui){ui.item.removeAttr("style"),ui.item.trigger("updateMoveButtons")},update:function(event,ui){$(this).find("tr").each((function(i,tr){$(tr).find("input.add-order").val(i).trigger("change")}))}}),$(".wooccm-enhanced-options").each((function(){var $table=$(this),$add=$table.find(".add-option"),$remove=$table.find(".remove-options");$add.on("click",(function(e){var $tr=$table.find("tbody > tr"),id=$tr.length,tr=$tr.first().clone().html().replace(/options\[([0-9]+)\]/g,"options["+id+"]").replace('disabled="disabled"',"").replace('checked="checked"',"").replace('<input value="0"','<input value="'+id+'"').replace('<input value="0"','<input value="'+id+'"');$tr.last().after($("<tr>"+tr+"</tr>")).find("input").trigger("change"),$remove.removeProp("disabled")})),$remove.on("click",(function(e){var $tr;$table.find("tr > td.check-column input:checked").closest("tr").remove(),$table.find("tbody > tr").length<2&&$(this).prop("disabled",!0)}))}))})),$(document).on("wooccm-enhanced-select",(function(e){$(".wooccm-enhanced-select").filter(":not(.enhanced)").each((function(){var select2_args=$.extend({minimumResultsForSearch:10,allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder")},getEnhancedSelectFormatString()),name=$(this).attr("name");name.indexOf("[]")>=0&&$(this).prepend('<input type="hidden" name="'+name+'" value="[]" />'),$(this).selectWoo(select2_args).addClass("enhanced")})),$(".wooccm-product-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")?$(this).data("minimum_input_length"):"3",escapeMarkup:function(m){return m},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(params){return{term:params.term,action:$(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:$(this).select2("val")||0,exclude:$(this).data("exclude"),include:$(this).data("include"),limit:$(this).data("limit"),display_stock:$(this).data("display_stock")}},processResults:function(data){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}},cache:!0}};select2_args=$.extend(select2_args,getEnhancedSelectFormatString());var name=$(this).attr("name");if(name.indexOf("[]")>=0&&$(this).prepend('<input type="hidden" name="'+name+'" value="[]" />'),$(this).selectWoo(select2_args).addClass("enhanced"),$(this).data("sortable")){var $select=$(this),$list=$(this).next(".select2-container").find("ul.select2-selection__rendered");$list.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){$($list.find(".select2-selection__choice").get().reverse()).each((function(){var id=$(this).data("data").id,option=$select.find('option[value="'+id+'"]')[0];$select.prepend(option)}))}})}else $(this).prop("multiple")&&$(this).on("change",(function(){var $children=$(this).children();$children.filter("option").sort((function(a,b){var atext=a.text.toLowerCase(),btext=b.text.toLowerCase();return atext>btext?1:atext<btext?-1:0})),$(this).html($children)}))}))})),$(".wooccm-enhanced-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")||"3",escapeMarkup:function(m){return m},ajax:{url:wooccm_admin.ajax_url,dataType:"json",cache:!0,delay:250,data:function(params){return{term:params.term,key:$(this).data("key"),action:"wooccm_search_field",nonce:wooccm_admin.nonce}},processResults:function(data,params){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}}}};select2_args=$.extend(select2_args,getEnhancedSelectFormatString()),$(this).select2(select2_args).addClass("enhanced")}))}(jQuery);
1
+ !function($){"use strict";function date_picker_select(datepicker){var option=$(datepicker).next().is(".hasDatepicker")?"minDate":"maxDate",otherDateField="minDate"===option?$(datepicker).next():$(datepicker).prev(),date=$(datepicker).datepicker("getDate");$(otherDateField).datepicker("option",option,date),$(datepicker).change()}function getEnhancedSelectFormatString(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}$(".wooccm-premium-field").closest("tr").addClass("wooccm-premium"),$(document).on("wooccm-enhanced-between-dates",(function(e){$(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each((function(){$(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,onSelect:function(){date_picker_select($(this))}}),$(this).find("input").each((function(){date_picker_select($(this))}))}))})),$(document).on("wooccm-enhanced-options",(function(e){$("table.wc_gateways tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(event,ui){return ui.children().each((function(){$(this).width($(this).width())})),ui.css("left","0"),ui},start:function(event,ui){ui.item.css("background-color","#f6f6f6")},stop:function(event,ui){ui.item.removeAttr("style"),ui.item.trigger("updateMoveButtons")},update:function(event,ui){$(this).find("tr").each((function(i,tr){$(tr).find("input.add-order").val(i).trigger("change")}))}}),$(".wooccm-enhanced-options").each((function(){var $table=$(this),$add=$table.find(".add-option"),$remove=$table.find(".remove-options");$add.on("click",(function(e){var $tr=$table.find("tbody > tr"),id=$tr.length,tr=$tr.first().clone().html().replace(/options\[([0-9]+)\]/g,"options["+id+"]").replace('disabled="disabled"',"").replace('checked="checked"',"").replace('<input value="0"','<input value="'+id+'"').replace('<input value="0"','<input value="'+id+'"');$tr.last().after($("<tr>"+tr+"</tr>")).find("input").trigger("change"),$remove.removeProp("disabled")})),$remove.on("click",(function(e){var $tr;$table.find("tr > td.check-column input:checked").closest("tr").remove(),$table.find("tbody > tr").length<2&&$(this).prop("disabled",!0)}))}))})),$(document).on("wooccm-enhanced-select",(function(e){$(".wooccm-enhanced-select").filter(":not(.enhanced)").each((function(){var select2_args=$.extend({minimumResultsForSearch:10,allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder")},getEnhancedSelectFormatString()),name;$(this).attr("name").indexOf("[]"),$(this).selectWoo(select2_args).addClass("enhanced")})),$(".wooccm-product-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")?$(this).data("minimum_input_length"):"3",escapeMarkup:function(m){return m},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(params){return{term:params.term,action:$(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:$(this).select2("val")||0,exclude:$(this).data("exclude"),include:$(this).data("include"),limit:$(this).data("limit"),display_stock:$(this).data("display_stock")}},processResults:function(data){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}},cache:!0}},name;if(select2_args=$.extend(select2_args,getEnhancedSelectFormatString()),$(this).attr("name").indexOf("[]"),$(this).selectWoo(select2_args).addClass("enhanced"),$(this).data("sortable")){var $select=$(this),$list=$(this).next(".select2-container").find("ul.select2-selection__rendered");$list.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){$($list.find(".select2-selection__choice").get().reverse()).each((function(){var id=$(this).data("data").id,option=$select.find('option[value="'+id+'"]')[0];$select.prepend(option)}))}})}else $(this).prop("multiple")&&$(this).on("change",(function(){var $children=$(this).children();$children.filter("option").sort((function(a,b){var atext=a.text.toLowerCase(),btext=b.text.toLowerCase();return atext>btext?1:atext<btext?-1:0})),$(this).html($children)}))}))})),$(".wooccm-enhanced-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")||"3",escapeMarkup:function(m){return m},ajax:{url:wooccm_admin.ajax_url,dataType:"json",cache:!0,delay:250,data:function(params){return{term:params.term,key:$(this).data("key"),action:"wooccm_search_field",nonce:wooccm_admin.nonce}},processResults:function(data,params){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}}}};select2_args=$.extend(select2_args,getEnhancedSelectFormatString()),$(this).select2(select2_args).addClass("enhanced")}))}(jQuery);
assets/frontend/js/wooccm-checkout.js CHANGED
@@ -394,6 +394,8 @@
394
 
395
  if ($.isFunction($.fn.timepicker)) {
396
 
 
 
397
  $input.timepicker({
398
  //timeFormat: 'HH:mm:ss',
399
  showPeriod: true,
394
 
395
  if ($.isFunction($.fn.timepicker)) {
396
 
397
+ console.log($input.data('hours'))
398
+
399
  $input.timepicker({
400
  //timeFormat: 'HH:mm:ss',
401
  showPeriod: true,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.4
6
  Tested up to: 5.5.0
7
- Stable tag: 5.2.0
8
  WC requires at least: 3.1.0
9
  WC tested up to: 4.3.3
10
  License: GPLv3
@@ -107,6 +107,9 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
107
 
108
  == Changelog ==
109
 
 
 
 
110
  = 5.2.0 =
111
  * Fix: premium compatibility
112
  * Fix: datepicker remove all days
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.4
6
  Tested up to: 5.5.0
7
+ Stable tag: 5.2.1
8
  WC requires at least: 3.1.0
9
  WC tested up to: 4.3.3
10
  License: GPLv3
107
 
108
  == Changelog ==
109
 
110
+ = 5.2.1 =
111
+ * Fix: premium compatibility
112
+
113
  = 5.2.0 =
114
  * Fix: premium compatibility
115
  * Fix: datepicker remove all days
woocommerce-checkout-manager.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Checkout Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manages WooCommerce Checkout, the advanced way.
7
- * Version: 5.2.0
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -20,7 +20,7 @@ if (!defined('WOOCCM_PLUGIN_NAME')) {
20
  define('WOOCCM_PLUGIN_NAME', 'Checkout Manager for WooCommerce');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
23
- define('WOOCCM_PLUGIN_VERSION', '5.2.0');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);
4
  * Plugin Name: Checkout Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manages WooCommerce Checkout, the advanced way.
7
+ * Version: 5.2.1
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
20
  define('WOOCCM_PLUGIN_NAME', 'Checkout Manager for WooCommerce');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
23
+ define('WOOCCM_PLUGIN_VERSION', '5.2.1');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);