WooCommerce Checkout Manager - Version 5.2.2

Version Description

  • Fix: file upload
Download this release

Release Info

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

Code changes from version 5.2.1 to 5.2.2

assets/frontend/js/wooccm-checkout.js CHANGED
@@ -157,7 +157,8 @@
157
  return true;
158
  }
159
 
160
- reader = new FileReader();
 
161
  reader.onload = (function (theFile) {
162
  return function (e) {
163
  setTimeout(function () {
@@ -394,8 +395,6 @@
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,
157
  return true;
158
  }
159
 
160
+ var reader = new FileReader();
161
+
162
  reader.onload = (function (theFile) {
163
  return function (e) {
164
  setTimeout(function () {
395
 
396
  if ($.isFunction($.fn.timepicker)) {
397
 
 
 
398
  $input.timepicker({
399
  //timeFormat: 'HH:mm:ss',
400
  showPeriod: true,
assets/frontend/js/wooccm-checkout.min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";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;$.isFunction($.fn.datepicker)&&$input.datepicker({dateFormat:$input.data("formatdate")||"dd-mm-yy",minDate:$input.data("mindate")||null,maxDate:$input.data("maxdate")||null,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);
1
+ !function($){"use strict";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;if($field_list.find("span[data-file_id]").length+i>=wooccm_upload.limit.max_files)return alert("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1;if(file.size>wooccm_upload.limit.max_file_size)return alert("Exeeds max file size of "+wooccm_upload.limit.max_file_size),!0;var reader=new FileReader,theFile;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)}),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;$.isFunction($.fn.datepicker)&&$input.datepicker({dateFormat:$input.data("formatdate")||"dd-mm-yy",minDate:$input.data("mindate")||null,maxDate:$input.data("maxdate")||null,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);
assets/frontend/js/wooccm-order-upload.js CHANGED
@@ -73,7 +73,7 @@
73
  data = new FormData();
74
  }
75
 
76
- var i = 0, len = this.files.length, img, reader, file;
77
  for (; i < len; i++) {
78
  file = this.files[i];
79
  if (data) {
73
  data = new FormData();
74
  }
75
 
76
+ var i = 0, len = this.files.length, file;
77
  for (; i < len; i++) {
78
  file = this.files[i];
79
  if (data) {
assets/frontend/js/wooccm-order-upload.min.js CHANGED
@@ -1 +1 @@
1
- !function($){"use strict";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()};$(document).ready((function($){$(document).on("click",".wooccm_delete_attachment",(function(e){var $tr=$(this).closest("tr"),attachment_id=$(this).data("attachment_id");$tr.hide(),$("#wooccm_order_attachment_update").prop("disabled",!1),$("#delete_attachments_ids").val($("#delete_attachments_ids").val().replace(attachment_id,""))})),$(document).on("click","#wooccm_order_attachment_update",(function(e){$.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:{action:"wooccm_order_attachment_update",nonce:wooccm_upload.nonce,delete_attachments_ids:$("#delete_attachments_ids").val(),all_attachments_ids:$("#all_attachments_ids").val()},beforeSend:function(response){$(".wooccm_upload_results").html(wooccm_upload.message.saving)},success:function(response){response.success?($(".wooccm_upload_results").html(wooccm_upload.message.deleted),$("#wooccm_order_attachment_update").prop("disabled",!0)):$(".wooccm_upload_results").html(response.data)}})})),$(document).on("change","#wooccm_order_attachment_upload",(function(e){var data=!1,order_id=$(this).data("order_id");window.FormData&&(data=new FormData);for(var i=0,len=this.files.length,img,reader,file;i<len;i++)file=this.files[i],data&&data.append("wooccm_order_attachment_upload[]",file);data&&(data.append("action","wooccm_order_attachment_upload"),data.append("nonce",wooccm_upload.nonce),data.append("order_id",order_id),$.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:data,processData:!1,contentType:!1,beforeSend:function(response){$(".wooccm_upload_results").html(wooccm_upload.message.uploading),block($(".wooccm_order_attachments_wrapper"))},success:function(response){response.success?($(".wooccm_order_attachments_wrapper").fadeOut(),$(".wooccm_order_attachments_wrapper").replaceWith($(response.data).fadeIn()),$(".wooccm_upload_results").html(wooccm_upload.message.success)):$(".wooccm_upload_results").html(response.data),unblock($(".wooccm_order_attachments_wrapper"))}}))}))}))}(jQuery);
1
+ !function($){"use strict";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()};$(document).ready((function($){$(document).on("click",".wooccm_delete_attachment",(function(e){var $tr=$(this).closest("tr"),attachment_id=$(this).data("attachment_id");$tr.hide(),$("#wooccm_order_attachment_update").prop("disabled",!1),$("#delete_attachments_ids").val($("#delete_attachments_ids").val().replace(attachment_id,""))})),$(document).on("click","#wooccm_order_attachment_update",(function(e){$.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:{action:"wooccm_order_attachment_update",nonce:wooccm_upload.nonce,delete_attachments_ids:$("#delete_attachments_ids").val(),all_attachments_ids:$("#all_attachments_ids").val()},beforeSend:function(response){$(".wooccm_upload_results").html(wooccm_upload.message.saving)},success:function(response){response.success?($(".wooccm_upload_results").html(wooccm_upload.message.deleted),$("#wooccm_order_attachment_update").prop("disabled",!0)):$(".wooccm_upload_results").html(response.data)}})})),$(document).on("change","#wooccm_order_attachment_upload",(function(e){var data=!1,order_id=$(this).data("order_id");window.FormData&&(data=new FormData);for(var i=0,len=this.files.length,file;i<len;i++)file=this.files[i],data&&data.append("wooccm_order_attachment_upload[]",file);data&&(data.append("action","wooccm_order_attachment_upload"),data.append("nonce",wooccm_upload.nonce),data.append("order_id",order_id),$.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:data,processData:!1,contentType:!1,beforeSend:function(response){$(".wooccm_upload_results").html(wooccm_upload.message.uploading),block($(".wooccm_order_attachments_wrapper"))},success:function(response){response.success?($(".wooccm_order_attachments_wrapper").fadeOut(),$(".wooccm_order_attachments_wrapper").replaceWith($(response.data).fadeIn()),$(".wooccm_upload_results").html(wooccm_upload.message.success)):$(".wooccm_upload_results").html(response.data),unblock($(".wooccm_order_attachments_wrapper"))}}))}))}))}(jQuery);
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.1
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.1 =
111
  * Fix: premium compatibility
112
 
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.2
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.2 =
111
+ * Fix: file upload
112
+
113
  = 5.2.1 =
114
  * Fix: premium compatibility
115
 
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.1
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.1');
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.2
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.2');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);