WooCommerce Checkout Manager - Version 5.1.6

Version Description

  • Fix: premium compatbility
Download this release

Release Info

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

Code changes from version 5.1.4 to 5.1.6

assets/frontend/js/wooccm-checkout.js CHANGED
@@ -20,7 +20,7 @@
20
  var append_image = function (list, i, source, name, filetype) {
21
 
22
  var $field_list = $(list),
23
- source_class;
24
  if (filetype.match('image.*')) {
25
  source_class = 'image';
26
  } else if (filetype.match('application/ms.*')) {
@@ -63,10 +63,10 @@
63
  field.addClass('validate-required');
64
  if (field.find('label .required').length === 0) {
65
  field.find('label').append(
66
- '<abbr class="required" title="' +
67
- wc_address_i18n_params.i18n_required_text +
68
- '">*</abbr>'
69
- );
70
  }
71
 
72
  //fix state hidden
@@ -90,22 +90,22 @@
90
  $.each(locale_fields, function (key, value) {
91
 
92
  var field = thisform.find(value),
93
- required = field.find('[data-required]').data('required') || field.find('.wooccm-required-field').length;
94
 
95
  field_is_required(field, required);
96
  });
97
  });
98
- // Field
99
- // ---------------------------------------------------------------------------
100
 
101
  var fileList = {};
102
 
103
  $('.wooccm-type-file').each(function (i, field) {
104
 
105
  var $field = $(field),
106
- $button_file = $field.find('[type=file]'),
107
- $button_click = $field.find('.wooccm-file-button'),
108
- $field_list = $field.find('.wooccm-file-list');
109
 
110
  fileList[$field.attr('id')] = [];
111
 
@@ -123,7 +123,7 @@
123
  $field_list.on('click', '.wooccm-file-list-delete', function (e) {
124
 
125
  var $file = $(this).closest('.wooccm-file-file'),
126
- file_id = $(this).closest('[data-file_id]').data('file_id');
127
 
128
  fileList[$field.attr('id')] = $.grep(fileList[$field.attr('id')], function (value, index) {
129
  return index != file_id;
@@ -165,7 +165,6 @@
165
  }, 200);
166
  };
167
  })(file);
168
- console.log(file.name);
169
  reader.readAsDataURL(file);
170
  });
171
  }
@@ -175,22 +174,22 @@
175
  // Add class on place order reload if upload field exists
176
  // ---------------------------------------------------------------------------
177
 
