Version Description
- Fix: WordPress 5.5 compatibility
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 5.1.9 |
Comparing to | |
See all releases |
Code changes from version 5.1.8 to 5.1.9
- assets/backend/js/wooccm-admin-field.js +1 -0
- assets/backend/js/wooccm-admin-field.min.js +1 -1
- assets/backend/js/wooccm-admin.js +1 -0
- assets/backend/js/wooccm-admin.min.js +1 -1
- assets/frontend/js/wooccm-checkout.js +1 -0
- assets/frontend/js/wooccm-checkout.min.js +1 -1
- assets/frontend/js/wooccm-order-upload.js +1 -0
- assets/frontend/js/wooccm-order-upload.min.js +1 -1
- includes/class-wooccm-backend.php +1 -1
- includes/class-wooccm-compatibility.php +1 -1
- includes/class-wooccm-suggestions-list-table.php +1 -1
- includes/class-wooccm.php +5 -5
- includes/controller/class-wooccm-field-additional.php +1 -1
- includes/controller/class-wooccm-suggestions.php +1 -1
- includes/view/backend/meta-boxes/html-order-uploads.php +6 -6
- includes/view/backend/pages/advanced.php +3 -3
- includes/view/backend/pages/parts/loop.php +8 -8
- includes/view/frontend/class-wooccm-fields-additional.php +1 -1
- includes/view/frontend/class-wooccm-fields-handler.php +2 -2
- readme.txt +6 -3
- templates/order/order-upload-files.php +7 -7
- woocommerce-checkout-manager.php +2 -2
assets/backend/js/wooccm-admin-field.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
(function ($) {
|
|
|
2 |
|
3 |
var count = 0,
|
4 |
timer;
|
1 |
(function ($) {
|
2 |
+
"use strict";
|
3 |
|
4 |
var count = 0,
|
5 |
timer;
|
assets/backend/js/wooccm-admin-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function($){var count=0,timer,is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function(){$("#wooccm_modal").addClass("processing")},unblock=function(){$("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(object){return _.sortBy(object,(function(o){return o.order}))},escapeHtml:function(attribute){return attribute.replace("&",/&/g).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/'/g,"'")},getFormData:function($form){return $form.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0})}});var FieldModel=Backbone.Model.extend({defaults:wooccm_field.args}),FieldModal=Backbone.View.extend({initialize:function(e){var $button,field_id=$(e.target).closest("[data-field_id]").data("field_id"),model=new FieldModel;model.set({id:field_id}),new FieldView({model:model}).render()}}),FieldView=Backbone.View.extend({events:{"change input":"enableSave","change textarea":"enableSave","change select":"enableSave","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","click .media-modal-tab":"tab","change .media-modal-parent":"parent","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","change .media-modal-render-info":"renderInfo","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","tab","edit","load","render","close","submit","parent"),this.init(),this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(view,selector){view.setElement(this.$(selector)).render()},updateModel:function(e){e.preventDefault();var modal=this,$form=this.$el.find("#wooccm_modal").find("form"),model=_.getFormData($form);this.model.set(model)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(e){e.preventDefault(),this.undelegateEvents(),$(document).off("focusin"),$("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(e)},enableSave:function(e){$(".media-modal-submit").removeProp("disabled"),this.updateModel(e)},disableSave:function(e){$(".media-modal-submit").prop("disabled",!0)},tab:function(e){e.preventDefault();var modal=this,$modal=this.$el.find("#wooccm_modal"),$tab=$(e.currentTarget),$tabs=$modal.find("ul.wc-tabs"),panel=$tab.find("a").attr("href").replace("#","");$tabs.find(".active").removeClass("active"),$tab.addClass("active"),this.model.attributes.panel=panel,this.model.changed.panel=panel,this.renderPanels(e)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){var modal=this;this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new FieldViewTabs({model:this.model}),this.panels=new FieldViewPanels({model:this.model}),this.info=new FieldViewInfo({model:this.model}),this.assign(this.tabs,"#wooccm-modal-tabs"),this.assign(this.panels,"#wooccm-modal-panels"),this.assign(this.info,"#wooccm-modal-info")},open:function(e){$("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){unblock()}),100)},load:function(){var modal=this;null!=modal.model.attributes.id?$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_field",nonce:wooccm_field.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",complete:function(){unblock()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.set(response.data),modal.render()):alert(response.data)}}):modal.render()},edit:function(e){e.preventDefault();var modal=this,$button=$(e.target),field_count=parseInt($(".wc_gateways tr[data-field_id]").length),order=parseInt(modal.model.get("order"));count++,timer&&clearTimeout(timer),timer=setTimeout((function(){order=$button.hasClass("media-modal-next")?Math.min(order+count,field_count):Math.max(order-count,1),modal.model.set({id:parseInt($(".wc_gateways tr[data-field_order="+order+"]").data("field_id"))}),count=0,modal.load()}),300)},submit:function(e){e.preventDefault();var modal=this,$modal=modal.$el.find("#wooccm_modal"),$spinner=$modal.find(".settings-save-status .spinner"),$saved=$modal.find(".settings-save-status .saved");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(modal.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){$(".media-modal-submit").prop("disabled",!0),$spinner.addClass("is-active")},complete:function(){$saved.addClass("is-active"),$spinner.removeClass("is-active"),_.delay((function(){$saved.removeClass("is-active")}),1e3)},error:function(response){alert("Error!")},success:function(response){console.log(response),response.success?null==modal.model.attributes.id&&($modal.addClass("reload"),modal.reload(e),modal.close(e)):alert(response.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(e){e.preventDefault();var modal=this,$modal,$details=modal.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(e),$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:modal.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){modal.disableSave(),$details.addClass("save-waiting")},complete:function(){$details.addClass("save-complete"),$details.removeClass("save-waiting"),modal.enableSave()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.attributes.parent=response.data,modal.model.changed.parent=response.data,modal.renderInfo()):alert(response.data)}}),!1}}),FieldViewTabs=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-tabs")},render:function(){this.model.attributes.panel="general",this.$el.html(this.templates.window(this.model.attributes))}}),FieldViewPanels=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-options"),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}}),FieldViewInfo=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-info")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}});$("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(e){e.preventDefault();var $button=$(e.target),c;return!!confirm(wooccm_field.message.reset)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_reset_fields",nonce:wooccm_field.nonce},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?location.reload():alert(response.data)}}),!1)})),$(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(e){e.preventDefault();var $button,$field=$(e.target).closest("[data-field_id]"),field_id=$field.data("field_id"),c;return!!confirm(wooccm_field.message.remove)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:field_id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?$field.remove():alert(response.data)}}),!1)})),$(document).on("click",".wooccm-field-toggle-attribute",(function(e){e.preventDefault();var $link=$(this),$tr=$link.closest("tr"),$toggle=$link.find(".woocommerce-input-toggle");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:$(this).data("field_attr"),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$toggle.addClass("woocommerce-input-toggle--loading")},success:function(response){!0===response.data?($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--enabled"),$toggle.removeClass("woocommerce-input-toggle--loading")):!0!==response.data&&($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--disabled"),$toggle.removeClass("woocommerce-input-toggle--loading"))}}),!1})),$(document).on("change",".wooccm-field-change-attribute",(function(e){e.preventDefault();var $change=$(this),$tr=$change.closest("tr");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:$change.data("field_attr"),field_value:$change.val(),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$change.prop("disabled",!0)},success:function(response){console.log(response.data)},complete:function(response){$change.prop("disabled",!1)}}),!1}))}(jQuery);
|
1 |
+
!function($){"use strict";var count=0,timer,is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function(){$("#wooccm_modal").addClass("processing")},unblock=function(){$("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(object){return _.sortBy(object,(function(o){return o.order}))},escapeHtml:function(attribute){return attribute.replace("&",/&/g).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/'/g,"'")},getFormData:function($form){return $form.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0})}});var FieldModel=Backbone.Model.extend({defaults:wooccm_field.args}),FieldModal=Backbone.View.extend({initialize:function(e){var $button,field_id=$(e.target).closest("[data-field_id]").data("field_id"),model=new FieldModel;model.set({id:field_id}),new FieldView({model:model}).render()}}),FieldView=Backbone.View.extend({events:{"change input":"enableSave","change textarea":"enableSave","change select":"enableSave","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","click .media-modal-tab":"tab","change .media-modal-parent":"parent","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","change .media-modal-render-info":"renderInfo","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","tab","edit","load","render","close","submit","parent"),this.init(),this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(view,selector){view.setElement(this.$(selector)).render()},updateModel:function(e){e.preventDefault();var modal=this,$form=this.$el.find("#wooccm_modal").find("form"),model=_.getFormData($form);this.model.set(model)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(e){e.preventDefault(),this.undelegateEvents(),$(document).off("focusin"),$("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(e)},enableSave:function(e){$(".media-modal-submit").removeProp("disabled"),this.updateModel(e)},disableSave:function(e){$(".media-modal-submit").prop("disabled",!0)},tab:function(e){e.preventDefault();var modal=this,$modal=this.$el.find("#wooccm_modal"),$tab=$(e.currentTarget),$tabs=$modal.find("ul.wc-tabs"),panel=$tab.find("a").attr("href").replace("#","");$tabs.find(".active").removeClass("active"),$tab.addClass("active"),this.model.attributes.panel=panel,this.model.changed.panel=panel,this.renderPanels(e)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){var modal=this;this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new FieldViewTabs({model:this.model}),this.panels=new FieldViewPanels({model:this.model}),this.info=new FieldViewInfo({model:this.model}),this.assign(this.tabs,"#wooccm-modal-tabs"),this.assign(this.panels,"#wooccm-modal-panels"),this.assign(this.info,"#wooccm-modal-info")},open:function(e){$("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){unblock()}),100)},load:function(){var modal=this;null!=modal.model.attributes.id?$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_field",nonce:wooccm_field.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",complete:function(){unblock()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.set(response.data),modal.render()):alert(response.data)}}):modal.render()},edit:function(e){e.preventDefault();var modal=this,$button=$(e.target),field_count=parseInt($(".wc_gateways tr[data-field_id]").length),order=parseInt(modal.model.get("order"));count++,timer&&clearTimeout(timer),timer=setTimeout((function(){order=$button.hasClass("media-modal-next")?Math.min(order+count,field_count):Math.max(order-count,1),modal.model.set({id:parseInt($(".wc_gateways tr[data-field_order="+order+"]").data("field_id"))}),count=0,modal.load()}),300)},submit:function(e){e.preventDefault();var modal=this,$modal=modal.$el.find("#wooccm_modal"),$spinner=$modal.find(".settings-save-status .spinner"),$saved=$modal.find(".settings-save-status .saved");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(modal.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){$(".media-modal-submit").prop("disabled",!0),$spinner.addClass("is-active")},complete:function(){$saved.addClass("is-active"),$spinner.removeClass("is-active"),_.delay((function(){$saved.removeClass("is-active")}),1e3)},error:function(response){alert("Error!")},success:function(response){console.log(response),response.success?null==modal.model.attributes.id&&($modal.addClass("reload"),modal.reload(e),modal.close(e)):alert(response.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(e){e.preventDefault();var modal=this,$modal,$details=modal.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(e),$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:modal.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){modal.disableSave(),$details.addClass("save-waiting")},complete:function(){$details.addClass("save-complete"),$details.removeClass("save-waiting"),modal.enableSave()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.attributes.parent=response.data,modal.model.changed.parent=response.data,modal.renderInfo()):alert(response.data)}}),!1}}),FieldViewTabs=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-tabs")},render:function(){this.model.attributes.panel="general",this.$el.html(this.templates.window(this.model.attributes))}}),FieldViewPanels=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-options"),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}}),FieldViewInfo=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-info")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}});$("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(e){e.preventDefault();var $button=$(e.target),c;return!!confirm(wooccm_field.message.reset)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_reset_fields",nonce:wooccm_field.nonce},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?location.reload():alert(response.data)}}),!1)})),$(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(e){e.preventDefault();var $button,$field=$(e.target).closest("[data-field_id]"),field_id=$field.data("field_id"),c;return!!confirm(wooccm_field.message.remove)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:field_id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?$field.remove():alert(response.data)}}),!1)})),$(document).on("click",".wooccm-field-toggle-attribute",(function(e){e.preventDefault();var $link=$(this),$tr=$link.closest("tr"),$toggle=$link.find(".woocommerce-input-toggle");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:$(this).data("field_attr"),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$toggle.addClass("woocommerce-input-toggle--loading")},success:function(response){!0===response.data?($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--enabled"),$toggle.removeClass("woocommerce-input-toggle--loading")):!0!==response.data&&($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--disabled"),$toggle.removeClass("woocommerce-input-toggle--loading"))}}),!1})),$(document).on("change",".wooccm-field-change-attribute",(function(e){e.preventDefault();var $change=$(this),$tr=$change.closest("tr");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:$change.data("field_attr"),field_value:$change.val(),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$change.prop("disabled",!0)},success:function(response){console.log(response.data)},complete:function(response){$change.prop("disabled",!1)}}),!1}))}(jQuery);
|
assets/backend/js/wooccm-admin.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
(function ($) {
|
|
|
2 |
|
3 |
$('.wooccm-premium-field').closest('tr').addClass('wooccm-premium');
|
4 |
|
1 |
(function ($) {
|
2 |
+
"use strict";
|
3 |
|
4 |
$('.wooccm-premium-field').closest('tr').addClass('wooccm-premium');
|
5 |
|
assets/backend/js/wooccm-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
1 |
+
!function($){"use strict";function date_picker_select(datepicker){var option=$(datepicker).next().is(".hasDatepicker")?"minDate":"maxDate",otherDateField="minDate"===option?$(datepicker).next():$(datepicker).prev(),date=$(datepicker).datepicker("getDate");$(otherDateField).datepicker("option",option,date),$(datepicker).change()}function getEnhancedSelectFormatString(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}$(".wooccm-premium-field").closest("tr").addClass("wooccm-premium"),$(document).on("wooccm-enhanced-between-dates",(function(e){$(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each((function(){$(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,onSelect:function(){date_picker_select($(this))}}),$(this).find("input").each((function(){date_picker_select($(this))}))}))})),$(document).on("wooccm-enhanced-options",(function(e){$("table.wc_gateways tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(event,ui){return ui.children().each((function(){$(this).width($(this).width())})),ui.css("left","0"),ui},start:function(event,ui){ui.item.css("background-color","#f6f6f6")},stop:function(event,ui){ui.item.removeAttr("style"),ui.item.trigger("updateMoveButtons")},update:function(event,ui){$(this).find("tr").each((function(i,tr){$(tr).find("input.add-order").val(i).trigger("change")}))}}),$(".wooccm-enhanced-options").each((function(){var $table=$(this),$add=$table.find(".add-option"),$remove=$table.find(".remove-options");$add.on("click",(function(e){var $tr=$table.find("tbody > tr"),id=$tr.length,tr=$tr.first().clone().html().replace(/options\[([0-9]+)\]/g,"options["+id+"]").replace('disabled="disabled"',"").replace('checked="checked"',"").replace('<input value="0"','<input value="'+id+'"').replace('<input value="0"','<input value="'+id+'"');$tr.last().after($("<tr>"+tr+"</tr>")).find("input").trigger("change"),$remove.removeProp("disabled")})),$remove.on("click",(function(e){var $tr;$table.find("tr > td.check-column input:checked").closest("tr").remove(),$table.find("tbody > tr").length<2&&$(this).prop("disabled",!0)}))}))})),$(document).on("wooccm-enhanced-select",(function(e){$(".wooccm-enhanced-select").filter(":not(.enhanced)").each((function(){var select2_args=$.extend({minimumResultsForSearch:10,allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder")},getEnhancedSelectFormatString());$(this).selectWoo(select2_args).addClass("enhanced")})),$(".wooccm-product-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")?$(this).data("minimum_input_length"):"3",escapeMarkup:function(m){return m},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(params){return{term:params.term,action:$(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:$(this).select2("val")||0,exclude:$(this).data("exclude"),include:$(this).data("include"),limit:$(this).data("limit"),display_stock:$(this).data("display_stock")}},processResults:function(data){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}},cache:!0}};if(select2_args=$.extend(select2_args,getEnhancedSelectFormatString()),$(this).selectWoo(select2_args).addClass("enhanced"),$(this).data("sortable")){var $select=$(this),$list=$(this).next(".select2-container").find("ul.select2-selection__rendered");$list.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){$($list.find(".select2-selection__choice").get().reverse()).each((function(){var id=$(this).data("data").id,option=$select.find('option[value="'+id+'"]')[0];$select.prepend(option)}))}})}else $(this).prop("multiple")&&$(this).on("change",(function(){var $children=$(this).children();$children.sort((function(a,b){var atext=a.text.toLowerCase(),btext=b.text.toLowerCase();return atext>btext?1:atext<btext?-1:0})),$(this).html($children)}))}))})),$(".wooccm-enhanced-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")||"3",escapeMarkup:function(m){return m},ajax:{url:wooccm_admin.ajax_url,dataType:"json",cache:!0,delay:250,data:function(params){return{term:params.term,key:$(this).data("key"),action:"wooccm_search_field",nonce:wooccm_admin.nonce}},processResults:function(data,params){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}}}};select2_args=$.extend(select2_args,getEnhancedSelectFormatString()),$(this).select2(select2_args).addClass("enhanced")}))}(jQuery);
|
assets/frontend/js/wooccm-checkout.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
(function ($) {
|
|
|
2 |
|
3 |
var is_blocked = function ($node) {
|
4 |
return $node.is('.processing') || $node.parents('.processing').length;
|
1 |
(function ($) {
|
2 |
+
"use strict";
|
3 |
|
4 |
var is_blocked = function ($node) {
|
5 |
return $node.is('.processing') || $node.parents('.processing').length;
|
assets/frontend/js/wooccm-checkout.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function($){var is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function($node){is_blocked($node)||$node.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock=function($node){$node.removeClass("processing").unblock()},append_image=function(list,i,source,name,filetype){var $field_list=$(list),source_class;filetype.match("image.*")?source_class="image":filetype.match("application/ms.*")?(source=wooccm_upload.icons.spreadsheet,source_class="spreadsheet"):filetype.match("application/x.*")?(source=wooccm_upload.icons.archive,source_class="application"):filetype.match("audio.*")?(source=wooccm_upload.icons.audio,source_class="audio"):filetype.match("text.*")?(source=wooccm_upload.icons.text,source_class="text"):filetype.match("video.*")?(source=wooccm_upload.icons.video,source_class="video"):(source=wooccm_upload.icons.interactive,source_class="interactive");var html='<span data-file_id="'+i+'" title="'+name+'" class="wooccm-file-file">\n <span class="wooccm-file-list-container">\n <a title="'+name+'" class="wooccm-file-list-delete">×</a>\n <span class="wooccm-file-list-image-container">\n <img class="'+source_class+'" alt="'+name+'" src="'+source+'"/>\n </span>\n </span>\n </span>';$field_list.append(html).fadeIn()};function field_is_required(field,is_required){is_required?(field.find("label .optional").remove(),field.addClass("validate-required"),0===field.find("label .required").length&&field.find("label").append('<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),field.show(),field.find("input[type=hidden]").prop("type","text")):(field.find("label .required").remove(),field.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===field.find("label .optional").length&&field.find("label").append('<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}$(document).on("country_to_state_changing",(function(event,country,wrapper){var thisform=wrapper,thislocale,locale_fields=$.parseJSON(wc_address_i18n_params.locale_fields);$.each(locale_fields,(function(key,value){var field=thisform.find(value),required=field.find("[data-required]").data("required")||field.find(".wooccm-required-field").length;field_is_required(field,required)}))}));var fileList={};if($(".wooccm-type-file").each((function(i,field){var $field=$(field),$button_file=$field.find("[type=file]"),$button_click=$field.find(".wooccm-file-button"),$field_list=$field.find(".wooccm-file-list");fileList[$field.attr("id")]=[],$button_click.on("click",(function(e){e.preventDefault(),$button_file.trigger("click")})),$field_list.on("click",".wooccm-file-list-delete",(function(e){var $file=$(this).closest(".wooccm-file-file"),file_id=$(this).closest("[data-file_id]").data("file_id");fileList[$field.attr("id")]=$.grep(fileList[$field.attr("id")],(function(value,index){return index!=file_id})),$file.remove(),$("#order_review").trigger("wooccm_upload")})),$button_file.on("change",(function(e){var files=$(this)[0].files;files.length&&window.FileReader&&$.each(files,(function(i,file){var count,theFile;return $field_list.find("span[data-file_id]").length+i>=wooccm_upload.limit.max_files?(alert("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1):file.size>wooccm_upload.limit.max_file_size?(alert("Exeeds max file size of "+wooccm_upload.limit.max_file_size),!0):(reader=new FileReader,reader.onload=(theFile=file,function(e){setTimeout((function(){append_image($field_list,fileList[$field.attr("id")].push(file)-1,e.target.result,theFile.name,theFile.type),$("#order_review").trigger("wooccm_upload")}),200)}),void reader.readAsDataURL(file))}))}))})),$("#order_review").on("ajaxSuccess wooccm_upload",(function(e,xhr,settings){var $order_review,$place_order=$(e.target).find("#place_order"),$fields,fields;$(".wooccm-type-file").length?$place_order.addClass("wooccm-upload-process"):$place_order.removeClass("wooccm-upload-process")})),$(document).on("click","#place_order.wooccm-upload-process",(function(e){e.preventDefault();var $form=$("form.checkout"),$place_order=$(this),$fields;$(".wooccm-type-file").length&&window.FormData&&Object.keys(fileList).length&&(is_blocked($form)||($place_order.html(wooccm_upload.message.uploading),block($form)),$.each(fileList,(function(field_id,files){var $field,$attachment_ids=$("#"+field_id).find(".wooccm-file-field"),data=new FormData;$.each(files,(function(file_id,file){return file_id>wooccm_upload.limit.max_files?(console.log("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1):file.size>wooccm_upload.limit.max_file_size?(console.log("Exeeds max file size of "+wooccm_upload.limit.max_files),!0):(console.log("We're ready to upload "+file.name),void data.append("wooccm_checkout_attachment_upload[]",file))})),data.append("action","wooccm_checkout_attachment_upload"),data.append("nonce",wooccm_upload.nonce),$.ajax({async:!1,url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:data,processData:!1,contentType:!1,beforeSend:function(response){},success:function(response){response.success?$attachment_ids.val(response.data):$("body").trigger("update_checkout")},complete:function(response){}})})),unblock($form),$place_order.removeClass("wooccm-upload-process").trigger("click"))})),$(document).on("change",".wooccm-add-price",(function(e){$("body").trigger("update_checkout")})),$(".wooccm-conditional-child").each((function(i,field){var $field=$(field),$parent=$("#"+$field.find("[data-conditional-parent]").data("conditional-parent")+"_field"),show_if_value=$field.find("[data-conditional-parent-value]").length&&$field.find("[data-conditional-parent-value]").data("conditional-parent-value").toString();$parent.length?($parent.on("wooccm_change change keyup",(function(e){var $this=$(e.target),value=$this.val();$this.hasClass("select2-selection")||("checkbox"==$this.prop("type")&&(value=-1!==$this.attr("name").indexOf("[]")?$parent.find("input:checked").map((function(i,e){return e.value})).toArray():$this.is(":checked")),show_if_value==value||$.isArray(value)&&value.indexOf(show_if_value)>-1?$field.fadeIn():$field.fadeOut(),$this.off("wooccm_change"),$this.off("change"),$this.off("keyup"),$field.trigger("change"))})),$parent.find("select:first").trigger("wooccm_change"),$parent.find("textarea:first").trigger("wooccm_change"),$parent.find("input[type=button]:first").trigger("wooccm_change"),$parent.find("input[type=radio]:checked:first").trigger("wooccm_change"),$parent.find("input[type=checkbox]:checked:first").trigger("wooccm_change"),$parent.find("input[type=color]:first").trigger("wooccm_change"),$parent.find("input[type=date]:first").trigger("wooccm_change"),$parent.find("input[type=datetime-local]:first").trigger("wooccm_change"),$parent.find("input[type=email]:first").trigger("wooccm_change"),$parent.find("input[type=file]:first").trigger("wooccm_change"),$parent.find("input[type=hidden]:first").trigger("wooccm_change"),$parent.find("input[type=image]:first").trigger("wooccm_change"),$parent.find("input[type=month]:first").trigger("wooccm_change"),$parent.find("input[type=number]:first").trigger("wooccm_change"),$parent.find("input[type=password]:first").trigger("wooccm_change"),$parent.find("input[type=range]:first").trigger("wooccm_change"),$parent.find("input[type=reset]:first").trigger("wooccm_change"),$parent.find("input[type=search]:first").trigger("wooccm_change"),$parent.find("input[type=submit]:first").trigger("wooccm_change"),$parent.find("input[type=tel]:first").trigger("wooccm_change"),$parent.find("input[type=text]:first").trigger("wooccm_change"),$parent.find("input[type=time]:first").trigger("wooccm_change"),$parent.find("input[type=url]:first").trigger("wooccm_change"),$parent.find("input[type=week]:first").trigger("wooccm_change")):$field.show()})),$(".wooccm-enhanced-datepicker").each((function(i,field){var $input=$(this),disable=$input.data("disable")||!1;console.log("mindate",$input.data("mindate")),$.isFunction($.fn.datepicker)&&$input.datepicker({dateFormat:$input.data("formatdate")||"dd-mm-yy",minDate:$input.data("mindate"),maxDate:$input.data("maxdate"),beforeShowDay:function(date){var day=null!=date.getDay()&&date.getDay().toString();return disable?[-1===$.inArray(day,disable)]:[!0]}})})),$(".wooccm-enhanced-timepicker").each((function(i,field){var $input=$(this);$.isFunction($.fn.timepicker)&&$input.timepicker({showPeriod:!0,showLeadingZero:!0,hours:$input.data("hours")||void 0,minutes:$input.data("minutes")||void 0})})),$(".wooccm-colorpicker-farbtastic").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]"),$container=$field.find(".wooccmcolorpicker_container");$input.hide(),$.isFunction($.fn.farbtastic)&&($container.farbtastic("#"+$input.attr("id")),$container.on("click",(function(e){$input.fadeIn()})))})),$(".wooccm-colorpicker-iris").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]");$input.css("background",$input.val()),$input.on("click",(function(e){$field.toggleClass("active")})),$input.iris({class:$input.attr("id"),palettes:!0,color:"",hide:!1,change:function(event,ui){$input.css("background",ui.color.toString()).fadeIn()}})})),$(document).on("click",(function(e){0===$(e.target).closest(".iris-picker").length&&$(".wooccm-colorpicker-iris").removeClass("active")})),"undefined"==typeof wc_country_select_params)return!1;if($().selectWoo){var getEnhancedSelectFormatString=function(){return{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}}},wooccm_enhanced_select;(function(){$("select.wooccm-enhanced-select").each((function(){var select2_args=$.extend({width:"100%",placeholder:$(this).data("placeholder")||"",allowClear:$(this).data("allowclear")||!1,selectOnClose:$(this).data("selectonclose")||!1,closeOnSelect:$(this).data("closeonselect")||!1,minimumResultsForSearch:$(this).data("search")||-1},getEnhancedSelectFormatString());$(this).on("select2:select",(function(){$(this).focus()})).selectWoo(select2_args)}))})()}}(jQuery);
|
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;console.log("mindate",$input.data("mindate")),$.isFunction($.fn.datepicker)&&$input.datepicker({dateFormat:$input.data("formatdate")||"dd-mm-yy",minDate:$input.data("mindate"),maxDate:$input.data("maxdate"),beforeShowDay:function(date){var day=null!=date.getDay()&&date.getDay().toString();return disable?[-1===$.inArray(day,disable)]:[!0]}})})),$(".wooccm-enhanced-timepicker").each((function(i,field){var $input=$(this);$.isFunction($.fn.timepicker)&&$input.timepicker({showPeriod:!0,showLeadingZero:!0,hours:$input.data("hours")||void 0,minutes:$input.data("minutes")||void 0})})),$(".wooccm-colorpicker-farbtastic").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]"),$container=$field.find(".wooccmcolorpicker_container");$input.hide(),$.isFunction($.fn.farbtastic)&&($container.farbtastic("#"+$input.attr("id")),$container.on("click",(function(e){$input.fadeIn()})))})),$(".wooccm-colorpicker-iris").each((function(i,field){var $field=$(field),$input=$field.find("input[type=text]");$input.css("background",$input.val()),$input.on("click",(function(e){$field.toggleClass("active")})),$input.iris({class:$input.attr("id"),palettes:!0,color:"",hide:!1,change:function(event,ui){$input.css("background",ui.color.toString()).fadeIn()}})})),$(document).on("click",(function(e){0===$(e.target).closest(".iris-picker").length&&$(".wooccm-colorpicker-iris").removeClass("active")})),"undefined"==typeof wc_country_select_params)return!1;if($().selectWoo){var getEnhancedSelectFormatString=function(){return{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}}},wooccm_enhanced_select;(function(){$("select.wooccm-enhanced-select").each((function(){var select2_args=$.extend({width:"100%",placeholder:$(this).data("placeholder")||"",allowClear:$(this).data("allowclear")||!1,selectOnClose:$(this).data("selectonclose")||!1,closeOnSelect:$(this).data("closeonselect")||!1,minimumResultsForSearch:$(this).data("search")||-1},getEnhancedSelectFormatString());$(this).on("select2:select",(function(){$(this).focus()})).selectWoo(select2_args)}))})()}}(jQuery);
|
assets/frontend/js/wooccm-order-upload.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
(function ($) {
|
|
|
2 |
|
3 |
var is_blocked = function ($node) {
|
4 |
return $node.is('.processing') || $node.parents('.processing').length;
|
1 |
(function ($) {
|
2 |
+
"use strict";
|
3 |
|
4 |
var is_blocked = function ($node) {
|
5 |
return $node.is('.processing') || $node.parents('.processing').length;
|
assets/frontend/js/wooccm-order-upload.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function($){var is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function($node){is_blocked($node)||$node.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock=function($node){$node.removeClass("processing").unblock()};$(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,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);
|
includes/class-wooccm-backend.php
CHANGED
@@ -60,7 +60,7 @@ class WOOCCM_Field_Admin
|
|
60 |
if ($managing_stock && !empty($_GET['display_stock'])) {
|
61 |
$stock_amount = $product_object->get_stock_quantity();
|
62 |
/* Translators: %d stock amount */
|
63 |
-
$formatted_name .= ' – ' . sprintf(
|
64 |
}
|
65 |
|
66 |
$products[$product_object->get_id()] = rawurldecode($formatted_name);
|
60 |
if ($managing_stock && !empty($_GET['display_stock'])) {
|
61 |
$stock_amount = $product_object->get_stock_quantity();
|
62 |
/* Translators: %d stock amount */
|
63 |
+
$formatted_name .= ' – ' . sprintf(esc_html__('Stock: %d', 'woocommerce'), wc_format_stock_quantity_for_display($stock_amount, $product_object));
|
64 |
}
|
65 |
|
66 |
$products[$product_object->get_id()] = rawurldecode($formatted_name);
|
includes/class-wooccm-compatibility.php
CHANGED
@@ -15,7 +15,7 @@ class WOOCCM_Field_Compatibility
|
|
15 |
'select' => 'wooccmselect',
|
16 |
'radio' => 'wooccmradio',
|
17 |
'checkbox' => 'checkbox_wccm',
|
18 |
-
//'button' =>
|
19 |
'country' => 'wooccmcountry',
|
20 |
'state' => 'wooccmstate',
|
21 |
'multiselect' => 'multiselect',
|
15 |
'select' => 'wooccmselect',
|
16 |
'radio' => 'wooccmradio',
|
17 |
'checkbox' => 'checkbox_wccm',
|
18 |
+
//'button' => esc_html__('Button', 'woocommerce-checkout-manager'),
|
19 |
'country' => 'wooccmcountry',
|
20 |
'state' => 'wooccmstate',
|
21 |
'multiselect' => 'multiselect',
|
includes/class-wooccm-suggestions-list-table.php
CHANGED
@@ -108,7 +108,7 @@ class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
|
|
108 |
$tabs = array();
|
109 |
|
110 |
if ('search' === $tab) {
|
111 |
-
$tabs['search'] =
|
112 |
}
|
113 |
if ($tab === 'beta' || false !== strpos(get_bloginfo('version'), '-')) {
|
114 |
$tabs['beta'] = _x('Beta Testing', 'Plugin Installer');
|
108 |
$tabs = array();
|
109 |
|
110 |
if ('search' === $tab) {
|
111 |
+
$tabs['search'] = esc_html__('Search Results');
|
112 |
}
|
113 |
if ($tab === 'beta' || false !== strpos(get_bloginfo('version'), '-')) {
|
114 |
$tabs['beta'] = _x('Beta Testing', 'Plugin Installer');
|
includes/class-wooccm.php
CHANGED
@@ -91,13 +91,13 @@ final class WOOCCM
|
|
91 |
// ---------------------------------------------------------------------
|
92 |
wp_register_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), $wp_version);
|
93 |
|
94 |
-
wp_register_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), $wp_version);
|
95 |
|
96 |
wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
|
97 |
-
'clear' =>
|
98 |
-
'defaultString' =>
|
99 |
-
'pick' =>
|
100 |
-
'current' =>
|
101 |
));
|
102 |
|
103 |
wp_register_script('farbtastic', admin_url('js/farbtastic.js'), array('jquery'), $wp_version);
|
91 |
// ---------------------------------------------------------------------
|
92 |
wp_register_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), $wp_version);
|
93 |
|
94 |
+
wp_register_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris', 'wp-i18n'), $wp_version);
|
95 |
|
96 |
wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
|
97 |
+
'clear' => esc_html__('Clear'),
|
98 |
+
'defaultString' => esc_html__('Default'),
|
99 |
+
'pick' => esc_html__('Select Color'),
|
100 |
+
'current' => esc_html__('Current Color'),
|
101 |
));
|
102 |
|
103 |
wp_register_script('farbtastic', admin_url('js/farbtastic.js'), array('jquery'), $wp_version);
|
includes/controller/class-wooccm-field-additional.php
CHANGED
@@ -149,7 +149,7 @@ class WOOCCM_Field_Controller_Additional extends WOOCCM_Field_Controller
|
|
149 |
if ($value) {
|
150 |
?>
|
151 |
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
152 |
-
<strong title="<?php echo esc_attr(sprintf(
|
153 |
<?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?>
|
154 |
</strong>
|
155 |
<?php echo esc_html($value); ?>
|
149 |
if ($value) {
|
150 |
?>
|
151 |
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
152 |
+
<strong title="<?php echo esc_attr(sprintf(esc_html__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, esc_html__('Generic', 'woocommerce-checkout-manager'))); ?>">
|
153 |
<?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?>
|
154 |
</strong>
|
155 |
<?php echo esc_html($value); ?>
|
includes/controller/class-wooccm-suggestions.php
CHANGED
@@ -31,7 +31,7 @@ class WOOCCM_Checkout_Suggestions_Controller
|
|
31 |
|
32 |
public function add_menu()
|
33 |
{
|
34 |
-
add_submenu_page(WOOCCM_PREFIX,
|
35 |
}
|
36 |
|
37 |
// fix for activateUrl on install now button
|
31 |
|
32 |
public function add_menu()
|
33 |
{
|
34 |
+
add_submenu_page(WOOCCM_PREFIX, esc_html__('Suggestions', 'woocommerce-checkout-manager'), esc_html__('Suggestions', 'woocommerce-checkout-manager'), 'manage_woocommerce', WOOCCM_PREFIX . '_suggestions', array($this, 'add_page'));
|
35 |
}
|
36 |
|
37 |
// fix for activateUrl on install now button
|
includes/view/backend/meta-boxes/html-order-uploads.php
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
<table cellpadding="0" cellspacing="0" class="wooccm_order_attachments">
|
3 |
<thead>
|
4 |
<tr>
|
5 |
-
<th><?php
|
6 |
-
<th><?php
|
7 |
-
<th><?php
|
8 |
-
<th><?php
|
9 |
<th class="column-actions"></th>
|
10 |
</tr>
|
11 |
</thead>
|
@@ -52,10 +52,10 @@
|
|
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
|
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
|
59 |
<div class="wooccm_upload_results"></div>
|
60 |
</div>
|
61 |
</div>
|
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>
|
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>
|
includes/view/backend/pages/advanced.php
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
</div>
|
7 |
<?php if (current_user_can('manage_options')) : ?>
|
8 |
-
<a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_options', '_wpnonce' => wp_create_nonce('wooccm_nuke_options'))); ?>" class="button button-secondary" data-confirm="<?php
|
9 |
-
<a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_order_meta', '_wpnonce' => wp_create_nonce('wooccm_nuke_order_meta'))); ?>" class="button button-secondary" data-confirm="<?php
|
10 |
-
<a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_user_meta', '_wpnonce' => wp_create_nonce('wooccm_nuke_user_meta'))); ?>" class="button button-secondary" data-confirm="<?php
|
11 |
<?php endif; ?>-->
|
12 |
<?php woocommerce_admin_fields($settings); ?>
|
5 |
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
</div>
|
7 |
<?php if (current_user_can('manage_options')) : ?>
|
8 |
+
<a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_options', '_wpnonce' => wp_create_nonce('wooccm_nuke_options'))); ?>" class="button button-secondary" data-confirm="<?php esc_html_e('This will permanently delete all WordPress Options associated with WooCommerce Checkout Manager. Are you sure you want to proceed?', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete Options', 'woocommerce-checkout-manager'); ?></a>
|
9 |
+
<a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_order_meta', '_wpnonce' => wp_create_nonce('wooccm_nuke_order_meta'))); ?>" class="button button-secondary" data-confirm="<?php esc_html_e('This will permanently delete all WordPress Post meta associated with that is linked to Orders. Are you sure you want to proceed?', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete Orders Post meta', 'woocommerce-checkout-manager'); ?></a>
|
10 |
+
<a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_user_meta', '_wpnonce' => wp_create_nonce('wooccm_nuke_user_meta'))); ?>" class="button button-secondary" data-confirm="<?php esc_html_e('This will permanently delete all WordPress Post meta associated with that is linked to Users. Are you sure you want to proceed?', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete Users Post meta', 'woocommerce-checkout-manager'); ?></a>
|
11 |
<?php endif; ?>-->
|
12 |
<?php woocommerce_admin_fields($settings); ?>
|
includes/view/backend/pages/parts/loop.php
CHANGED
@@ -28,8 +28,8 @@
|
|
28 |
<tr data-field_id="<?php echo esc_attr($field['id']); ?>" data-field_order="<?php echo esc_attr($field['order']); ?>">
|
29 |
<td class="sort ui-sortable-handle">
|
30 |
<div class="wc-item-reorder-nav">
|
31 |
-
<button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(
|
32 |
-
<button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(
|
33 |
<input type="hidden" name="field_order[]" value="<?php echo esc_attr($id); ?>">
|
34 |
</div>
|
35 |
</td>
|
@@ -37,9 +37,9 @@
|
|
37 |
<a data-field_attr="required" class="wooccm-field-toggle-attribute" href="#">
|
38 |
<?php
|
39 |
if ($field['required'] === true) {
|
40 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(
|
41 |
} else {
|
42 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(
|
43 |
}
|
44 |
?>
|
45 |
</a>
|
@@ -55,9 +55,9 @@
|
|
55 |
<a data-field_attr="clear" class="wooccm-field-toggle-attribute" href="#">
|
56 |
<?php
|
57 |
if ($field['clear'] === true) {
|
58 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(
|
59 |
} else {
|
60 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(
|
61 |
}
|
62 |
?>
|
63 |
</a>
|
@@ -108,9 +108,9 @@
|
|
108 |
<a data-field_attr="disabled" class="wooccm-field-toggle-attribute" href="#">
|
109 |
<?php
|
110 |
if ($field['disabled'] === true) {
|
111 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(
|
112 |
} else {
|
113 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(
|
114 |
}
|
115 |
?>
|
116 |
</a>
|
28 |
<tr data-field_id="<?php echo esc_attr($field['id']); ?>" data-field_order="<?php echo esc_attr($field['order']); ?>">
|
29 |
<td class="sort ui-sortable-handle">
|
30 |
<div class="wc-item-reorder-nav">
|
31 |
+
<button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(esc_html__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move up', 'woocommerce-checkout-manager'); ?></button>
|
32 |
+
<button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(esc_html__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move down', 'woocommerce-checkout-manager'); ?></button>
|
33 |
<input type="hidden" name="field_order[]" value="<?php echo esc_attr($id); ?>">
|
34 |
</div>
|
35 |
</td>
|
37 |
<a data-field_attr="required" class="wooccm-field-toggle-attribute" href="#">
|
38 |
<?php
|
39 |
if ($field['required'] === true) {
|
40 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
41 |
} else {
|
42 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
43 |
}
|
44 |
?>
|
45 |
</a>
|
55 |
<a data-field_attr="clear" class="wooccm-field-toggle-attribute" href="#">
|
56 |
<?php
|
57 |
if ($field['clear'] === true) {
|
58 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
59 |
} else {
|
60 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
61 |
}
|
62 |
?>
|
63 |
</a>
|
108 |
<a data-field_attr="disabled" class="wooccm-field-toggle-attribute" href="#">
|
109 |
<?php
|
110 |
if ($field['disabled'] === true) {
|
111 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
112 |
} else {
|
113 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(esc_html__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
114 |
}
|
115 |
?>
|
116 |
</a>
|
includes/view/frontend/class-wooccm-fields-additional.php
CHANGED
@@ -54,7 +54,7 @@ class WOOCCM_Fields_Additional
|
|
54 |
|
55 |
if (!empty($field['required']) && empty($field['disabled']) && !isset($_POST[$key])) {
|
56 |
|
57 |
-
$message = sprintf(
|
58 |
|
59 |
wc_add_notice($message, 'error');
|
60 |
}
|
54 |
|
55 |
if (!empty($field['required']) && empty($field['disabled']) && !isset($_POST[$key])) {
|
56 |
|
57 |
+
$message = sprintf(esc_html__('%s is a required field.', 'woocommerce-checkout-manager'), '<strong>' . esc_html($field['label']) . '</strong>');
|
58 |
|
59 |
wc_add_notice($message, 'error');
|
60 |
}
|
includes/view/frontend/class-wooccm-fields-handler.php
CHANGED
@@ -59,11 +59,11 @@ class WOOCCM_Fields_Handler
|
|
59 |
case 'checkbox':
|
60 |
|
61 |
if (!empty($_POST[$key])) {
|
62 |
-
$data[$key] =
|
63 |
}
|
64 |
|
65 |
// else {
|
66 |
-
// $data[$key] =
|
67 |
// }
|
68 |
|
69 |
break;
|
59 |
case 'checkbox':
|
60 |
|
61 |
if (!empty($_POST[$key])) {
|
62 |
+
$data[$key] = esc_html__('Yes', 'woocommerce-checkout-manager');
|
63 |
}
|
64 |
|
65 |
// else {
|
66 |
+
// $data[$key] = esc_html__('No', 'woocommerce-checkout-manager');
|
67 |
// }
|
68 |
|
69 |
break;
|
readme.txt
CHANGED
@@ -3,10 +3,10 @@ Contributors: quadlayers
|
|
3 |
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.
|
7 |
-
Stable tag: 5.1.
|
8 |
WC requires at least: 3.1.0
|
9 |
-
WC tested up to: 4.3.
|
10 |
License: GPLv3
|
11 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
|
@@ -107,6 +107,9 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
|
|
107 |
|
108 |
== Changelog ==
|
109 |
|
|
|
|
|
|
|
110 |
= 5.1.8 =
|
111 |
* Fix: php errors
|
112 |
|
3 |
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.1.9
|
8 |
WC requires at least: 3.1.0
|
9 |
+
WC tested up to: 4.3.2
|
10 |
License: GPLv3
|
11 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
|
107 |
|
108 |
== Changelog ==
|
109 |
|
110 |
+
= 5.1.9 =
|
111 |
+
* Fix: WordPress 5.5 compatibility
|
112 |
+
|
113 |
= 5.1.8 =
|
114 |
* Fix: php errors
|
115 |
|
templates/order/order-upload-files.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
<table class="woocommerce_order_items shop_table">
|
4 |
<thead>
|
5 |
<tr>
|
6 |
-
<th><?php
|
7 |
-
<th><?php
|
8 |
-
<th><?php
|
9 |
-
<th><?php
|
10 |
-
<th class="column-actions"><?php
|
11 |
</tr>
|
12 |
</thead>
|
13 |
<tbody class="product_images">
|
@@ -49,10 +49,10 @@
|
|
49 |
<input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
50 |
<p class="order-upload">
|
51 |
<a style="float: left; margin: 0 10px 0 0;" class="button alt fileinput-button">
|
52 |
-
<span><?php
|
53 |
<input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
|
54 |
</a>
|
55 |
-
<input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php
|
56 |
<span class="wooccm_upload_results"></span>
|
57 |
</p>
|
58 |
</div>
|
3 |
<table class="woocommerce_order_items shop_table">
|
4 |
<thead>
|
5 |
<tr>
|
6 |
+
<th><?php esc_html_e('File', 'woocommerce-checkout-manager'); ?></th>
|
7 |
+
<th><?php esc_html_e('Filename', 'woocommerce-checkout-manager'); ?></th>
|
8 |
+
<th><?php esc_html_e('Dimensions', 'woocommerce-checkout-manager'); ?></th>
|
9 |
+
<th><?php esc_html_e('Extension', ' woocommerce-checkout-manager'); ?></th>
|
10 |
+
<th class="column-actions"><?php esc_html_e('Actions', 'woocommerce-checkout-manager'); ?></th>
|
11 |
</tr>
|
12 |
</thead>
|
13 |
<tbody class="product_images">
|
49 |
<input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
50 |
<p class="order-upload">
|
51 |
<a style="float: left; margin: 0 10px 0 0;" class="button alt fileinput-button">
|
52 |
+
<span><?php esc_html_e('Upload Files', 'woocommerce-checkout-manager'); ?></span>
|
53 |
<input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
|
54 |
</a>
|
55 |
+
<input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php esc_html_e('Save Changes', 'woocommerce-checkout-manager'); ?>" disabled="disabled">
|
56 |
<span class="wooccm_upload_results"></span>
|
57 |
</p>
|
58 |
</div>
|
woocommerce-checkout-manager.php
CHANGED
@@ -4,13 +4,13 @@
|
|
4 |
* Plugin Name: Checkout Manager for WooCommerce
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
|
6 |
* Description: Manages WooCommerce Checkout, the advanced way.
|
7 |
-
* Version: 5.1.
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
11 |
* Text Domain: woocommerce-checkout-manager
|
12 |
* WC requires at least: 3.1.0
|
13 |
-
* WC tested up to: 4.3.
|
14 |
*/
|
15 |
if (!defined('ABSPATH')) {
|
16 |
die('-1');
|
4 |
* Plugin Name: Checkout Manager for WooCommerce
|
5 |
* Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
|
6 |
* Description: Manages WooCommerce Checkout, the advanced way.
|
7 |
+
* Version: 5.1.9
|
8 |
* Author: QuadLayers
|
9 |
* Author URI: https://quadlayers.com
|
10 |
* License: GPLv3
|
11 |
* Text Domain: woocommerce-checkout-manager
|
12 |
* WC requires at least: 3.1.0
|
13 |
+
* WC tested up to: 4.3.2
|
14 |
*/
|
15 |
if (!defined('ABSPATH')) {
|
16 |
die('-1');
|