Version Description
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 6.3.7 |
Comparing to | |
See all releases |
Code changes from version 6.3.6 to 6.3.7
build/frontend/js/index.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('jquery', 'selectWoo'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('jquery', 'selectWoo'), 'version' => '05ee1f3a7c000d51ed22');
|
build/frontend/js/index.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(){"use strict";window.jQuery,jQuery(document).ready((function(e){e(document).on("click",".wooccm_delete_attachment",(function(t){var c=e(this).closest("tr"),o=e(this).data("attachment_id");c.hide(),e("#wooccm_order_attachment_update").prop("disabled",!1),e("#delete_attachments_ids").val(e("#delete_attachments_ids").val().replace(o,""))})),e(document).on("click","#wooccm_order_attachment_update",(function(t){e.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:{action:"wooccm_order_attachment_update",nonce:wooccm_upload.nonce,delete_attachments_ids:e("#delete_attachments_ids").val(),all_attachments_ids:e("#all_attachments_ids").val()},beforeSend:function(t){e(".wooccm_upload_results").html(wooccm_upload.message.saving)},success:function(t){t.success?(e(".wooccm_upload_results").html(wooccm_upload.message.deleted),e("#wooccm_order_attachment_update").prop("disabled",!0)):e(".wooccm_upload_results").html(t.data)}})})),e(document).on("change","#wooccm_order_attachment_upload",(function(t){var c=!1,o=e(this).data("order_id");window.FormData&&(c=new FormData);for(var a,n=0,i=this.files.length;n<i;n++)a=this.files[n],c&&c.append("wooccm_order_attachment_upload[]",a);c&&(c.append("action","wooccm_order_attachment_upload"),c.append("nonce",wooccm_upload.nonce),c.append("order_id",o),e.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:c,processData:!1,contentType:!1,beforeSend:function(t){var c;e(".wooccm_upload_results").html(wooccm_upload.message.uploading),function(e){return e.is(".processing")||e.parents(".processing").length}(c=e(".wooccm_order_attachments_wrapper"))||c.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},success:function(t){t.success?(e(".wooccm_order_attachments_wrapper").fadeOut(),e(".wooccm_order_attachments_wrapper").replaceWith(e(t.data).fadeIn()),e(".wooccm_upload_results").html(wooccm_upload.message.success)):e(".wooccm_upload_results").html(t.data),e(".wooccm_order_attachments_wrapper").removeClass("processing").unblock()}}))}))})),window.window.selectWoo,function(e){var t=function(e){return e.is(".processing")||e.parents(".processing").length};e(document).on("country_to_state_changing",(function(t,c,o){var a=o,n=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(n,(function(e,t){var c=a.find(t),o=c.find("[data-required]").data("required")||c.find(".wooccm-required-field").length;!function(e,t){t?(e.find("label .optional").remove(),e.addClass("validate-required"),0===e.find("label .required").length&&e.find("label").append('<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.show(),e.find("input[type=hidden]").prop("type","text")):(e.find("label .required").remove(),e.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===e.find("label .optional").length&&e.find("label").append('<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}(c,o)}))}));var c={};if(e(".wooccm-type-file").each((function(t,o){var a=e(o),n=a.find("[type=file]"),i=a.find(".wooccm-file-button"),r=a.find(".wooccm-file-list"),s=a.find(".wooccm-file-field").data("file-limit"),l=a.find(".wooccm-file-field").data("file-types"),d=1024*parseFloat(a.find(".wooccm-file-field").data("file-max-size"));c[a.attr("id")]=[],i.on("click",(function(e){e.preventDefault(),n.trigger("click")})),r.on("click",".wooccm-file-list-delete",(function(t){var o=e(this).closest(".wooccm-file-file"),n=e(this).closest("[data-file_id]").data("file_id");c[a.attr("id")]=e.grep(c[a.attr("id")],(function(e,t){return t!=n})),o.remove(),e("#order_review").trigger("wooccm_upload")})),n.on("change",(function(t){var o=e(this)[0].files;o.length&&window.FileReader&&e.each(o,(function(t,o){if(r.find("span[data-file_id]").length+t>=s)return alert("Exeeds max files limit of "+s),!1;var n,i=new FileReader;i.onload=(n=o,function(t){setTimeout((function(){if(n.size>d)return alert(n.name+" exeeds max file size of "+d/1024+"kb"),!0;const i=function(e,t){if(null==t||!t.length)return!0;const c=function(e){return e.name.match(/\.([^\.]+)$/)[1]}(e);return t.filter((e=>!!e.includes(c)||!(!e.includes("|")||!e.split("|").includes(c))||void 0)).length>0}(n,l);if(!i)return alert(n.name+" is not valid file type"),!0;!function(t,c,o,a,n){var i,r=e(t);n.match("image.*")?i="image":n.match("application/ms.*")?(o=wooccm_upload.icons.spreadsheet,i="spreadsheet"):n.match("application/x.*")?(o=wooccm_upload.icons.archive,i="application"):n.match("audio.*")?(o=wooccm_upload.icons.audio,i="audio"):n.match("text.*")?(o=wooccm_upload.icons.text,i="text"):n.match("video.*")?(o=wooccm_upload.icons.video,i="video"):(o=wooccm_upload.icons.interactive,i="interactive");var s='<span data-file_id="'+c+'" title="'+a+'" class="wooccm-file-file">\n <span class="wooccm-file-list-container">\n <a title="'+a+'" class="wooccm-file-list-delete">×</a>\n <span class="wooccm-file-list-image-container">\n <img class="'+i+'" alt="'+a+'" src="'+o+'"/>\n </span>\n </span>\n </span>';r.append(s).fadeIn()}(r,c[a.attr("id")].push(o)-1,t.target.result,n.name,n.type),e("#order_review").trigger("wooccm_upload")}),200)}),i.readAsDataURL(o)}))}))})),e("#order_review").on("ajaxSuccess wooccm_upload",(function(t,c,o){e(t.target);var a=e("#place_order");e(".wooccm-type-file").length?a.addClass("wooccm-upload-process"):a.removeClass("wooccm-upload-process")})),e(document).on("click","#place_order.wooccm-upload-process",(function(o){o.preventDefault();var a,n=e("form.checkout"),i=e(this);e(".wooccm-type-file").length&&window.FormData&&Object.keys(c).length&&(t(n)||(i.html(wooccm_upload.message.uploading),t(a=n)||a.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})),e.each(c,(function(t,c){var o=e("#"+t).find(".wooccm-file-field"),a=new FormData;e.each(c,(function(e,t){return e>file_limit?(console.log("Exeeds max files limit of "+file_limit),!1):t.size>file_max_size?(console.log("Exeeds max file size of "+file_limit),!0):(console.log("We're ready to upload "+t.name),void a.append("wooccm_checkout_attachment_upload[]",t))})),a.append("action","wooccm_checkout_attachment_upload"),a.append("nonce",wooccm_upload.nonce),e.ajax({async:!1,url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:a,processData:!1,contentType:!1,beforeSend:function(e){},success:function(t){t.success?o.val(t.data):e("body").trigger("update_checkout")},complete:function(e){}})})),function(e){e.removeClass("processing").unblock()}(n),i.removeClass("wooccm-upload-process").trigger("click"))})),e(document).on("change",".wooccm-add-price",(function(t){e("body").trigger("update_checkout")})),e(".wooccm-field").each((function(t,c){e(c).find("input,textarea,select").on("change keyup wooccm_change",(function(t){var c=e(t.target).attr("name").replace("[]",""),o=e(t.target).prop("type"),a=e(t.target).val();"checkbox"==o&&(a=-1!==e(t.target).attr("name").indexOf("[]")?e(t.target).closest(".wooccm-field").find("input:checked").map((function(e,t){return t.value})).toArray():e(t.target).is(":checked"));var n=e("*[data-conditional-parent="+c+"]"),i=n.closest(".wooccm-field");n.prop("disabled",!0),i.hide(),n.find("input,textarea,select").prop("disabled",!0),n.each((function(t,c){var o=e(c),n=o&&o.data("conditional-parent-value");if(a==n||e.isArray(a)&&a.indexOf(n)>-1){var i=o.closest(".wooccm-field");o.prop("disabled",!1),o.trigger("change"),i.attr("style","display: block !important"),o.find("input,textarea,select").prop("disabled",!1),o.find("input,textarea,select").trigger("change")}}))}))})),e(".wooccm-conditional-child").each((function(t,c){var o=e(c),a=e("#"+o.find("[data-conditional-parent]").data("conditional-parent")+"_field");a.find("select:first").trigger("wooccm_change"),a.find("textarea:first").trigger("wooccm_change"),a.find("input[type=button]:first").trigger("wooccm_change"),a.find("input[type=radio]:checked:first").trigger("wooccm_change"),a.find("input[type=checkbox]:checked:first").trigger("wooccm_change"),a.find("input[type=color]:first").trigger("wooccm_change"),a.find("input[type=date]:first").trigger("wooccm_change"),a.find("input[type=datetime-local]:first").trigger("wooccm_change"),a.find("input[type=email]:first").trigger("wooccm_change"),a.find("input[type=file]:first").trigger("wooccm_change"),a.find("input[type=hidden]:first").trigger("wooccm_change"),a.find("input[type=image]:first").trigger("wooccm_change"),a.find("input[type=month]:first").trigger("wooccm_change"),a.find("input[type=number]:first").trigger("wooccm_change"),a.find("input[type=password]:first").trigger("wooccm_change"),a.find("input[type=range]:first").trigger("wooccm_change"),a.find("input[type=reset]:first").trigger("wooccm_change"),a.find("input[type=search]:first").trigger("wooccm_change"),a.find("input[type=submit]:first").trigger("wooccm_change"),a.find("input[type=tel]:first").trigger("wooccm_change"),a.find("input[type=text]:first").trigger("wooccm_change"),a.find("input[type=time]:first").trigger("wooccm_change"),a.find("input[type=url]:first").trigger("wooccm_change"),a.find("input[type=week]:first").trigger("wooccm_change")})),e(".wooccm-enhanced-datepicker").each((function(t,c){var o=e(this),a=o.data("disable")||!1;e.isFunction(e.fn.datepicker)&&o.datepicker({dateFormat:o.data("formatdate")||"mm/dd/yy",minDate:o.data("mindate"),maxDate:o.data("maxdate"),beforeShowDay:function(t){var c=null!=t.getDay()&&t.getDay().toString();return a?[-1===e.inArray(c,a)]:[!0]}})})),e(".wooccm-enhanced-timepicker").each((function(t,c){var o=e(this);e.isFunction(e.fn.timepicker)&&(console.log(o.data("format-ampm")),o.timepicker({showPeriodLabels:!!o.data("format-ampm"),showPeriod:!!o.data("format-ampm"),showLeadingZero:!0,hours:o.data("hours")||void 0,minutes:o.data("minutes")||void 0}))})),e(".wooccm-colorpicker-farbtastic").each((function(t,c){var o=e(c),a=o.find("input[type=text]"),n=o.find(".wooccmcolorpicker_container");a.hide(),e.isFunction(e.fn.farbtastic)&&(n.farbtastic("#"+a.attr("id")),n.on("click",(function(e){a.fadeIn()})))})),e(".wooccm-colorpicker-iris").each((function(t,c){var o=e(c),a=o.find("input[type=text]");a.css("background",a.val()),a.on("click",(function(e){o.toggleClass("active")})),a.iris({class:a.attr("id"),palettes:!0,color:"",hide:!1,change:function(e,t){a.css("background",t.color.toString()).fadeIn()}})})),e(document).on("click",(function(t){0===e(t.target).closest(".iris-picker").length&&e(".wooccm-colorpicker-iris").removeClass("active")})),"undefined"==typeof wc_country_select_params)return!1;e().selectWoo&&e("select.wooccm-enhanced-select").each((function(){var t=e.extend({width:"100%",placeholder:e(this).data("placeholder")||"",allowClear:e(this).data("allowclear")||!1,selectOnClose:e(this).data("selectonclose")||!1,closeOnSelect:e(this).data("closeonselect")||!1,minimumResultsForSearch:e(this).data("search")||-1},{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(e){var t=e.input.length-e.maximum;return 1===t?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",t)},inputTooShort:function(e){var t=e.minimum-e.input.length;return 1===t?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",t)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(e){return 1===e.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",e.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}});e(this).on("select2:select",(function(){e(this).focus()})).selectWoo(t)}))}(jQuery)}();
|
1 |
+
!function(){"use strict";window.jQuery,jQuery(document).ready((function(e){e(document).on("click",".wooccm_delete_attachment",(function(t){var c=e(this).closest("tr"),o=e(this).data("attachment_id");c.hide(),e("#wooccm_order_attachment_update").prop("disabled",!1),e("#delete_attachments_ids").val(e("#delete_attachments_ids").val().replace(o,""))})),e(document).on("click","#wooccm_order_attachment_update",(function(t){e.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:{action:"wooccm_order_attachment_update",nonce:wooccm_upload.nonce,delete_attachments_ids:e("#delete_attachments_ids").val(),all_attachments_ids:e("#all_attachments_ids").val()},beforeSend:function(t){e(".wooccm_upload_results").html(wooccm_upload.message.saving)},success:function(t){t.success?(e(".wooccm_upload_results").html(wooccm_upload.message.deleted),e("#wooccm_order_attachment_update").prop("disabled",!0)):e(".wooccm_upload_results").html(t.data)}})})),e(document).on("change","#wooccm_order_attachment_upload",(function(t){var c=!1,o=e(this).data("order_id");window.FormData&&(c=new FormData);for(var a,n=0,i=this.files.length;n<i;n++)a=this.files[n],c&&c.append("wooccm_order_attachment_upload[]",a);c&&(c.append("action","wooccm_order_attachment_upload"),c.append("nonce",wooccm_upload.nonce),c.append("order_id",o),e.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:c,processData:!1,contentType:!1,beforeSend:function(t){var c;e(".wooccm_upload_results").html(wooccm_upload.message.uploading),function(e){return e.is(".processing")||e.parents(".processing").length}(c=e(".wooccm_order_attachments_wrapper"))||c.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},success:function(t){t.success?(e(".wooccm_order_attachments_wrapper").fadeOut(),e(".wooccm_order_attachments_wrapper").replaceWith(e(t.data).fadeIn()),e(".wooccm_upload_results").html(wooccm_upload.message.success)):e(".wooccm_upload_results").html(t.data),e(".wooccm_order_attachments_wrapper").removeClass("processing").unblock()}}))}))})),window.window.selectWoo,function(e){var t=function(e){return e.is(".processing")||e.parents(".processing").length};e(document).on("country_to_state_changing",(function(t,c,o){var a=o,n=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(n,(function(e,t){var c=a.find(t),o=c.find("[data-required]").data("required")||c.find(".wooccm-required-field").length;!function(e,t){t?(e.find("label .optional").remove(),e.addClass("validate-required"),0===e.find("label .required").length&&e.find("label").append('<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.show(),e.find("input[type=hidden]").prop("type","text")):(e.find("label .required").remove(),e.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===e.find("label .optional").length&&e.find("label").append('<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}(c,o)}))}));var c={};if(e(".wooccm-type-file").each((function(t,o){var a=e(o),n=a.find("[type=file]"),i=a.find(".wooccm-file-button"),r=a.find(".wooccm-file-list"),s=a.find(".wooccm-file-field").data("file-limit"),d=a.find(".wooccm-file-field").data("file-types"),l=1024*parseFloat(a.find(".wooccm-file-field").data("file-max-size"));c[a.attr("id")]=[],i.on("click",(function(e){e.preventDefault(),n.trigger("click")})),r.on("click",".wooccm-file-list-delete",(function(t){var o=e(this).closest(".wooccm-file-file"),n=e(this).closest("[data-file_id]").data("file_id");c[a.attr("id")]=e.grep(c[a.attr("id")],(function(e,t){return t!=n})),o.remove(),e("#order_review").trigger("wooccm_upload")})),n.on("change",(function(t){var o=e(this)[0].files;o.length&&window.FileReader&&e.each(o,(function(t,o){if(r.find("span[data-file_id]").length+t>=s)return alert("Exeeds max files limit of "+s),!1;var n,i=new FileReader;i.onload=(n=o,function(t){setTimeout((function(){if(n.size>l)return alert(n.name+" exeeds max file size of "+l/1024+"kb"),!0;const i=function(e,t){if(null==t||!t.length)return!0;const c=function(e){return e.name.match(/\.([^\.]+)$/)[1]}(e);return t.filter((e=>!!e.includes(c)||!(!e.includes("|")||!e.split("|").includes(c))||void 0)).length>0}(n,d);if(!i)return alert(n.name+" is not valid file type"),!0;!function(t,c,o,a,n){var i,r=e(t);n.match("image.*")?i="image":n.match("application/ms.*")?(o=wooccm_upload.icons.spreadsheet,i="spreadsheet"):n.match("application/x.*")?(o=wooccm_upload.icons.archive,i="application"):n.match("audio.*")?(o=wooccm_upload.icons.audio,i="audio"):n.match("text.*")?(o=wooccm_upload.icons.text,i="text"):n.match("video.*")?(o=wooccm_upload.icons.video,i="video"):(o=wooccm_upload.icons.interactive,i="interactive");var s='<span data-file_id="'+c+'" title="'+a+'" class="wooccm-file-file">\n <span class="wooccm-file-list-container">\n <a title="'+a+'" class="wooccm-file-list-delete">×</a>\n <span class="wooccm-file-list-image-container">\n <img class="'+i+'" alt="'+a+'" src="'+o+'"/>\n </span>\n </span>\n </span>';r.append(s).fadeIn()}(r,c[a.attr("id")].push(o)-1,t.target.result,n.name,n.type),e("#order_review").trigger("wooccm_upload")}),200)}),i.readAsDataURL(o)}))}))})),e("#order_review").on("ajaxSuccess wooccm_upload",(function(t,c,o){e(t.target);var a=e("#place_order");e(".wooccm-type-file").length?a.addClass("wooccm-upload-process"):a.removeClass("wooccm-upload-process")})),e(document).on("click","#place_order.wooccm-upload-process",(function(o){o.preventDefault();var a,n=e("form.checkout"),i=e(this);e(".wooccm-type-file").length&&window.FormData&&Object.keys(c).length&&(t(n)||(i.html(wooccm_upload.message.uploading),t(a=n)||a.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})),e.each(c,(function(t,c){var o=e("#"+t),a=o.find(".wooccm-file-field").data("file-limit"),n=(o.find(".wooccm-file-field").data("file-types"),1024*parseFloat(o.find(".wooccm-file-field").data("file-max-size"))),i=o.find(".wooccm-file-field"),r=new FormData;e.each(c,(function(e,t){return e>a?(console.log("Exeeds max files limit of "+a),!1):t.size>n?(console.log("Exeeds max file size of "+a),!0):(console.log("We're ready to upload "+t.name),void r.append("wooccm_checkout_attachment_upload[]",t))})),r.append("action","wooccm_checkout_attachment_upload"),r.append("nonce",wooccm_upload.nonce),e.ajax({async:!1,url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:r,processData:!1,contentType:!1,beforeSend:function(e){},success:function(t){t.success?i.val(t.data):e("body").trigger("update_checkout")},complete:function(e){}})})),function(e){e.removeClass("processing").unblock()}(n),i.removeClass("wooccm-upload-process").trigger("click"))})),e(document).on("change",".wooccm-add-price",(function(t){e("body").trigger("update_checkout")})),e(".wooccm-field").each((function(t,c){e(c).find("input,textarea,select").on("change keyup wooccm_change",(function(t){var c=e(t.target).attr("name").replace("[]",""),o=e(t.target).prop("type"),a=e(t.target).val();"checkbox"==o&&(a=-1!==e(t.target).attr("name").indexOf("[]")?e(t.target).closest(".wooccm-field").find("input:checked").map((function(e,t){return t.value})).toArray():e(t.target).is(":checked"));var n=e("*[data-conditional-parent="+c+"]"),i=n.closest(".wooccm-field");n.prop("disabled",!0),i.hide(),n.find("input,textarea,select").prop("disabled",!0),n.each((function(t,c){var o=e(c),n=o&&o.data("conditional-parent-value");if(a==n||e.isArray(a)&&a.indexOf(n)>-1){var i=o.closest(".wooccm-field");o.prop("disabled",!1),o.trigger("change"),i.attr("style","display: block !important"),o.find("input,textarea,select").prop("disabled",!1),o.find("input,textarea,select").trigger("change")}}))}))})),e(".wooccm-conditional-child").each((function(t,c){var o=e(c),a=e("#"+o.find("[data-conditional-parent]").data("conditional-parent")+"_field");a.find("select:first").trigger("wooccm_change"),a.find("textarea:first").trigger("wooccm_change"),a.find("input[type=button]:first").trigger("wooccm_change"),a.find("input[type=radio]:checked:first").trigger("wooccm_change"),a.find("input[type=checkbox]:checked:first").trigger("wooccm_change"),a.find("input[type=color]:first").trigger("wooccm_change"),a.find("input[type=date]:first").trigger("wooccm_change"),a.find("input[type=datetime-local]:first").trigger("wooccm_change"),a.find("input[type=email]:first").trigger("wooccm_change"),a.find("input[type=file]:first").trigger("wooccm_change"),a.find("input[type=hidden]:first").trigger("wooccm_change"),a.find("input[type=image]:first").trigger("wooccm_change"),a.find("input[type=month]:first").trigger("wooccm_change"),a.find("input[type=number]:first").trigger("wooccm_change"),a.find("input[type=password]:first").trigger("wooccm_change"),a.find("input[type=range]:first").trigger("wooccm_change"),a.find("input[type=reset]:first").trigger("wooccm_change"),a.find("input[type=search]:first").trigger("wooccm_change"),a.find("input[type=submit]:first").trigger("wooccm_change"),a.find("input[type=tel]:first").trigger("wooccm_change"),a.find("input[type=text]:first").trigger("wooccm_change"),a.find("input[type=time]:first").trigger("wooccm_change"),a.find("input[type=url]:first").trigger("wooccm_change"),a.find("input[type=week]:first").trigger("wooccm_change")})),e(".wooccm-enhanced-datepicker").each((function(t,c){var o=e(this),a=o.data("disable")||!1;e.isFunction(e.fn.datepicker)&&o.datepicker({dateFormat:o.data("formatdate")||"mm/dd/yy",minDate:o.data("mindate"),maxDate:o.data("maxdate"),beforeShowDay:function(t){var c=null!=t.getDay()&&t.getDay().toString();return a?[-1===e.inArray(c,a)]:[!0]}})})),e(".wooccm-enhanced-timepicker").each((function(t,c){var o=e(this);e.isFunction(e.fn.timepicker)&&(console.log(o.data("format-ampm")),o.timepicker({showPeriodLabels:!!o.data("format-ampm"),showPeriod:!!o.data("format-ampm"),showLeadingZero:!0,hours:o.data("hours")||void 0,minutes:o.data("minutes")||void 0}))})),e(".wooccm-colorpicker-farbtastic").each((function(t,c){var o=e(c),a=o.find("input[type=text]"),n=o.find(".wooccmcolorpicker_container");a.hide(),e.isFunction(e.fn.farbtastic)&&(n.farbtastic("#"+a.attr("id")),n.on("click",(function(e){a.fadeIn()})))})),e(".wooccm-colorpicker-iris").each((function(t,c){var o=e(c),a=o.find("input[type=text]");a.css("background",a.val()),a.on("click",(function(e){o.toggleClass("active")})),a.iris({class:a.attr("id"),palettes:!0,color:"",hide:!1,change:function(e,t){a.css("background",t.color.toString()).fadeIn()}})})),e(document).on("click",(function(t){0===e(t.target).closest(".iris-picker").length&&e(".wooccm-colorpicker-iris").removeClass("active")})),"undefined"==typeof wc_country_select_params)return!1;e().selectWoo&&e("select.wooccm-enhanced-select").each((function(){var t=e.extend({width:"100%",placeholder:e(this).data("placeholder")||"",allowClear:e(this).data("allowclear")||!1,selectOnClose:e(this).data("selectonclose")||!1,closeOnSelect:e(this).data("closeonselect")||!1,minimumResultsForSearch:e(this).data("search")||-1},{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(e){var t=e.input.length-e.maximum;return 1===t?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",t)},inputTooShort:function(e){var t=e.minimum-e.input.length;return 1===t?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",t)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(e){return 1===e.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",e.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}});e(this).on("select2:select",(function(){e(this).focus()})).selectWoo(t)}))}(jQuery)}();
|
includes/class-wooccm-helpers.php
CHANGED
@@ -17,4 +17,87 @@ class WOOCCM_Field_Helpers {
|
|
17 |
}
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
17 |
}
|
18 |
}
|
19 |
|
20 |
+
public static function get_file_extension_icon( string $file_extension = null ) {
|
21 |
+
|
22 |
+
$icons = array(
|
23 |
+
'default' => site_url( 'wp-includes/images/media/default.png' ),
|
24 |
+
'interactive' => site_url( 'wp-includes/images/media/interactive.png' ),
|
25 |
+
'spreadsheet' => site_url( 'wp-includes/images/media/spreadsheet.png' ),
|
26 |
+
'archive' => site_url( 'wp-includes/images/media/archive.png' ),
|
27 |
+
'audio' => site_url( 'wp-includes/images/media/audio.png' ),
|
28 |
+
'text' => site_url( 'wp-includes/images/media/text.png' ),
|
29 |
+
'video' => site_url( 'wp-includes/images/media/video.png' ),
|
30 |
+
);
|
31 |
+
|
32 |
+
if ( ! $file_extension ) {
|
33 |
+
return $icons;
|
34 |
+
}
|
35 |
+
|
36 |
+
// if (filetype.match('image.*')) {
|
37 |
+
// source_class = 'image';
|
38 |
+
// } else if (filetype.match('application/ms.*')) {
|
39 |
+
// source = wooccm_upload.icons.spreadsheet;
|
40 |
+
// source_class = 'spreadsheet';
|
41 |
+
// } else if (filetype.match('application/x.*')) {
|
42 |
+
// source = wooccm_upload.icons.archive;
|
43 |
+
// source_class = 'application';
|
44 |
+
// } else if (filetype.match('audio.*')) {
|
45 |
+
// source = wooccm_upload.icons.audio;
|
46 |
+
// source_class = 'audio';
|
47 |
+
// } else if (filetype.match('text.*')) {
|
48 |
+
// source = wooccm_upload.icons.text;
|
49 |
+
// source_class = 'text';
|
50 |
+
// } else if (filetype.match('video.*')) {
|
51 |
+
// source = wooccm_upload.icons.video;
|
52 |
+
// source_class = 'video';
|
53 |
+
// } else {
|
54 |
+
// if ((false === filetype.match('application/ms.*') && false === filetype.match('application/x.*') && false === filetype.match('audio.*') && false === filetype.match('text.*') && false === filetype.match('video.*')) || (0 === filetype.length || !filetype)) {
|
55 |
+
// source = wooccm_upload.icons.interactive;
|
56 |
+
// source_class = 'interactive';
|
57 |
+
// }
|
58 |
+
}
|
59 |
+
|
60 |
+
public static function get_attachment_icon( $attachment_id ) {
|
61 |
+
|
62 |
+
$attachment = get_post( $attachment_id );
|
63 |
+
|
64 |
+
if ( ! $attachment ) {
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
$mime_type = get_post_mime_type( $attachment_id );
|
69 |
+
|
70 |
+
if ( ! $mime_type ) {
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
$mime_type = explode( '/', $mime_type );
|
75 |
+
|
76 |
+
if ( ! isset( $mime_type[0] ) || ! isset( $mime_type[1] ) ) {
|
77 |
+
return false;
|
78 |
+
}
|
79 |
+
|
80 |
+
$mime_type = $mime_type[0];
|
81 |
+
|
82 |
+
$icons = self::get_file_extension_icon();
|
83 |
+
|
84 |
+
if ( ! isset( $icons[ $mime_type ] ) ) {
|
85 |
+
return $icons['default'];
|
86 |
+
}
|
87 |
+
|
88 |
+
return $icons[ $mime_type ];
|
89 |
+
}
|
90 |
+
|
91 |
+
public static function get_attachment_thumbail_src( $attachment_id ) {
|
92 |
+
|
93 |
+
$src = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
|
94 |
+
|
95 |
+
if ( isset( $src[0] ) ) {
|
96 |
+
return $src[0];
|
97 |
+
}
|
98 |
+
|
99 |
+
return self::get_attachment_icon( $attachment_id );
|
100 |
+
|
101 |
+
}
|
102 |
+
|
103 |
}
|
includes/class-wooccm-upload.php
CHANGED
@@ -1,35 +1,32 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class WOOCCM_Upload
|
4 |
-
|
5 |
|
6 |
|
7 |
protected static $_instance;
|
8 |
|
9 |
-
public function __construct()
|
10 |
-
|
11 |
-
add_action('
|
12 |
-
add_action('wp_ajax_nopriv_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
|
13 |
|
14 |
// Checkout
|
15 |
// -----------------------------------------------------------------------
|
16 |
-
add_action('wp_ajax_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
|
17 |
-
add_action('wp_ajax_nopriv_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
|
18 |
-
add_action('woocommerce_checkout_update_order_meta', array($this, 'update_attachment_ids'), 99);
|
19 |
// }
|
20 |
}
|
21 |
|
22 |
-
public static function instance()
|
23 |
-
|
24 |
-
if (is_null(self::$_instance)) {
|
25 |
self::$_instance = new self();
|
26 |
}
|
27 |
return self::$_instance;
|
28 |
}
|
29 |
|
30 |
-
protected function process_uploads($files, $key, $post_id = 0)
|
31 |
-
|
32 |
-
if (!function_exists('media_handle_upload')) {
|
33 |
require_once ABSPATH . 'wp-admin/includes/file.php';
|
34 |
require_once ABSPATH . 'wp-admin/includes/media.php';
|
35 |
require_once ABSPATH . 'wp-admin/includes/image.php';
|
@@ -39,30 +36,30 @@ class WOOCCM_Upload
|
|
39 |
|
40 |
add_filter(
|
41 |
'upload_dir',
|
42 |
-
function ($param) {
|
43 |
-
$param['path'] = sprintf('%s/wooccm_uploads', $param['basedir']);
|
44 |
-
$param['url'] = sprintf('%s/wooccm_uploads', $param['baseurl']);
|
45 |
return $param;
|
46 |
},
|
47 |
10
|
48 |
);
|
49 |
|
50 |
-
foreach ($files['name'] as $id => $value) {
|
51 |
|
52 |
-
if ($files['name'][$id]) {
|
53 |
|
54 |
-
$_FILES[$key] = array(
|
55 |
-
'name' => $files['name'][$id],
|
56 |
-
'type' => $files['type'][$id],
|
57 |
-
'tmp_name' => $files['tmp_name'][$id],
|
58 |
-
'error' => $files['error'][$id],
|
59 |
-
'size' => $files['size'][$id],
|
60 |
);
|
61 |
|
62 |
-
if (!is_wp_error($attachment_id = media_handle_upload($key, $post_id))) {
|
63 |
$attachment_ids[] = $attachment_id;
|
64 |
} else {
|
65 |
-
wc_add_notice($attachment_id->get_error_message(), 'error');
|
66 |
// wp_send_json_error( $attachment_id->get_error_message() );
|
67 |
}
|
68 |
}
|
@@ -71,82 +68,82 @@ class WOOCCM_Upload
|
|
71 |
return $attachment_ids;
|
72 |
}
|
73 |
|
74 |
-
public function ajax_delete_attachment()
|
75 |
-
|
76 |
-
if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
|
77 |
|
78 |
-
$array1 = explode(',', sanitize_text_field(isset($_REQUEST['all_attachments_ids']) ? $_REQUEST['all_attachments_ids'] : ''));
|
79 |
-
$array2 = explode(',', sanitize_text_field(isset($_REQUEST['delete_attachments_ids']) ? $_REQUEST['delete_attachments_ids'] : ''));
|
80 |
|
81 |
-
if (empty($array1) || empty($array2)) {
|
82 |
-
wp_send_json_error(esc_html__('No attachment selected.', 'woocommerce-checkout-manager'));
|
83 |
}
|
84 |
|
85 |
-
$attachment_ids = array_diff($array1, $array2);
|
86 |
|
87 |
-
if (!empty($attachment_ids)) {
|
88 |
|
89 |
-
foreach ($attachment_ids as $key => $attachtoremove) {
|
90 |
|
91 |
// Check the Attachment exists...
|
92 |
-
if (get_post_status($attachtoremove) == false) {
|
93 |
continue;
|
94 |
}
|
95 |
|
96 |
// Check the Attachment is associated with an Order
|
97 |
-
$post_parent = get_post_field('post_parent', $attachtoremove);
|
98 |
|
99 |
-
if (empty($post_parent)) {
|
100 |
continue;
|
101 |
} else {
|
102 |
-
if (get_post_type($post_parent) <> 'shop_order') {
|
103 |
continue;
|
104 |
}
|
105 |
}
|
106 |
-
wp_delete_attachment($attachtoremove);
|
107 |
}
|
108 |
}
|
109 |
|
110 |
-
wp_send_json_success('Deleted successfully.', 'woocommerce-checkout-manager');
|
111 |
}
|
112 |
}
|
113 |
|
114 |
-
public function ajax_checkout_attachment_upload()
|
115 |
-
|
116 |
-
if (check_admin_referer('wooccm_upload', 'nonce') && isset($_FILES['wooccm_checkout_attachment_upload'])) {
|
117 |
|
118 |
$files = $_FILES['wooccm_checkout_attachment_upload'];
|
119 |
|
120 |
-
if (empty($files)) {
|
121 |
-
wc_add_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
|
122 |
wp_send_json_error();
|
123 |
}
|
124 |
|
125 |
-
if (count($attachment_ids = $this->process_uploads($files, 'wooccm_checkout_attachment_upload'))) {
|
126 |
-
wp_send_json_success($attachment_ids);
|
127 |
}
|
128 |
-
wc_add_notice(esc_html__('Unknow error.', 'woocommerce-checkout-manager'), 'error');
|
129 |
wp_send_json_error();
|
130 |
}
|
131 |
}
|
132 |
|
133 |
-
public function update_attachment_ids($order_id = 0)
|
134 |
-
|
|
|
|
|
135 |
require_once ABSPATH . 'wp-admin/includes/image.php';
|
136 |
|
137 |
-
if (count($checkout = WC()->checkout->get_checkout_fields())) {
|
138 |
|
139 |
-
foreach ($checkout as $field_type => $fields) {
|
140 |
|
141 |
-
foreach ($fields as $key => $field) {
|
142 |
|
143 |
-
if (isset($field['type']) && $field['type'] == 'file') {
|
144 |
|
145 |
-
if ($attachments = get_post_meta($order_id, sprintf('_%s', $key), true)) {
|
146 |
|
147 |
-
if ($attachments = (array) explode(',', $attachments)) {
|
148 |
|
149 |
-
foreach ($attachments as $image_id) {
|
150 |
|
151 |
wp_update_post(
|
152 |
array(
|
@@ -155,7 +152,7 @@ class WOOCCM_Upload
|
|
155 |
)
|
156 |
);
|
157 |
|
158 |
-
wp_update_attachment_metadata($image_id, wp_generate_attachment_metadata($image_id, get_attached_file($image_id)));
|
159 |
}
|
160 |
}
|
161 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class WOOCCM_Upload {
|
4 |
+
|
5 |
|
6 |
|
7 |
protected static $_instance;
|
8 |
|
9 |
+
public function __construct() {
|
10 |
+
add_action( 'wp_ajax_wooccm_order_attachment_update', array( $this, 'ajax_delete_attachment' ) );
|
11 |
+
add_action( 'wp_ajax_nopriv_wooccm_order_attachment_update', array( $this, 'ajax_delete_attachment' ) );
|
|
|
12 |
|
13 |
// Checkout
|
14 |
// -----------------------------------------------------------------------
|
15 |
+
add_action( 'wp_ajax_wooccm_checkout_attachment_upload', array( $this, 'ajax_checkout_attachment_upload' ) );
|
16 |
+
add_action( 'wp_ajax_nopriv_wooccm_checkout_attachment_upload', array( $this, 'ajax_checkout_attachment_upload' ) );
|
17 |
+
add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'update_attachment_ids' ), 99 );
|
18 |
// }
|
19 |
}
|
20 |
|
21 |
+
public static function instance() {
|
22 |
+
if ( is_null( self::$_instance ) ) {
|
|
|
23 |
self::$_instance = new self();
|
24 |
}
|
25 |
return self::$_instance;
|
26 |
}
|
27 |
|
28 |
+
protected function process_uploads( $files, $key, $post_id = 0 ) {
|
29 |
+
if ( ! function_exists( 'media_handle_upload' ) ) {
|
|
|
30 |
require_once ABSPATH . 'wp-admin/includes/file.php';
|
31 |
require_once ABSPATH . 'wp-admin/includes/media.php';
|
32 |
require_once ABSPATH . 'wp-admin/includes/image.php';
|
36 |
|
37 |
add_filter(
|
38 |
'upload_dir',
|
39 |
+
function ( $param ) {
|
40 |
+
$param['path'] = sprintf( '%s/wooccm_uploads', $param['basedir'] );
|
41 |
+
$param['url'] = sprintf( '%s/wooccm_uploads', $param['baseurl'] );
|
42 |
return $param;
|
43 |
},
|
44 |
10
|
45 |
);
|
46 |
|
47 |
+
foreach ( $files['name'] as $id => $value ) {
|
48 |
|
49 |
+
if ( $files['name'][ $id ] ) {
|
50 |
|
51 |
+
$_FILES[ $key ] = array(
|
52 |
+
'name' => $files['name'][ $id ],
|
53 |
+
'type' => $files['type'][ $id ],
|
54 |
+
'tmp_name' => $files['tmp_name'][ $id ],
|
55 |
+
'error' => $files['error'][ $id ],
|
56 |
+
'size' => $files['size'][ $id ],
|
57 |
);
|
58 |
|
59 |
+
if ( ! is_wp_error( $attachment_id = media_handle_upload( $key, $post_id ) ) ) {
|
60 |
$attachment_ids[] = $attachment_id;
|
61 |
} else {
|
62 |
+
wc_add_notice( $attachment_id->get_error_message(), 'error' );
|
63 |
// wp_send_json_error( $attachment_id->get_error_message() );
|
64 |
}
|
65 |
}
|
68 |
return $attachment_ids;
|
69 |
}
|
70 |
|
71 |
+
public function ajax_delete_attachment() {
|
72 |
+
if ( ! empty( $_REQUEST ) && check_admin_referer( 'wooccm_upload', 'nonce' ) ) {
|
|
|
73 |
|
74 |
+
$array1 = explode( ',', sanitize_text_field( isset( $_REQUEST['all_attachments_ids'] ) ? $_REQUEST['all_attachments_ids'] : '' ) );
|
75 |
+
$array2 = explode( ',', sanitize_text_field( isset( $_REQUEST['delete_attachments_ids'] ) ? $_REQUEST['delete_attachments_ids'] : '' ) );
|
76 |
|
77 |
+
if ( empty( $array1 ) || empty( $array2 ) ) {
|
78 |
+
wp_send_json_error( esc_html__( 'No attachment selected.', 'woocommerce-checkout-manager' ) );
|
79 |
}
|
80 |
|
81 |
+
$attachment_ids = array_diff( $array1, $array2 );
|
82 |
|
83 |
+
if ( ! empty( $attachment_ids ) ) {
|
84 |
|
85 |
+
foreach ( $attachment_ids as $key => $attachtoremove ) {
|
86 |
|
87 |
// Check the Attachment exists...
|
88 |
+
if ( get_post_status( $attachtoremove ) == false ) {
|
89 |
continue;
|
90 |
}
|
91 |
|
92 |
// Check the Attachment is associated with an Order
|
93 |
+
$post_parent = get_post_field( 'post_parent', $attachtoremove );
|
94 |
|
95 |
+
if ( empty( $post_parent ) ) {
|
96 |
continue;
|
97 |
} else {
|
98 |
+
if ( get_post_type( $post_parent ) <> 'shop_order' ) {
|
99 |
continue;
|
100 |
}
|
101 |
}
|
102 |
+
wp_delete_attachment( $attachtoremove );
|
103 |
}
|
104 |
}
|
105 |
|
106 |
+
wp_send_json_success( 'Deleted successfully.', 'woocommerce-checkout-manager' );
|
107 |
}
|
108 |
}
|
109 |
|
110 |
+
public function ajax_checkout_attachment_upload() {
|
111 |
+
if ( check_admin_referer( 'wooccm_upload', 'nonce' ) && isset( $_FILES['wooccm_checkout_attachment_upload'] ) ) {
|
|
|
112 |
|
113 |
$files = $_FILES['wooccm_checkout_attachment_upload'];
|
114 |
|
115 |
+
if ( empty( $files ) ) {
|
116 |
+
wc_add_notice( esc_html__( 'No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager' ), 'error' );
|
117 |
wp_send_json_error();
|
118 |
}
|
119 |
|
120 |
+
if ( count( $attachment_ids = $this->process_uploads( $files, 'wooccm_checkout_attachment_upload' ) ) ) {
|
121 |
+
wp_send_json_success( $attachment_ids );
|
122 |
}
|
123 |
+
wc_add_notice( esc_html__( 'Unknow error.', 'woocommerce-checkout-manager' ), 'error' );
|
124 |
wp_send_json_error();
|
125 |
}
|
126 |
}
|
127 |
|
128 |
+
public function update_attachment_ids( $order_id = 0 ) {
|
129 |
+
|
130 |
+
require_once ABSPATH . 'wp-admin/includes/file.php';
|
131 |
+
require_once ABSPATH . 'wp-admin/includes/media.php';
|
132 |
require_once ABSPATH . 'wp-admin/includes/image.php';
|
133 |
|
134 |
+
if ( count( $checkout = WC()->checkout->get_checkout_fields() ) ) {
|
135 |
|
136 |
+
foreach ( $checkout as $field_type => $fields ) {
|
137 |
|
138 |
+
foreach ( $fields as $key => $field ) {
|
139 |
|
140 |
+
if ( isset( $field['type'] ) && $field['type'] == 'file' ) {
|
141 |
|
142 |
+
if ( $attachments = get_post_meta( $order_id, sprintf( '_%s', $key ), true ) ) {
|
143 |
|
144 |
+
if ( $attachments = (array) explode( ',', $attachments ) ) {
|
145 |
|
146 |
+
foreach ( $attachments as $image_id ) {
|
147 |
|
148 |
wp_update_post(
|
149 |
array(
|
152 |
)
|
153 |
);
|
154 |
|
155 |
+
wp_update_attachment_metadata( $image_id, wp_generate_attachment_metadata( $image_id, get_attached_file( $image_id ) ) );
|
156 |
}
|
157 |
}
|
158 |
}
|
includes/view/backend/meta-boxes/html-order-uploads.php
CHANGED
@@ -1,61 +1,61 @@
|
|
1 |
<div class="wooccm_order_attachments_wrapper" class="wc-metaboxes-wrapper">
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
</div>
|
1 |
<div class="wooccm_order_attachments_wrapper" class="wc-metaboxes-wrapper">
|
2 |
+
<table cellpadding="0" cellspacing="0" class="wooccm_order_attachments">
|
3 |
+
<thead>
|
4 |
+
<tr>
|
5 |
+
<th><?php esc_html_e( 'Image', 'woocommerce-checkout-manager' ); ?></th>
|
6 |
+
<th><?php esc_html_e( 'Filename', 'woocommerce-checkout-manager' ); ?></th>
|
7 |
+
<th><?php esc_html_e( 'Dimensions', 'woocommerce-checkout-manager' ); ?></th>
|
8 |
+
<th><?php esc_html_e( 'Extension', 'woocommerce-checkout-manager' ); ?></th>
|
9 |
+
<th class="column-actions"></th>
|
10 |
+
</tr>
|
11 |
+
</thead>
|
12 |
+
<tbody class="product_images">
|
13 |
+
<?php
|
14 |
+
if ( ! empty( $attachments ) ) :
|
15 |
+
foreach ( $attachments as $attachment_id ) :
|
16 |
+
$image_attributes = wp_get_attachment_url( $attachment_id );
|
17 |
+
$image_attributes2 = wp_get_attachment_image_src( $attachment_id );
|
18 |
+
$filename = basename( $image_attributes );
|
19 |
+
$wp_filetype = wp_check_filetype( $filename );
|
20 |
+
?>
|
21 |
+
<tr class="image">
|
22 |
+
<td class="thumb">
|
23 |
+
<div class="wc-order-item-thumbnail">
|
24 |
+
<img width="38" height="38" src="<?php echo WOOCCM_Field_Helpers::get_attachment_thumbail_src( $attachment_id ); ?>" class="attachment-38x38 size-38x38" decoding="async" loading="lazy" srcset="" sizes="(max-width: 38px) 100vw, 38px">
|
25 |
+
</div>
|
26 |
+
</td>
|
27 |
+
<td><?php echo wp_get_attachment_link( $attachment_id, '', false, false, preg_replace( '/\.[^.]+$/', '', $filename ) ); ?></td>
|
28 |
+
<td>
|
29 |
+
<?php
|
30 |
+
if ( $image_attributes2[1] == '' ) {
|
31 |
+
echo '-';
|
32 |
+
} else {
|
33 |
+
echo esc_html( $image_attributes2[1] ) . ' x ' . esc_html( $image_attributes2[2] );
|
34 |
+
}
|
35 |
+
?>
|
36 |
+
</td>
|
37 |
+
<td><?php echo esc_html( strtoupper( $wp_filetype['ext'] ) ); ?></td>
|
38 |
+
<td class="column-actions" nowrap>
|
39 |
+
<!--<a href="<?php echo esc_url( $image_attributes2[0] ); ?>" target="_blank" class="button"><?php esc_html_e( 'Download', 'woocommerce-checkout-manager' ); ?></a>-->
|
40 |
+
<a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr( $attachment_id ); ?>" data-tip="<?php esc_html_e( 'Delete', 'woocommerce-checkout-manager' ); ?>"><?php esc_html_e( 'Delete', 'woocommerce-checkout-manager' ); ?></a>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<?php endforeach; ?>
|
44 |
+
<?php else : ?>
|
45 |
+
<tr>
|
46 |
+
<td colspan="6" style="text-align:left;"><?php esc_html_e( 'No files have been uploaded to this order.', 'woocommerce-checkout-manager' ); ?></td>
|
47 |
+
</tr>
|
48 |
+
<?php endif; ?>
|
49 |
+
</tbody>
|
50 |
+
</table>
|
51 |
+
<div class="wc-order-data-row wc-order-bulk-actions wc-order-data-row-toggle">
|
52 |
+
<input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr( implode( ',', $attachments ) ); ?>" />
|
53 |
+
<input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr( implode( ',', $attachments ) ); ?>" />
|
54 |
+
<a class="button button-primary fileinput-button">
|
55 |
+
<span><?php esc_html_e( 'Upload Files', 'woocommerce-checkout-manager' ); ?></span>
|
56 |
+
<input data-order_id="<?php echo esc_attr( $order->get_id() ); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
|
57 |
+
</a>
|
58 |
+
<input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php esc_html_e( 'Save Changes', 'woocommerce-checkout-manager' ); ?>" disabled="disabled">
|
59 |
+
<div class="wooccm_upload_results"></div>
|
60 |
+
</div>
|
61 |
+
</div>
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: checkout field editor, woocommerce checkout field editor, checkout manager
|
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 6.1
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 6.3.
|
9 |
WC requires at least: 3.1.0
|
10 |
WC tested up to: 7.1
|
11 |
License: GPLv3
|
@@ -149,6 +149,11 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
|
|
149 |
|
150 |
== Changelog ==
|
151 |
|
|
|
|
|
|
|
|
|
|
|
152 |
= 6.3.6
|
153 |
* Fix. Premium Compatibility
|
154 |
|
5 |
Requires at least: 4.9
|
6 |
Tested up to: 6.1
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 6.3.7
|
9 |
WC requires at least: 3.1.0
|
10 |
WC tested up to: 7.1
|
11 |
License: GPLv3
|
149 |
|
150 |
== Changelog ==
|
151 |
|
152 |
+
= 6.3.7
|
153 |
+
* Fix. WooCommerce order video upload
|
154 |
+
* Fix. WooCommerce order upload
|
155 |
+
* New. WooCommerce order uploaded files icons
|
156 |
+
|
157 |
= 6.3.6
|
158 |
* Fix. Premium Compatibility
|
159 |
|
woocommerce-checkout-manager.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Checkout Fields Manager for WooCommerce
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
|
6 |
* Description: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
|
7 |
-
* Version: 6.3.
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
17 |
}
|
18 |
|
19 |
define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
|
20 |
-
define( 'WOOCCM_PLUGIN_VERSION', '6.3.
|
21 |
define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
|
22 |
define( 'WOOCCM_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
|
23 |
define( 'WOOCCM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
4 |
* Plugin Name: Checkout Fields Manager for WooCommerce
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
|
6 |
* Description: Manage and customize WooCommerce Checkout fields (Add, Edit, Delete or re-order fields).
|
7 |
+
* Version: 6.3.7
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
17 |
}
|
18 |
|
19 |
define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
|
20 |
+
define( 'WOOCCM_PLUGIN_VERSION', '6.3.7' );
|
21 |
define( 'WOOCCM_PLUGIN_FILE', __FILE__ );
|
22 |
define( 'WOOCCM_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
|
23 |
define( 'WOOCCM_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|