178
- // $(document).on('checkout_place_order_success', function (e) {
179
- // alert('submit!');
180
- // });
181
- // $('form.checkout').on('checkout_place_order_success', function (e) {
182
- // alert('submit!');
183
- // });
184
  $('#order_review').on('ajaxSuccess wooccm_upload', function (e, xhr, settings) {
185
 
186
- // console.log('e', e);
187
- // console.log('xhr', xhr);
188
- // console.log('settings', settings);
189
 
190
  var $order_review = $(e.target),
191
- $place_order = $order_review.find('#place_order'),
192
- $fields = $('.wooccm-type-file'),
193
- fields = $fields.length;
194
 
195
  if (fields) {
196
  $place_order.addClass('wooccm-upload-process');
@@ -206,8 +205,8 @@
206
 
207
  e.preventDefault();
208
  var $form = $('form.checkout'),
209
- $place_order = $(this),
210
- $fields = $('.wooccm-type-file');
211
 
212
  if (!$fields.length) {
213
  return;
@@ -229,8 +228,8 @@
229
  $.each(fileList, function (field_id, files) {
230
 
231
  var $field = $('#' + field_id),
232
- $attachment_ids = $field.find('.wooccm-file-field'),
233
- data = new FormData();
234
 
235
  $.each(files, function (file_id, file) {
236
 
@@ -293,14 +292,15 @@
293
  $('.wooccm-conditional-child').each(function (i, field) {
294
 
295
  var $field = $(field),
296
- $parent = $('#' + $field.find('[data-conditional-parent]').data('conditional-parent') + '_field'),
297
- show_if_value = $field.find('[data-conditional-parent-value]').data('conditional-parent-value').toString();
 
298
  if ($parent.length) {
299
 
300
  $parent.on('wooccm_change change keyup', function (e) {
301
 
302
  var $this = $(e.target),
303
- value = $this.val();
304
  // fix for select2 search
305
  if ($this.hasClass('select2-selection')) {
306
  return;
@@ -365,7 +365,7 @@
365
  $('.wooccm-enhanced-datepicker').each(function (i, field) {
366
 
367
  var $input = $(this),
368
- disable = $input.data('disable') || false;
369
 
370
  console.log('mindate', $input.data('mindate'));
371
 
@@ -375,7 +375,7 @@
375
  minDate: $input.data('mindate'),
376
  maxDate: $input.data('maxdate'),
377
  beforeShowDay: function (date) {
378
- var day = date.getDay().toString();
379
  if (disable) {
380
  return [$.inArray(day, disable) === -1];
381
  }
@@ -393,12 +393,23 @@
393
  var $input = $(this);
394
 
395
  if ($.isFunction($.fn.timepicker)) {
 
396
  $input.timepicker({
397
  //timeFormat: 'HH:mm:ss',
398
  showPeriod: true,
399
  showLeadingZero: true,
400
  hours: $input.data('hours') || undefined,
401
  minutes: $input.data('minutes') || undefined,
 
 
 
 
 
 
 
 
 
 
402
  });
403
  }
404
 
@@ -409,8 +420,8 @@
409
  $('.wooccm-colorpicker-farbtastic').each(function (i, field) {
410
 
411
  var $field = $(field),
412
- $input = $field.find('input[type=text]'),
413
- $container = $field.find('.wooccmcolorpicker_container');
414
  $input.hide();
415
  if ($.isFunction($.fn.farbtastic)) {
416
 
@@ -424,7 +435,7 @@
424
  $('.wooccm-colorpicker-iris').each(function (i, field) {
425
 
426
  var $field = $(field),
427
- $input = $field.find('input[type=text]');
428
  $input.css('background', $input.val());
429
  $input.on('click', function (e) {
430
 
20
  var append_image = function (list, i, source, name, filetype) {
21
 
22
  var $field_list = $(list),
23
+ source_class;
24
  if (filetype.match('image.*')) {
25
  source_class = 'image';
26
  } else if (filetype.match('application/ms.*')) {
63
  field.addClass('validate-required');
64
  if (field.find('label .required').length === 0) {
65
  field.find('label').append(
66
+ '<abbr class="required" title="' +
67
+ wc_address_i18n_params.i18n_required_text +
68
+ '">*</abbr>'
69
+ );
70
  }
71
 
72
  //fix state hidden
90
  $.each(locale_fields, function (key, value) {
91
 
92
  var field = thisform.find(value),
93
+ required = field.find('[data-required]').data('required') || field.find('.wooccm-required-field').length;
94
 
95
  field_is_required(field, required);
96
  });
97
  });
98
+ // Field
99
+ // ---------------------------------------------------------------------------
100
 
101
  var fileList = {};
102
 
103
  $('.wooccm-type-file').each(function (i, field) {
104
 
105
  var $field = $(field),
106
+ $button_file = $field.find('[type=file]'),
107
+ $button_click = $field.find('.wooccm-file-button'),
108
+ $field_list = $field.find('.wooccm-file-list');
109
 
110
  fileList[$field.attr('id')] = [];
111
 
123
  $field_list.on('click', '.wooccm-file-list-delete', function (e) {
124
 
125
  var $file = $(this).closest('.wooccm-file-file'),
126
+ file_id = $(this).closest('[data-file_id]').data('file_id');
127
 
128
  fileList[$field.attr('id')] = $.grep(fileList[$field.attr('id')], function (value, index) {
129
  return index != file_id;
165
  }, 200);
166
  };
167
  })(file);
 
168
  reader.readAsDataURL(file);
169
  });
170
  }
174
  // Add class on place order reload if upload field exists
175
  // ---------------------------------------------------------------------------
176
 
177
+ // $(document).on('checkout_place_order_success', function (e) {
178
+ // alert('submit!');
179
+ // });
180
+ // $('form.checkout').on('checkout_place_order_success', function (e) {
181
+ // alert('submit!');
182
+ // });
183
  $('#order_review').on('ajaxSuccess wooccm_upload', function (e, xhr, settings) {
184
 
185
+ // console.log('e', e);
186
+ // console.log('xhr', xhr);
187
+ // console.log('settings', settings);
188
 
189
  var $order_review = $(e.target),
190
+ $place_order = $order_review.find('#place_order'),
191
+ $fields = $('.wooccm-type-file'),
192
+ fields = $fields.length;
193
 
194
  if (fields) {
195
  $place_order.addClass('wooccm-upload-process');
205
 
206
  e.preventDefault();
207
  var $form = $('form.checkout'),
208
+ $place_order = $(this),
209
+ $fields = $('.wooccm-type-file');
210
 
211
  if (!$fields.length) {
212
  return;
228
  $.each(fileList, function (field_id, files) {
229
 
230
  var $field = $('#' + field_id),
231
+ $attachment_ids = $field.find('.wooccm-file-field'),
232
+ data = new FormData();
233
 
234
  $.each(files, function (file_id, file) {
235
 
292
  $('.wooccm-conditional-child').each(function (i, field) {
293
 
294
  var $field = $(field),
295
+ $parent = $('#' + $field.find('[data-conditional-parent]').data('conditional-parent') + '_field'),
296
+ show_if_value = $field.find('[data-conditional-parent-value]').length && $field.find('[data-conditional-parent-value]').data('conditional-parent-value').toString();
297
+
298
  if ($parent.length) {
299
 
300
  $parent.on('wooccm_change change keyup', function (e) {
301
 
302
  var $this = $(e.target),
303
+ value = $this.val();
304
  // fix for select2 search
305
  if ($this.hasClass('select2-selection')) {
306
  return;
365
  $('.wooccm-enhanced-datepicker').each(function (i, field) {
366
 
367
  var $input = $(this),
368
+ disable = $input.data('disable') || false;
369
 
370
  console.log('mindate', $input.data('mindate'));
371
 
375
  minDate: $input.data('mindate'),
376
  maxDate: $input.data('maxdate'),
377
  beforeShowDay: function (date) {
378
+ var day = date.getDay() != undefined && date.getDay().toString();
379
  if (disable) {
380
  return [$.inArray(day, disable) === -1];
381
  }
393
  var $input = $(this);
394
 
395
  if ($.isFunction($.fn.timepicker)) {
396
+
397
  $input.timepicker({
398
  //timeFormat: 'HH:mm:ss',
399
  showPeriod: true,
400
  showLeadingZero: true,
401
  hours: $input.data('hours') || undefined,
402
  minutes: $input.data('minutes') || undefined,
403
+ /* hours: {
404
+ starts: 9, // First displayed hour
405
+ ends: 21 // Last displayed hour
406
+ },
407
+ minutes: {
408
+ starts: 5, // First displayed minute
409
+ ends: 55, // Last displayed minute
410
+ interval: 5, // Interval of displayed minutes
411
+ manual: [] // Optional extra entries for minutes
412
+ }, */
413
  });
414
  }
415
 
420
  $('.wooccm-colorpicker-farbtastic').each(function (i, field) {
421
 
422
  var $field = $(field),
423
+ $input = $field.find('input[type=text]'),
424
+ $container = $field.find('.wooccmcolorpicker_container');
425
  $input.hide();
426
  if ($.isFunction($.fn.farbtastic)) {
427
 
435
  $('.wooccm-colorpicker-iris').each(function (i, field) {
436
 
437
  var $field = $(field),
438
+ $input = $field.find('input[type=text]');
439
  $input.css('background', $input.val());
440
  $input.on('click', function (e) {
441
 
assets/frontend/js/wooccm-checkout.min.js CHANGED
@@ -1 +1 @@
1
- !function($){var is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function($node){is_blocked($node)||$node.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock=function($node){$node.removeClass("processing").unblock()},append_image=function(list,i,source,name,filetype){var $field_list=$(list),source_class;filetype.match("image.*")?source_class="image":filetype.match("application/ms.*")?(source=wooccm_upload.icons.spreadsheet,source_class="spreadsheet"):filetype.match("application/x.*")?(source=wooccm_upload.icons.archive,source_class="application"):filetype.match("audio.*")?(source=wooccm_upload.icons.audio,source_class="audio"):filetype.match("text.*")?(source=wooccm_upload.icons.text,source_class="text"):filetype.match("video.*")?(source=wooccm_upload.icons.video,source_class="video"):(source=wooccm_upload.icons.interactive,source_class="interactive");var html='<span data-file_id="'+i+'" title="'+name+'" class="wooccm-file-file">\n <span class="wooccm-file-list-container">\n <a title="'+name+'" class="wooccm-file-list-delete">×</a>\n <span class="wooccm-file-list-image-container">\n <img class="'+source_class+'" alt="'+name+'" src="'+source+'"/>\n </span>\n </span>\n </span>';$field_list.append(html).fadeIn()};function field_is_required(field,is_required){is_required?(field.find("label .optional").remove(),field.addClass("validate-required"),0===field.find("label .required").length&&field.find("label").append('<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),field.show(),field.find("input[type=hidden]").prop("type","text")):(field.find("label .required").remove(),field.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===field.find("label .optional").length&&field.find("label").append('<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}$(document).on("country_to_state_changing",(function(event,country,wrapper){var thisform=wrapper,thislocale,locale_fields=$.parseJSON(wc_address_i18n_params.locale_fields);$.each(locale_fields,(function(key,value){var field=thisform.find(value),required=field.find("[data-required]").data("required")||field.find(".wooccm-required-field").length;field_is_required(field,required)}))}));var fileList={};if($(".wooccm-type-file").each((function(i,field){var $field=$(field),$button_file=$field.find("[type=file]"),$button_click=$field.find(".wooccm-file-button"),$field_list=$field.find(".wooccm-file-list");fileList[$field.attr("id")]=[],$button_click.on("click",(function(e){e.preventDefault(),$button_file.trigger("click")})),$field_list.on("click",".wooccm-file-list-delete",(function(e){var $file=$(this).closest(".wooccm-file-file"),file_id=$(this).closest("[data-file_id]").data("file_id");fileList[$field.attr("id")]=$.grep(fileList[$field.attr("id")],(function(value,index){return index!=file_id})),$file.remove(),$("#order_review").trigger("wooccm_upload")})),$button_file.on("change",(function(e){var files=$(this)[0].files;files.length&&window.FileReader&&$.each(files,(function(i,file){var count,theFile;return $field_list.find("span[data-file_id]").length+i>=wooccm_upload.limit.max_files?(alert("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1):file.size>wooccm_upload.limit.max_file_size?(alert("Exeeds max file size of "+wooccm_upload.limit.max_file_size),!0):(reader=new FileReader,reader.onload=(theFile=file,function(e){setTimeout((function(){append_image($field_list,fileList[$field.attr("id")].push(file)-1,e.target.result,theFile.name,theFile.type),$("#order_review").trigger("wooccm_upload")}),200)}),console.log(file.name),void reader.readAsDataURL(file))}))}))})),$("#order_review").on("ajaxSuccess wooccm_upload",(function(e,xhr,settings){var $order_review,$place_order=$(e.target).find("#place_order"),$fields,fields;$(".wooccm-type-file").length?$place_order.addClass("wooccm-upload-process"):$place_order.removeClass("wooccm-upload-process")})),$(document).on("click","#place_order.wooccm-upload-process",(function(e){e.preventDefault();var $form=$("form.checkout"),$place_order=$(this),$fields;$(".wooccm-type-file").length&&window.FormData&&Object.keys(fileList).length&&(is_blocked($form)||($place_order.html(wooccm_upload.message.uploading),block($form)),$.each(fileList,(function(field_id,files){var $field,$attachment_ids=$("#"+field_id).find(".wooccm-file-field"),data=new FormData;$.each(files,(function(file_id,file){return file_id>wooccm_upload.limit.max_files?(console.log("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1):file.size>wooccm_upload.limit.max_file_size?(console.log("Exeeds max file size of "+wooccm_upload.limit.max_files),!0):(console.log("We're ready to upload "+file.name),void data.append("wooccm_checkout_attachment_upload[]",file))})),data.append("action","wooccm_checkout_attachment_upload"),data.append("nonce",wooccm_upload.nonce),$.ajax({async:!1,url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:data,processData:!1,contentType:!1,beforeSend:function(response){},success:function(response){response.success?$attachment_ids.val(response.data):$("body").trigger("update_checkout")},complete:function(response){}})})),unblock($form),$place_order.removeClass("wooccm-upload-process").trigger("click"))})),$(document).on("change",".wooccm-add-price",(function(e){$("body").trigger("update_checkout")})),$(".wooccm-conditional-child").each((function(i,field){var $field=$(field),$parent=$("#"+$field.find("[data-conditional-parent]").data("conditional-parent")+"_field"),show_if_value=$field.find("[data-conditional-parent-value]").data("conditional-parent-value").toString();$parent.length?($parent.on("wooccm_change change keyup",(function(e){var $this=$(e.target),value=$this.val();$this.hasClass("select2-selection")||("checkbox"==$this.prop("type")&&(value=-1!==$this.attr("name").indexOf("[]")?$parent.find("input:checked").map((function(i,e){return e.value})).toArray():$this.is(":checked")),show_if_value==value||$.isArray(value)&&value.indexOf(show_if_value)>-1?$field.fadeIn():$field.fadeOut(),$this.off("wooccm_change"),$this.off("change"),$this.off("keyup"),$field.trigger("change"))})),$parent.find("select:first").trigger("wooccm_change"),$parent.find("textarea:first").trigger("wooccm_change"),$parent.find("input[type=button]:first").trigger("wooccm_change"),$parent.find("input[type=radio]:checked:first").trigger("wooccm_change"),$parent.find("input[type=checkbox]:checked:first").trigger("wooccm_change"),$parent.find("input[type=color]:first").trigger("wooccm_change"),$parent.find("input[type=date]:first").trigger("wooccm_change"),$parent.find("input[type=datetime-local]:first").trigger("wooccm_change"),$parent.find("input[type=email]:first").trigger("wooccm_change"),$parent.find("input[type=file]:first").trigger("wooccm_change"),$parent.find("input[type=hidden]:first").trigger("wooccm_change"),$parent.find("input[type=image]:first").trigger("wooccm_change"),$parent.find("input[type=month]:first").trigger("wooccm_change"),$parent.find("input[type=number]:first").trigger("wooccm_change"),$parent.find("input[type=password]:first").trigger("wooccm_change"),$parent.find("input[type=range]:first").trigger("wooccm_change"),$parent.find("input[type=reset]:first").trigger("wooccm_change"),$parent.find("input[type=search]:first").trigger("wooccm_change"),$parent.find("input[type=submit]:first").trigger("wooccm_change"),$parent.find("input[type=tel]:first").trigger("wooccm_change"),$parent.find("input[type=text]:first").trigger("wooccm_change"),$parent.find("input[type=time]:first").trigger("wooccm_change"),$parent.find("input[type=url]:first").trigger("wooccm_change"),$parent.find("input[type=week]:first").trigger("wooccm_change")):$field.show()})),$(".wooccm-enhanced-datepicker").each((function(i,field){var $input=$(this),disable=$input.data("disable")||!1;console.log("mindate",$input.data("mindate")),$.isFunction($.fn.datepicker)&&$input.datepicker({dateFormat:$input.data("formatdate")||"dd-mm-yy",minDate:$input.data("mindate"),maxDate:$input.data("maxdate"),beforeShowDay:function(date){var day=date.getDay().toString();return disable?[-1===$.inArray(day,disable)]:[!0]}})})),$(".wooccm-enhanced-timepicker").each((function(i,field){var $input=$(this);$.isFunction($.fn.timepicker)&&$input.timepicker({showPeriod:!0,showLeadingZero:!0,hours:$input.data("hours")||void 0,minutes:$input.data("minutes")||void 0})})),$(".wooccm-colorpicker-farbtastic").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]"),$container=$field.find(".wooccmcolorpicker_container");$input.hide(),$.isFunction($.fn.farbtastic)&&($container.farbtastic("#"+$input.attr("id")),$container.on("click",(function(e){$input.fadeIn()})))})),$(".wooccm-colorpicker-iris").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]");$input.css("background",$input.val()),$input.on("click",(function(e){$field.toggleClass("active")})),$input.iris({class:$input.attr("id"),palettes:!0,color:"",hide:!1,change:function(event,ui){$input.css("background",ui.color.toString()).fadeIn()}})})),$(document).on("click",(function(e){0===$(e.target).closest(".iris-picker").length&&$(".wooccm-colorpicker-iris").removeClass("active")})),"undefined"==typeof wc_country_select_params)return!1;if($().selectWoo){var getEnhancedSelectFormatString=function(){return{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}}},wooccm_enhanced_select;(function(){$("select.wooccm-enhanced-select").each((function(){var select2_args=$.extend({width:"100%",placeholder:$(this).data("placeholder")||"",allowClear:$(this).data("allowclear")||!1,selectOnClose:$(this).data("selectonclose")||!1,closeOnSelect:$(this).data("closeonselect")||!1,minimumResultsForSearch:$(this).data("search")||-1},getEnhancedSelectFormatString());$(this).on("select2:select",(function(){$(this).focus()})).selectWoo(select2_args)}))})()}}(jQuery);
1
+ !function($){var is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function($node){is_blocked($node)||$node.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock=function($node){$node.removeClass("processing").unblock()},append_image=function(list,i,source,name,filetype){var $field_list=$(list),source_class;filetype.match("image.*")?source_class="image":filetype.match("application/ms.*")?(source=wooccm_upload.icons.spreadsheet,source_class="spreadsheet"):filetype.match("application/x.*")?(source=wooccm_upload.icons.archive,source_class="application"):filetype.match("audio.*")?(source=wooccm_upload.icons.audio,source_class="audio"):filetype.match("text.*")?(source=wooccm_upload.icons.text,source_class="text"):filetype.match("video.*")?(source=wooccm_upload.icons.video,source_class="video"):(source=wooccm_upload.icons.interactive,source_class="interactive");var html='<span data-file_id="'+i+'" title="'+name+'" class="wooccm-file-file">\n <span class="wooccm-file-list-container">\n <a title="'+name+'" class="wooccm-file-list-delete">×</a>\n <span class="wooccm-file-list-image-container">\n <img class="'+source_class+'" alt="'+name+'" src="'+source+'"/>\n </span>\n </span>\n </span>';$field_list.append(html).fadeIn()};function field_is_required(field,is_required){is_required?(field.find("label .optional").remove(),field.addClass("validate-required"),0===field.find("label .required").length&&field.find("label").append('<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),field.show(),field.find("input[type=hidden]").prop("type","text")):(field.find("label .required").remove(),field.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===field.find("label .optional").length&&field.find("label").append('<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}$(document).on("country_to_state_changing",(function(event,country,wrapper){var thisform=wrapper,thislocale,locale_fields=$.parseJSON(wc_address_i18n_params.locale_fields);$.each(locale_fields,(function(key,value){var field=thisform.find(value),required=field.find("[data-required]").data("required")||field.find(".wooccm-required-field").length;field_is_required(field,required)}))}));var fileList={};if($(".wooccm-type-file").each((function(i,field){var $field=$(field),$button_file=$field.find("[type=file]"),$button_click=$field.find(".wooccm-file-button"),$field_list=$field.find(".wooccm-file-list");fileList[$field.attr("id")]=[],$button_click.on("click",(function(e){e.preventDefault(),$button_file.trigger("click")})),$field_list.on("click",".wooccm-file-list-delete",(function(e){var $file=$(this).closest(".wooccm-file-file"),file_id=$(this).closest("[data-file_id]").data("file_id");fileList[$field.attr("id")]=$.grep(fileList[$field.attr("id")],(function(value,index){return index!=file_id})),$file.remove(),$("#order_review").trigger("wooccm_upload")})),$button_file.on("change",(function(e){var files=$(this)[0].files;files.length&&window.FileReader&&$.each(files,(function(i,file){var count,theFile;return $field_list.find("span[data-file_id]").length+i>=wooccm_upload.limit.max_files?(alert("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1):file.size>wooccm_upload.limit.max_file_size?(alert("Exeeds max file size of "+wooccm_upload.limit.max_file_size),!0):(reader=new FileReader,reader.onload=(theFile=file,function(e){setTimeout((function(){append_image($field_list,fileList[$field.attr("id")].push(file)-1,e.target.result,theFile.name,theFile.type),$("#order_review").trigger("wooccm_upload")}),200)}),void reader.readAsDataURL(file))}))}))})),$("#order_review").on("ajaxSuccess wooccm_upload",(function(e,xhr,settings){var $order_review,$place_order=$(e.target).find("#place_order"),$fields,fields;$(".wooccm-type-file").length?$place_order.addClass("wooccm-upload-process"):$place_order.removeClass("wooccm-upload-process")})),$(document).on("click","#place_order.wooccm-upload-process",(function(e){e.preventDefault();var $form=$("form.checkout"),$place_order=$(this),$fields;$(".wooccm-type-file").length&&window.FormData&&Object.keys(fileList).length&&(is_blocked($form)||($place_order.html(wooccm_upload.message.uploading),block($form)),$.each(fileList,(function(field_id,files){var $field,$attachment_ids=$("#"+field_id).find(".wooccm-file-field"),data=new FormData;$.each(files,(function(file_id,file){return file_id>wooccm_upload.limit.max_files?(console.log("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1):file.size>wooccm_upload.limit.max_file_size?(console.log("Exeeds max file size of "+wooccm_upload.limit.max_files),!0):(console.log("We're ready to upload "+file.name),void data.append("wooccm_checkout_attachment_upload[]",file))})),data.append("action","wooccm_checkout_attachment_upload"),data.append("nonce",wooccm_upload.nonce),$.ajax({async:!1,url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:data,processData:!1,contentType:!1,beforeSend:function(response){},success:function(response){response.success?$attachment_ids.val(response.data):$("body").trigger("update_checkout")},complete:function(response){}})})),unblock($form),$place_order.removeClass("wooccm-upload-process").trigger("click"))})),$(document).on("change",".wooccm-add-price",(function(e){$("body").trigger("update_checkout")})),$(".wooccm-conditional-child").each((function(i,field){var $field=$(field),$parent=$("#"+$field.find("[data-conditional-parent]").data("conditional-parent")+"_field"),show_if_value=$field.find("[data-conditional-parent-value]").length&&$field.find("[data-conditional-parent-value]").data("conditional-parent-value").toString();$parent.length?($parent.on("wooccm_change change keyup",(function(e){var $this=$(e.target),value=$this.val();$this.hasClass("select2-selection")||("checkbox"==$this.prop("type")&&(value=-1!==$this.attr("name").indexOf("[]")?$parent.find("input:checked").map((function(i,e){return e.value})).toArray():$this.is(":checked")),show_if_value==value||$.isArray(value)&&value.indexOf(show_if_value)>-1?$field.fadeIn():$field.fadeOut(),$this.off("wooccm_change"),$this.off("change"),$this.off("keyup"),$field.trigger("change"))})),$parent.find("select:first").trigger("wooccm_change"),$parent.find("textarea:first").trigger("wooccm_change"),$parent.find("input[type=button]:first").trigger("wooccm_change"),$parent.find("input[type=radio]:checked:first").trigger("wooccm_change"),$parent.find("input[type=checkbox]:checked:first").trigger("wooccm_change"),$parent.find("input[type=color]:first").trigger("wooccm_change"),$parent.find("input[type=date]:first").trigger("wooccm_change"),$parent.find("input[type=datetime-local]:first").trigger("wooccm_change"),$parent.find("input[type=email]:first").trigger("wooccm_change"),$parent.find("input[type=file]:first").trigger("wooccm_change"),$parent.find("input[type=hidden]:first").trigger("wooccm_change"),$parent.find("input[type=image]:first").trigger("wooccm_change"),$parent.find("input[type=month]:first").trigger("wooccm_change"),$parent.find("input[type=number]:first").trigger("wooccm_change"),$parent.find("input[type=password]:first").trigger("wooccm_change"),$parent.find("input[type=range]:first").trigger("wooccm_change"),$parent.find("input[type=reset]:first").trigger("wooccm_change"),$parent.find("input[type=search]:first").trigger("wooccm_change"),$parent.find("input[type=submit]:first").trigger("wooccm_change"),$parent.find("input[type=tel]:first").trigger("wooccm_change"),$parent.find("input[type=text]:first").trigger("wooccm_change"),$parent.find("input[type=time]:first").trigger("wooccm_change"),$parent.find("input[type=url]:first").trigger("wooccm_change"),$parent.find("input[type=week]:first").trigger("wooccm_change")):$field.show()})),$(".wooccm-enhanced-datepicker").each((function(i,field){var $input=$(this),disable=$input.data("disable")||!1;console.log("mindate",$input.data("mindate")),$.isFunction($.fn.datepicker)&&$input.datepicker({dateFormat:$input.data("formatdate")||"dd-mm-yy",minDate:$input.data("mindate"),maxDate:$input.data("maxdate"),beforeShowDay:function(date){var day=null!=date.getDay()&&date.getDay().toString();return disable?[-1===$.inArray(day,disable)]:[!0]}})})),$(".wooccm-enhanced-timepicker").each((function(i,field){var $input=$(this);$.isFunction($.fn.timepicker)&&$input.timepicker({showPeriod:!0,showLeadingZero:!0,hours:$input.data("hours")||void 0,minutes:$input.data("minutes")||void 0})})),$(".wooccm-colorpicker-farbtastic").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]"),$container=$field.find(".wooccmcolorpicker_container");$input.hide(),$.isFunction($.fn.farbtastic)&&($container.farbtastic("#"+$input.attr("id")),$container.on("click",(function(e){$input.fadeIn()})))})),$(".wooccm-colorpicker-iris").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]");$input.css("background",$input.val()),$input.on("click",(function(e){$field.toggleClass("active")})),$input.iris({class:$input.attr("id"),palettes:!0,color:"",hide:!1,change:function(event,ui){$input.css("background",ui.color.toString()).fadeIn()}})})),$(document).on("click",(function(e){0===$(e.target).closest(".iris-picker").length&&$(".wooccm-colorpicker-iris").removeClass("active")})),"undefined"==typeof wc_country_select_params)return!1;if($().selectWoo){var getEnhancedSelectFormatString=function(){return{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}}},wooccm_enhanced_select;(function(){$("select.wooccm-enhanced-select").each((function(){var select2_args=$.extend({width:"100%",placeholder:$(this).data("placeholder")||"",allowClear:$(this).data("allowclear")||!1,selectOnClose:$(this).data("selectonclose")||!1,closeOnSelect:$(this).data("closeonselect")||!1,minimumResultsForSearch:$(this).data("search")||-1},getEnhancedSelectFormatString());$(this).on("select2:select",(function(){$(this).focus()})).selectWoo(select2_args)}))})()}}(jQuery);
includes/view/backend/pages/modals/parts/panel-timepicker.php CHANGED
@@ -11,12 +11,12 @@
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="time" 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="time" 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">
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="time" placeholder="6" step="3600000" 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="time" placeholder="9" step="3600000" 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">
includes/view/backend/pages/parts/loop.php CHANGED
@@ -12,17 +12,18 @@
12
  <th class="type" style="width:1%"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
13
  <th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
14
  <th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
15
- <th class="id" style="width:1%;"><?php esc_html_e('ID', 'woocommerce-checkout-manager'); ?></th>
16
  <!--<th class="listable"><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></th>
17
  <th class="sortable"><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></th>
18
  <th class="filterable"><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></th>-->
 
 
19
  <th class="status" style="width:1%"><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></th>
20
  <th class="edit" style="width:1%"></th>
21
  <th class="delete" style="width:1%"></th>
22
  </tr>
23
  </thead>
24
  <tbody class="ui-sortable">
25
- <?php if (count($fields)): ?>
26
  <?php foreach ($fields as $id => $field) : ?>
27
  <tr data-field_id="<?php echo esc_attr($field['id']); ?>" data-field_order="<?php echo esc_attr($field['order']); ?>">
28
  <td class="sort ui-sortable-handle">
@@ -69,14 +70,17 @@
69
  </td>
70
  <td class="placeholder">
71
  <?php echo esc_html($field['placeholder']); ?>
72
- </td>
 
 
 
73
  <td class="id">
74
  <?php echo esc_html($field['key']); ?>
75
- </td>
76
  <!--<td class="listable">
77
  <?php
78
  if ($field['listable'] === true) {
79
- ?>
80
  <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
81
  <?php } else { ?>
82
  <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
@@ -85,7 +89,7 @@
85
  <td class="sortable">
86
  <?php
87
  if ($field['sortable'] === true) {
88
- ?>
89
  <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
90
  <?php } else { ?>
91
  <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
@@ -94,7 +98,7 @@
94
  <td class="filterable">
95
  <?php
96
  if ($field['filterable'] === true) {
97
- ?>
98
  <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
99
  <?php } else { ?>
100
  <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
@@ -115,7 +119,7 @@
115
  <a class="<?php printf('wooccm_%s_settings_edit', $current_section); ?> button" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
116
  </td>
117
  <td class="delete">
118
- <?php if (is_array($defaults) && !in_array($field['key'], array_column($defaults, 'key'))): ?>
119
  <a class="<?php printf('wooccm_%s_settings_delete', $current_section); ?>" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
120
  <?php endif; ?>
121
  </td>
12
  <th class="type" style="width:1%"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
13
  <th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
14
  <th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
 
15
  <!--<th class="listable"><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></th>
16
  <th class="sortable"><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></th>
17
  <th class="filterable"><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></th>-->
18
+ <th class="parent" style="width:1%"><?php esc_html_e('Parent', 'woocommerce-checkout-manager'); ?></th>
19
+ <th class="id" style="width:1%;"><?php esc_html_e('ID', 'woocommerce-checkout-manager'); ?></th>
20
  <th class="status" style="width:1%"><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></th>
21
  <th class="edit" style="width:1%"></th>
22
  <th class="delete" style="width:1%"></th>
23
  </tr>
24
  </thead>
25
  <tbody class="ui-sortable">
26
+ <?php if (count($fields)) : ?>
27
  <?php foreach ($fields as $id => $field) : ?>
28
  <tr data-field_id="<?php echo esc_attr($field['id']); ?>" data-field_order="<?php echo esc_attr($field['order']); ?>">
29
  <td class="sort ui-sortable-handle">
70
  </td>
71
  <td class="placeholder">
72
  <?php echo esc_html($field['placeholder']); ?>
73
+ </td>
74
+ <td class="parent">
75
+ <?php echo esc_attr($field['conditional_parent_key']); ?>
76
+ </td>
77
  <td class="id">
78
  <?php echo esc_html($field['key']); ?>
79
+ </td>
80
  <!--<td class="listable">
81
  <?php
82
  if ($field['listable'] === true) {
83
+ ?>
84
  <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
85
  <?php } else { ?>
86
  <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
89
  <td class="sortable">
90
  <?php
91
  if ($field['sortable'] === true) {
92
+ ?>
93
  <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
94
  <?php } else { ?>
95
  <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
98
  <td class="filterable">
99
  <?php
100
  if ($field['filterable'] === true) {
101
+ ?>
102
  <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
103
  <?php } else { ?>
104
  <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
119
  <a class="<?php printf('wooccm_%s_settings_edit', $current_section); ?> button" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
120
  </td>
121
  <td class="delete">
122
+ <?php if (is_array($defaults) && !in_array($field['key'], array_column($defaults, 'key'))) : ?>
123
  <a class="<?php printf('wooccm_%s_settings_delete', $current_section); ?>" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
124
  <?php endif; ?>
125
  </td>
readme.txt CHANGED
@@ -4,9 +4,9 @@ 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.4.2
7
- Stable tag: 5.1.4
8
  WC requires at least: 3.1.0
9
- WC tested up to: 4.3.0
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
 
@@ -107,6 +107,12 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
107
 
108
  == Changelog ==
109
 
 
 
 
 
 
 
110
  = 5.1.4 =
111
  * New: text field maxlength
112
  * New: textarea field maxlength
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.4.2
7
+ Stable tag: 5.1.6
8
  WC requires at least: 3.1.0
9
+ WC tested up to: 4.3.1
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
 
107
 
108
  == Changelog ==
109
 
110
+ = 5.1.6 =
111
+ * Fix: premium compatbility
112
+
113
+ = 5.1.5 =
114
+ * Fix: undefined getDay
115
+
116
  = 5.1.4 =
117
  * New: text field maxlength
118
  * New: textarea field maxlength
woocommerce-checkout-manager.php CHANGED
@@ -4,13 +4,13 @@
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.1.4
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
11
  * Text Domain: woocommerce-checkout-manager
12
  * WC requires at least: 3.1.0
13
- * WC tested up to: 4.3.0
14
  */
15
  if (!defined('ABSPATH')) {
16
  die('-1');
@@ -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.1.4');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);
@@ -53,7 +53,7 @@ if (!defined('WOOCCM_GROUP_URL')) {
53
  define('WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
54
  }
55
  if (!defined('WOOCCM_DEVELOPER')) {
56
- define('WOOCCM_DEVELOPER', false);
57
  }
58
 
59
  if (!class_exists('WOOCCM', false)) {
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.1.6
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
11
  * Text Domain: woocommerce-checkout-manager
12
  * WC requires at least: 3.1.0
13
+ * WC tested up to: 4.3.1
14
  */
15
  if (!defined('ABSPATH')) {
16
  die('-1');
20
  define('WOOCCM_PLUGIN_NAME', 'Checkout Manager for WooCommerce');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
23
+ define('WOOCCM_PLUGIN_VERSION', '5.1.6');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);
53
  define('WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
54
  }
55
  if (!defined('WOOCCM_DEVELOPER')) {
56
+ define('WOOCCM_DEVELOPER', true);
57
  }
58
 
59
  if (!class_exists('WOOCCM', false)) {