WooCommerce Checkout Manager - Version 5.2.5

Version Description

  • Fix: conditional multicheckbox
  • Fix: conditional radio
Download this release

Release Info

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

Code changes from version 5.2.4 to 5.2.5

assets/frontend/js/wooccm-checkout.js CHANGED
@@ -294,15 +294,15 @@
294
  $('.wooccm-field').each(function (i, field) {
295
 
296
  $(field).find('input,textarea,select').on('change keyup', function (e) {
297
- var id = $(e.target).attr('id'),
298
  value = $(e.target).val(),
299
- $child = $('*[data-conditional-parent=' + id + ']'),
300
- condition = $child.data('conditional-parent-value')
301
-
302
- console.log('onChange', value)
303
- console.log('onChange', id)
304
- console.log('onChange', $child)
305
- console.log('onChange', condition)
306
 
307
  if (value == condition) {
308
  $child.closest('.wooccm-field').fadeIn();
294
  $('.wooccm-field').each(function (i, field) {
295
 
296
  $(field).find('input,textarea,select').on('change keyup', function (e) {
297
+ var name = $(e.target).attr('name').replace('[]', ''),
298
  value = $(e.target).val(),
299
+ $child = $('*[data-conditional-parent=' + name + ']'),
300
+ condition = $child && $child.data('conditional-parent-value')
301
+ /*
302
+ console.log('onChange value', value)
303
+ console.log('onChange id', id)
304
+ console.log('onChange child', $child)
305
+ console.log('onChange condition', condition) */
306
 
307
  if (value == condition) {
308
  $child.closest('.wooccm-field').fadeIn();
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;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-field").each((function(i,field){$(field).find("input,textarea,select").on("change keyup",(function(e){var id=$(e.target).attr("id"),value=$(e.target).val(),$child=$("*[data-conditional-parent="+id+"]"),condition=$child.data("conditional-parent-value");console.log("onChange",value),console.log("onChange",id),console.log("onChange",$child),console.log("onChange",condition),value==condition?$child.closest(".wooccm-field").fadeIn():$child.closest(".wooccm-field").fadeOut()}))})),$(".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-field").each((function(i,field){$(field).find("input,textarea,select").on("change keyup",(function(e){var name=$(e.target).attr("name").replace("[]",""),value=$(e.target).val(),$child=$("*[data-conditional-parent="+name+"]"),condition;value==($child&&$child.data("conditional-parent-value"))?$child.closest(".wooccm-field").fadeIn():$child.closest(".wooccm-field").fadeOut()}))})),$(".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);
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.4
8
  WC requires at least: 3.1.0
9
  WC tested up to: 4.4.1
10
  License: GPLv3
@@ -107,6 +107,10 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
107
 
108
  == Changelog ==
109
 
 
 
 
 
110
  = 5.2.4 =
111
  * Fix: conditional of conditional
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.5
8
  WC requires at least: 3.1.0
9
  WC tested up to: 4.4.1
10
  License: GPLv3
107
 
108
  == Changelog ==
109
 
110
+ = 5.2.5 =
111
+ * Fix: conditional multicheckbox
112
+ * Fix: conditional radio
113
+
114
  = 5.2.4 =
115
  * Fix: conditional of conditional
116
 
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.4
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.4');
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.5
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.5');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);