WooCommerce Checkout Manager - Version 6.0.5

Version Description

  • Fix: WooCommerce compatibility
Download this release

Release Info

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

Code changes from version 6.0.2 to 6.0.5

assets/backend/css/admin.css CHANGED
@@ -1 +1 @@
1
- .select2-container{z-index:9999999}.select2-container .select2-selection--single,.select2-container .select2-selection--single .select2-selection__rendered,.select2-container .select2-selection--single .select2-selection__arrow{height:30px !important;line-height:30px !important}.wooccm-premium{opacity:0.5;pointer-events:none}.button.fileinput-button{position:relative;overflow:hidden !important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}table.wc_gateways>tbody>tr>td select{line-height:1 !important}table.wc_gateways>tbody>tr>td.label{font-weight:600}table.wooccm-enhanced-options{border:none;box-shadow:none}table.wooccm-enhanced-options>thead>th .woocommerce-help-tip{margin:-1px 0 0 0.25em}table.wooccm-enhanced-options>tbody>tr>td input.label{width:100%}table.wooccm-enhanced-options>tbody>tr>td select.add-price-type{margin:0 0 0 10px}table.wooccm-enhanced-options>tbody>tr>td input.check{margin:0 9px}table.wooccm-enhanced-options>tbody>tr>td.sort .wc-item-reorder-nav{width:auto}#wooccm_modal.processing{pointer-events:none}#wooccm_modal.processing:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#ffffff;z-index:99999999;opacity:0.8}#wooccm_modal select{min-height:30px}#wooccm_modal .form-field .wrap{padding:0}#wooccm_modal .attachment-info .details,#wooccm_modal .attachment-info .settings{width:100%}#wooccm_modal .attachment-info .woocommerce_options_panel label,#wooccm_modal .attachment-info .woocommerce_options_panel legend{width:75px;margin:0 0 0 -90px;font-weight:600}#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field{padding:0 20px 0 92px !important}#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],#wooccm_modal .attachment-info .woocommerce_options_panel select,#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container{width:100% !important}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel{width:100%}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium{display:block;clear:both}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip{margin:0 0 0 0.5em}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:50% !important;line-height:16px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection{box-shadow:none;border-radius:3px;padding:0 24px 0 8px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple{line-height:16px;min-height:30px}@media only screen and (max-width: 1280px){#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:80% !important}}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li{margin:3px 3px 0 0}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#5b9dd9 !important;box-shadow:0 0 2px rgba(30,140,190,0.8) !important;outline:2px solid transparent !important}#wooccm-order-files .inside{margin:0;padding:0;background:#fefefe;display:block !important}#wooccm-order-files .handlediv,#wooccm-order-files .hndle{display:none}#wooccm-order-files .wooccm_upload_results{display:inline-block;margin:0 10px}#wooccm-order-files .wooccm_order_attachments_wrapper{margin:0;overflow-x:auto}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments{width:100%;background:#fff}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable{cursor:pointer}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item{min-width:200px}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;user-select:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td{border-top:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#wooccm-order-files .wc-order-data-row{border-bottom:1px solid #dfdfdf;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:left}
1
+ .select2-container{z-index:9999999}.select2-container .select2-selection--single,.select2-container .select2-selection--single .select2-selection__rendered,.select2-container .select2-selection--single .select2-selection__arrow{height:30px !important;line-height:30px !important}.wooccm-premium{opacity:0.5;pointer-events:none}.button.fileinput-button{position:relative;overflow:hidden !important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}table.wc_gateways>tbody>tr>td select{line-height:1 !important}table.wc_gateways>tbody>tr>td.label{font-weight:600}table.wooccm-enhanced-options{border:none;box-shadow:none}table.wooccm-enhanced-options>thead>th .woocommerce-help-tip{margin:-1px 0 0 0.25em}table.wooccm-enhanced-options>tbody>tr>td input.label{width:100%}table.wooccm-enhanced-options>tbody>tr>td select.add-price-type{margin:0 0 0 10px}table.wooccm-enhanced-options>tbody>tr>td input.check{margin:0 9px}table.wooccm-enhanced-options>tbody>tr>td.sort .wc-item-reorder-nav{width:auto}#wooccm_modal.processing{pointer-events:none}#wooccm_modal.processing:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#ffffff;z-index:99999999;opacity:0.8}#wooccm_modal select{min-height:30px}#wooccm_modal .form-field .wrap{padding:0}#wooccm_modal .attachment-info .details,#wooccm_modal .attachment-info .settings{width:100%}#wooccm_modal .attachment-info .woocommerce_options_panel label,#wooccm_modal .attachment-info .woocommerce_options_panel legend{width:75px;margin:0 0 0 -90px;font-weight:600}#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field{padding:0 20px 0 92px !important}#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],#wooccm_modal .attachment-info .woocommerce_options_panel select,#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container{width:100% !important}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel{width:100%}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium{display:block;clear:both}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip{margin:0 0 0 0.5em}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:50% !important;line-height:16px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection{box-shadow:none;border-radius:3px;padding:0 24px 0 8px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple{line-height:16px;min-height:30px}@media only screen and (max-width: 1280px){#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:80% !important}}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li{margin:3px 3px 0 0}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#5b9dd9 !important;box-shadow:0 0 2px rgba(30,140,190,0.8) !important;outline:2px solid transparent !important}#wooccm-order-files .inside{margin:0;padding:0;background:#fefefe;display:block !important}#wooccm-order-files .handlediv,#wooccm-order-files .hndle{display:none}#wooccm-order-files .wooccm_upload_results{display:inline-block;margin:0 10px}#wooccm-order-files .wooccm_order_attachments_wrapper{margin:0;overflow-x:auto}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments{width:100%;background:#fff}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable{cursor:pointer}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item{min-width:200px}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;user-select:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td{border-top:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#wooccm-order-files .wc-order-data-row{border-bottom:1px solid #dfdfdf;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:left}
assets/backend/js/admin-field.asset.php CHANGED
@@ -1,5 +1 @@
1
- <?php return array(
2
- 'dependencies' => array( 'backbone', 'jquery', 'jquery-ui-datepicker', 'wp-util' ),
3
- 'version' => '3b35ab2a74c16fe901f6d1895971b4b0',
4
- );
5
-
1
+ <?php return array('dependencies' => array('backbone', 'jquery', 'jquery-ui-datepicker', 'wp-util'), 'version' => '0815485febc8e317b67dcc102b05f0c1');
 
 
 
 
assets/backend/js/admin-field.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function o(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)o.d(n,a,function(t){return e[t]}.bind(null,a));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);o(1),o(2),o(3),o(4);!function(e){var t,o=0,n=function(){e("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(e){return _.sortBy(e,(function(e){return e.order}))},escapeHtml:function(e){return e.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function(e){var t=e.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0}),o=Object.assign({},wooccm_field.args);return Object.assign(o,t)}});var a=Backbone.Model.extend({defaults:Object.create(wooccm_field.args)}),i=Backbone.View.extend({initialize:function(t){var o=e(t.target).closest("[data-field_id]").data("field_id"),n=new a;n.set({id:o}),new l({model:n}).render()}}),l=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(e,t){e.setElement(this.$(t)).render()},updateModel:function(e){e.preventDefault();var t=this.$el.find("#wooccm_modal").find("form"),o=_.getFormData(t);this.model.set(o)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(t){t.preventDefault(),this.undelegateEvents(),e(document).off("focusin"),e("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(t)},enableSave:function(t){e(".media-modal-submit").prop("disabled",!1),this.updateModel(t)},disableSave:function(t){e(".media-modal-submit").prop("disabled",!0)},tab:function(t){t.preventDefault();var o=this.$el.find("#wooccm_modal"),n=e(t.currentTarget),a=o.find("ul.wc-tabs"),i=n.find("a").attr("href").replace("#","");a.find(".active").removeClass("active"),n.addClass("active"),this.model.attributes.panel=i,this.model.changed.panel=i,this.renderPanels(t)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new c({model:this.model}),this.panels=new d({model:this.model}),this.info=new s({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(t){e("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){n()}),100)},load:function(){var t=this;null!=t.model.attributes.id?e.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(){n()},error:function(){alert("Error!")},success:function(e){console.log("response",e),e.success?(t.model.set(e.data),t.render()):alert(e.data)}}):t.render()},edit:function(n){n.preventDefault();var a=this,i=e(n.target),l=parseInt(e(".wc_gateways tr[data-field_id]").length),c=parseInt(a.model.get("order"));o++,t&&clearTimeout(t),t=setTimeout((function(){c=i.hasClass("media-modal-next")?Math.min(c+o,l):Math.max(c-o,1),a.model.set({id:parseInt(e(".wc_gateways tr[data-field_order="+c+"]").data("field_id"))}),o=0,a.load()}),300)},submit:function(t){t.preventDefault();var o=this,n=o.$el.find("#wooccm_modal"),a=n.find(".settings-save-status .spinner"),i=n.find(".settings-save-status .saved");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(o.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){e(".media-modal-submit").prop("disabled",!0),a.addClass("is-active")},complete:function(){i.addClass("is-active"),a.removeClass("is-active"),_.delay((function(){i.removeClass("is-active")}),1e3)},error:function(e){alert("Error!")},success:function(e){e.success?null==o.model.attributes.id&&(n.addClass("reload"),o.reload(t),o.close(t)):alert(e.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(t){t.preventDefault();var o=this,n=o.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(t),e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:o.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){o.disableSave(),n.addClass("save-waiting")},complete:function(){n.addClass("save-complete"),n.removeClass("save-waiting"),o.enableSave()},error:function(){alert("Error!")},success:function(e){e.success?(o.model.attributes.parent=e.data,o.model.changed.parent=e.data,o.renderInfo()):alert(e.data)}}),!1}}),c=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))}}),d=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")}}),s=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")}});e("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new i(e)})),e("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(t){t.preventDefault();e(t.target);return!!confirm(wooccm_field.message.reset)&&(e.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(e){e.success?location.reload():alert(e.data)}}),!1)})),e(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new i(e)})),e(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(t){t.preventDefault();var o=e(t.target).closest("[data-field_id]"),n=o.data("field_id");return!!confirm(wooccm_field.message.remove)&&(e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:n},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(e){e.success?o.remove():alert(e.data)}}),!1)})),e(document).on("click",".wooccm-field-toggle-attribute",(function(t){t.preventDefault();var o=e(this),n=o.closest("tr"),a=o.find(".woocommerce-input-toggle");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:e(this).data("field_attr"),field_id:n.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){a.addClass("woocommerce-input-toggle--loading")},success:function(e){!0===e.data?(a.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),a.addClass("woocommerce-input-toggle--enabled"),a.removeClass("woocommerce-input-toggle--loading")):!0!==e.data&&(a.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),a.addClass("woocommerce-input-toggle--disabled"),a.removeClass("woocommerce-input-toggle--loading"))}}),!1})),e(document).on("change",".wooccm-field-change-attribute",(function(t){t.preventDefault();var o=e(this),n=o.closest("tr");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:o.data("field_attr"),field_value:o.val(),field_id:n.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){o.prop("disabled",!0)},success:function(e){console.log(e.data)},complete:function(e){o.prop("disabled",!1)}}),!1}))}(jQuery)},function(e,t){!function(){e.exports=this.jQuery}()},function(e,t){!function(){e.exports=this.wp.util}()},function(e,t){!function(){e.exports=this.window.Backbone}()},function(e,t){!function(){e.exports=this.window.uiDatepicker}()}]);
1
+ !function(e){var t={};function o(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)o.d(n,a,function(t){return e[t]}.bind(null,a));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);o(1),o(2),o(3),o(4);!function(e){var t,o=0,n=function(){e("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(e){return _.sortBy(e,(function(e){return e.order}))},escapeHtml:function(e){return e.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function(e){var t=e.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0}),o=Object.assign({},wooccm_field.args);return Object.assign(o,t)}});var a=Backbone.Model.extend({defaults:Object.create(wooccm_field.args)}),i=Backbone.View.extend({initialize:function(t){var o=e(t.target).closest("[data-field_id]").data("field_id"),n=new a;n.set({id:o}),new l({model:n}).render()}}),l=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(e,t){e.setElement(this.$(t)).render()},updateModel:function(e){e&&e.preventDefault();var t=this.$el.find("#wooccm_modal").find("form"),o=_.getFormData(t);this.model.set(o)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(t){t.preventDefault(),this.undelegateEvents(),e(document).off("focusin"),e("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(t)},enableSave:function(t){e(".media-modal-submit").prop("disabled",!1),this.updateModel(t)},disableSave:function(t){e(".media-modal-submit").prop("disabled",!0)},tab:function(t){t.preventDefault();var o=this.$el.find("#wooccm_modal"),n=e(t.currentTarget),a=o.find("ul.wc-tabs"),i=n.find("a").attr("href").replace("#","");a.find(".active").removeClass("active"),n.addClass("active"),this.model.attributes.panel=i,this.model.changed.panel=i,this.renderPanels(t)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new c({model:this.model}),this.panels=new d({model:this.model}),this.info=new s({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(t){e("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){n()}),100)},load:function(){var t=this;null!=t.model.attributes.id?e.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(){n()},error:function(){alert("Error!")},success:function(e){console.log("response",e),e.success?(t.model.set(e.data),t.render()):alert(e.data)}}):t.render()},edit:function(n){n.preventDefault();var a=this,i=e(n.target),l=parseInt(e(".wc_gateways tr[data-field_id]").length),c=parseInt(a.model.get("order"));o++,t&&clearTimeout(t),t=setTimeout((function(){c=i.hasClass("media-modal-next")?Math.min(c+o,l):Math.max(c-o,1),a.model.set({id:parseInt(e(".wc_gateways tr[data-field_order="+c+"]").data("field_id"))}),o=0,a.load()}),300)},submit:function(t){t.preventDefault();var o=this,n=o.$el.find("#wooccm_modal"),a=n.find(".settings-save-status .spinner"),i=n.find(".settings-save-status .saved");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(o.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){e(".media-modal-submit").prop("disabled",!0),a.addClass("is-active")},complete:function(){i.addClass("is-active"),a.removeClass("is-active"),_.delay((function(){i.removeClass("is-active")}),1e3)},error:function(e){alert("Error!")},success:function(e){e.success?null==o.model.attributes.id&&(n.addClass("reload"),o.reload(t),o.close(t)):alert(e.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(t){t.preventDefault();var o=this,n=o.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(t),e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:o.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){o.disableSave(),n.addClass("save-waiting")},complete:function(){n.addClass("save-complete"),n.removeClass("save-waiting"),o.enableSave()},error:function(){alert("Error!")},success:function(e){e.success?(o.model.attributes.parent=e.data,o.model.changed.parent=e.data,o.renderInfo()):alert(e.data)}}),!1}}),c=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))}}),d=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")}}),s=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")}});e("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new i(e)})),e("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(t){t.preventDefault();e(t.target);return!!confirm(wooccm_field.message.reset)&&(e.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(e){e.success?location.reload():alert(e.data)}}),!1)})),e(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new i(e)})),e(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(t){t.preventDefault();var o=e(t.target).closest("[data-field_id]"),n=o.data("field_id");return!!confirm(wooccm_field.message.remove)&&(e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:n},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(e){e.success?o.remove():alert(e.data)}}),!1)})),e(document).on("click",".wooccm-field-toggle-attribute",(function(t){t.preventDefault();var o=e(this),n=o.closest("tr"),a=o.find(".woocommerce-input-toggle");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:e(this).data("field_attr"),field_id:n.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){a.addClass("woocommerce-input-toggle--loading")},success:function(e){!0===e.data?(a.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),a.addClass("woocommerce-input-toggle--enabled"),a.removeClass("woocommerce-input-toggle--loading")):!0!==e.data&&(a.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),a.addClass("woocommerce-input-toggle--disabled"),a.removeClass("woocommerce-input-toggle--loading"))}}),!1})),e(document).on("change",".wooccm-field-change-attribute",(function(t){t.preventDefault();var o=e(this),n=o.closest("tr");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:o.data("field_attr"),field_value:o.val(),field_id:n.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){o.prop("disabled",!0)},success:function(e){console.log(e.data)},complete:function(e){o.prop("disabled",!1)}}),!1}))}(jQuery)},function(e,t){!function(){e.exports=this.jQuery}()},function(e,t){!function(){e.exports=this.wp.util}()},function(e,t){!function(){e.exports=this.window.Backbone}()},function(e,t){!function(){e.exports=this.window.uiDatepicker}()}]);
assets/backend/js/admin.asset.php CHANGED
@@ -1,5 +1 @@
1
- <?php return array(
2
- 'dependencies' => array( 'jquery', 'jquery-serializejson' ),
3
- 'version' => 'f389cc2bea7176abd765911bfcb7c116',
4
- );
5
-
1
+ <?php return array('dependencies' => array('jquery', 'jquery-serializejson'), 'version' => 'f389cc2bea7176abd765911bfcb7c116');
 
 
 
 
assets/frontend/css/checkout.css CHANGED
@@ -1 +1 @@
1
- .woocommerce form .wooccm-clearfix:before,.woocommerce form .wooccm-clearfix:after{content:"";display:table}.woocommerce form .wooccm-clearfix:after{clear:both}.woocommerce form .wooccm-conditional-child{display:none}.woocommerce form .wooccm-type-hidden{display:none}.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label{display:inline-block}.woocommerce form .wooccm-colorpicker-iris .iris-picker{display:none}.woocommerce form .wooccm-colorpicker-iris.active .iris-picker{display:block}.button.fileinput-button{position:relative;overflow:hidden !important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:"alpha(opacity=0)";font-size:200px;direction:ltr;cursor:pointer}.wooccm-file-list{margin:0 -5px;padding:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:start}.wooccm-file-list .wooccm-file-file{display:flex;justify-content:center;align-items:stretch;box-sizing:border-box;padding:10px 5px 0 5px;width:25%;position:relative}.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete{z-index:1;position:absolute;top:2px;right:-3px;width:16px;height:16px;background-color:#222;display:block;line-height:16px;text-align:center;color:#fefefe;font-weight:900;border-radius:50%;font-size:12px;cursor:pointer;font-family:code;text-decoration:none !important}.wooccm-file-list .wooccm-file-file .wooccm-file-list-container{width:100%;overflow:hidden}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container{display:flex;justify-content:center;align-items:center;overflow:hidden;width:100%;padding-top:100%;position:relative;background:#eee}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img{overflow:hidden;object-fit:cover;position:absolute;top:30%;bottom:auto;height:40%;opacity:0.8}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img.image{top:0;bottom:0;left:0;right:0;max-height:100%;max-height:100%;height:100%;width:100%}.wooccm-file-list .ui-timepicker-table a{word-break:normal}.wooccm-file-list .ui-state-disabled,.wooccm-file-list .ui-widget-content .ui-state-disabled,.wooccm-file-list .ui-widget-header .ui-state-disabled{width:100%}
1
+ .woocommerce form .wooccm-clearfix:before,.woocommerce form .wooccm-clearfix:after{content:"";display:table}.woocommerce form .wooccm-clearfix:after{clear:both}.woocommerce form .wooccm-conditional-child{display:none}.woocommerce form .wooccm-type-hidden{display:none}.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label{display:inline-block}.woocommerce form .wooccm-colorpicker-iris .iris-picker{display:none}.woocommerce form .wooccm-colorpicker-iris.active .iris-picker{display:block}.button.fileinput-button{position:relative;overflow:hidden !important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:"alpha(opacity=0)";font-size:200px;direction:ltr;cursor:pointer}.wooccm-file-list{margin:0 -5px;padding:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:start}.wooccm-file-list .wooccm-file-file{display:flex;justify-content:center;align-items:stretch;box-sizing:border-box;padding:10px 5px 0 5px;width:25%;position:relative}.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete{z-index:1;position:absolute;top:2px;right:-3px;width:16px;height:16px;background-color:#222;display:block;line-height:16px;text-align:center;color:#fefefe;font-weight:900;border-radius:50%;font-size:12px;cursor:pointer;font-family:code;text-decoration:none !important}.wooccm-file-list .wooccm-file-file .wooccm-file-list-container{width:100%;overflow:hidden}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container{display:flex;justify-content:center;align-items:center;overflow:hidden;width:100%;padding-top:100%;position:relative;background:#eee}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img{overflow:hidden;object-fit:cover;position:absolute;top:30%;bottom:auto;height:40%;opacity:0.8}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img.image{top:0;bottom:0;left:0;right:0;max-height:100%;max-height:100%;height:100%;width:100%}.wooccm-file-list .ui-timepicker-table a{word-break:normal}.wooccm-file-list .ui-state-disabled,.wooccm-file-list .ui-widget-content .ui-state-disabled,.wooccm-file-list .ui-widget-header .ui-state-disabled{width:100%}
assets/frontend/js/checkout.asset.php CHANGED
@@ -1,5 +1 @@
1
- <?php return array(
2
- 'dependencies' => array( 'jquery', 'selectWoo' ),
3
- 'version' => 'acb3437adce2bd11ff9c4881456b2708',
4
- );
5
-
1
+ <?php return array('dependencies' => array('jquery', 'selectWoo'), 'version' => 'acb3437adce2bd11ff9c4881456b2708');
 
 
 
 
assets/frontend/js/order-upload.asset.php CHANGED
@@ -1,5 +1 @@
1
- <?php return array(
2
- 'dependencies' => array( 'jquery' ),
3
- 'version' => '21579d17fba223671216029a4af5bd89',
4
- );
5
-
1
+ <?php return array('dependencies' => array('jquery'), 'version' => '21579d17fba223671216029a4af5bd89');
 
 
 
 
includes/view/backend/pages/modals/parts/info.php CHANGED
@@ -44,6 +44,7 @@
44
  <# } #>
45
  <# if ( data.parent !=undefined && _.contains(<?php echo json_encode( $option ); ?>, data.parent.type) && _.isObject(data.parent.options)) { #>
46
  <select class="wooccm-enhanced-select" name="conditional_parent_value">
 
47
  <# _.each(data.parent.options, function (option, index) { #>
48
  <option <# if ( option.label==data.conditional_parent_value ) { #>selected="selected"<# } #> value="{{option.label}}">{{option.label}}</option>
49
  <# }); #>
44
  <# } #>
45
  <# if ( data.parent !=undefined && _.contains(<?php echo json_encode( $option ); ?>, data.parent.type) && _.isObject(data.parent.options)) { #>
46
  <select class="wooccm-enhanced-select" name="conditional_parent_value">
47
+ <option value=""><?php esc_html_e( 'None', 'woocommerce-checkout-manager' ); ?></option>
48
  <# _.each(data.parent.options, function (option, index) { #>
49
  <option <# if ( option.label==data.conditional_parent_value ) { #>selected="selected"<# } #> value="{{option.label}}">{{option.label}}</option>
50
  <# }); #>
includes/view/frontend/class-wooccm-fields-disable.php CHANGED
@@ -1,222 +1,210 @@
1
  <?php
2
 
3
- class WOOCCM_Fields_Display
4
- {
5
-
6
- protected static $_instance;
7
-
8
- public function __construct()
9
- {
10
- // Remove by product
11
- add_filter('wooccm_checkout_field_filter', array($this, 'disable_by_product'));
12
- // Remove by category
13
- add_filter('wooccm_checkout_field_filter', array($this, 'disable_by_category'));
14
- // Remove by role
15
- add_filter('wooccm_checkout_field_filter', array($this, 'disable_by_role'));
16
- // Fix country
17
- add_filter('wooccm_checkout_field_filter', array($this, 'fix_country'));
18
- // Fix email
19
- // make sure guest users include their email in order to download products
20
- add_filter('wooccm_checkout_field_filter', array($this, 'fix_email'));
21
- }
22
-
23
- public static function instance()
24
- {
25
- if (is_null(self::$_instance)) {
26
- self::$_instance = new self();
27
- }
28
- return self::$_instance;
29
- }
30
-
31
- function fix_country($field)
32
- {
33
-
34
- if ($field['type'] == 'country' && $field['disabled'] == true) {
35
- $field['disabled'] = false;
36
- $field['required'] = false;
37
- $field['type'] = 'hidden';
38
- //$field['class'] = array('hidden');
39
- }
40
-
41
- return $field;
42
- }
43
-
44
- function fix_email($field)
45
- {
46
-
47
- if ($field['type'] == 'email' && !is_user_logged_in()) {
48
- $field['disabled'] = false;
49
- $field['required'] = true;
50
- }
51
-
52
- return $field;
53
- }
54
-
55
- function disable_by_role($field)
56
- {
57
-
58
- global $current_user;
59
-
60
- $user_roles = (array) $current_user->roles;
61
-
62
- if (!empty($field['hide_role'])) {
63
-
64
- if (array_intersect($user_roles, $field['hide_role'])) {
65
- $field['disabled'] = true;
66
- } else {
67
- $field['disabled'] = false;
68
- }
69
- }
70
-
71
- if (!empty($field['show_role'])) {
72
-
73
- if (!array_intersect($user_roles, $field['show_role'])) {
74
- $field['disabled'] = true;
75
- } else {
76
- $field['disabled'] = false;
77
- }
78
- }
79
-
80
- return $field;
81
- }
82
-
83
- function disable_by_category($field)
84
- {
85
-
86
- if (empty($field['disabled']) && (!empty($field['hide_product_cat']) || !empty($field['show_product_cat']))) {
87
-
88
- if (count($cart_contents = WC()->cart->get_cart_contents())) {
89
-
90
- $hide_cats_array = (array) $field['hide_product_cat'];
91
-
92
- $show_cats_array = (array) $field['show_product_cat'];
93
-
94
- $more_product = empty($field['more_product']);
95
-
96
- $product_cats = array();
97
-
98
- foreach ($cart_contents as $key => $values) {
99
- if ($cats = wp_get_post_terms($values['product_id'], 'product_cat', array('fields' => 'ids'))) {
100
- $product_cats = array_merge($product_cats, $cats);
101
- }
102
- }
103
-
104
- // field without more
105
- // -------------------------------------------------------------------
106
- if ($more_product && count($cart_contents) < 2) {
107
- // hide field
108
- // -----------------------------------------------------------------
109
- if (count($hide_cats_array)) {
110
- if (array_intersect($product_cats, $hide_cats_array)) {
111
- $field['disabled'] = true;
112
- }
113
- }
114
-
115
- // show field
116
- // -----------------------------------------------------------------
117
- if (count($show_cats_array)) {
118
- if (!array_intersect($product_cats, $show_cats_array)) {
119
- $field['disabled'] = true;
120
- } else {
121
- $field['disabled'] = false;
122
- }
123
- }
124
- }
125
-
126
- // field with more
127
- // -------------------------------------------------------------------
128
- if (!$more_product) {
129
-
130
- // hide field
131
- // -------------------------------------------------------------
132
- if (count($hide_cats_array)) {
133
- if (array_intersect($product_cats, $hide_cats_array)) {
134
- $field['disabled'] = true;
135
- }
136
- }
137
-
138
- // show field
139
- // ---------------------------------------------------------------
140
- if (count($show_cats_array)) {
141
-
142
- if (!array_intersect($product_cats, $show_cats_array)) {
143
- $field['disabled'] = true;
144
- } else {
145
- $field['disabled'] = false;
146
- }
147
- }
148
- }
149
- }
150
- }
151
-
152
- return $field;
153
- }
154
-
155
- function disable_by_product($field)
156
- {
157
-
158
- if (empty($field['disabled']) && (!empty($field['hide_product']) || !empty($field['show_product']))) {
159
-
160
- if (count($cart_contents = WC()->cart->get_cart_contents())) {
161
-
162
- $hide_ids_array = (array) $field['hide_product'];
163
-
164
- $show_ids_array = (array) $field['show_product'];
165
-
166
- $more_product = empty($field['more_product']);
167
-
168
- $product_ids = array_column($cart_contents, 'product_id');
169
-
170
- // field without more
171
- // -------------------------------------------------------------------
172
- if ($more_product && count($cart_contents) < 2) {
173
- // hide field
174
- // -----------------------------------------------------------------
175
- if (count($hide_ids_array)) {
176
- if (array_intersect($product_ids, $hide_ids_array)) {
177
- $field['disabled'] = true;
178
- }
179
- }
180
-
181
- // show field
182
- // -----------------------------------------------------------------
183
- if (count($show_ids_array)) {
184
- if (!array_intersect($product_ids, $show_ids_array)) {
185
- $field['disabled'] = true;
186
- } else {
187
- $field['disabled'] = false;
188
- }
189
- }
190
- }
191
-
192
- // field with more
193
- // -------------------------------------------------------------------
194
- if (!$more_product) {
195
-
196
- // hide field
197
- // -------------------------------------------------------------
198
- if (count($hide_ids_array)) {
199
-
200
- if (array_intersect($product_ids, $hide_ids_array)) {
201
- $field['disabled'] = true;
202
- }
203
- }
204
-
205
- // show field
206
- // ---------------------------------------------------------------
207
- if (count($show_ids_array)) {
208
- if (!array_intersect($product_ids, $show_ids_array)) {
209
- $field['disabled'] = true;
210
- } else {
211
- $field['disabled'] = false;
212
- }
213
- }
214
- }
215
- }
216
- }
217
-
218
- return $field;
219
- }
220
  }
221
 
222
  WOOCCM_Fields_Display::instance();
1
  <?php
2
 
3
+ class WOOCCM_Fields_Display {
4
+
5
+
6
+ protected static $_instance;
7
+
8
+ public function __construct() {
9
+ // Remove by product
10
+ add_filter( 'wooccm_checkout_field_filter', array( $this, 'disable_by_product' ) );
11
+ // Remove by category
12
+ add_filter( 'wooccm_checkout_field_filter', array( $this, 'disable_by_category' ) );
13
+ // Remove by role
14
+ add_filter( 'wooccm_checkout_field_filter', array( $this, 'disable_by_role' ) );
15
+ // Fix country
16
+ add_filter( 'wooccm_checkout_field_filter', array( $this, 'fix_country' ) );
17
+ // Fix email
18
+ // make sure guest users include their email in order to download products
19
+ add_filter( 'wooccm_checkout_field_filter', array( $this, 'fix_email' ) );
20
+ }
21
+
22
+ public static function instance() {
23
+ if ( is_null( self::$_instance ) ) {
24
+ self::$_instance = new self();
25
+ }
26
+ return self::$_instance;
27
+ }
28
+
29
+ function fix_country( $field ) {
30
+ if ( $field['type'] == 'country' && $field['disabled'] == true ) {
31
+ $field['disabled'] = false;
32
+ $field['required'] = false;
33
+ $field['type'] = 'hidden';
34
+ // $field['class'] = array('hidden');
35
+ }
36
+
37
+ return $field;
38
+ }
39
+
40
+ function fix_email( $field ) {
41
+ if ( $field['type'] == 'email' && ! is_user_logged_in() ) {
42
+ $field['disabled'] = false;
43
+ $field['required'] = true;
44
+ }
45
+
46
+ return $field;
47
+ }
48
+
49
+ function disable_by_role( $field ) {
50
+ global $current_user;
51
+
52
+ $user_roles = (array) $current_user->roles;
53
+
54
+ if ( ! empty( $field['hide_role'] ) ) {
55
+
56
+ if ( array_intersect( $user_roles, $field['hide_role'] ) ) {
57
+ $field['disabled'] = true;
58
+ } else {
59
+ $field['disabled'] = false;
60
+ }
61
+ }
62
+
63
+ if ( ! empty( $field['show_role'] ) ) {
64
+
65
+ if ( ! array_intersect( $user_roles, $field['show_role'] ) ) {
66
+ $field['disabled'] = true;
67
+ } else {
68
+ $field['disabled'] = false;
69
+ }
70
+ }
71
+
72
+ return $field;
73
+ }
74
+
75
+ function disable_by_category( $field ) {
76
+ if ( empty( $field['disabled'] ) && ( ! empty( $field['hide_product_cat'] ) || ! empty( $field['show_product_cat'] ) ) ) {
77
+
78
+ if ( is_object( WC()->cart ) && count( $cart_contents = WC()->cart->get_cart_contents() ) ) {
79
+
80
+ $hide_cats_array = (array) $field['hide_product_cat'];
81
+
82
+ $show_cats_array = (array) $field['show_product_cat'];
83
+
84
+ $more_product = empty( $field['more_product'] );
85
+
86
+ $product_cats = array();
87
+
88
+ foreach ( $cart_contents as $key => $values ) {
89
+ if ( $cats = wp_get_post_terms( $values['product_id'], 'product_cat', array( 'fields' => 'ids' ) ) ) {
90
+ $product_cats = array_merge( $product_cats, $cats );
91
+ }
92
+ }
93
+
94
+ // field without more
95
+ // -------------------------------------------------------------------
96
+ if ( $more_product && count( $cart_contents ) < 2 ) {
97
+ // hide field
98
+ // -----------------------------------------------------------------
99
+ if ( count( $hide_cats_array ) ) {
100
+ if ( array_intersect( $product_cats, $hide_cats_array ) ) {
101
+ $field['disabled'] = true;
102
+ }
103
+ }
104
+
105
+ // show field
106
+ // -----------------------------------------------------------------
107
+ if ( count( $show_cats_array ) ) {
108
+ if ( ! array_intersect( $product_cats, $show_cats_array ) ) {
109
+ $field['disabled'] = true;
110
+ } else {
111
+ $field['disabled'] = false;
112
+ }
113
+ }
114
+ }
115
+
116
+ // field with more
117
+ // -------------------------------------------------------------------
118
+ if ( ! $more_product ) {
119
+
120
+ // hide field
121
+ // -------------------------------------------------------------
122
+ if ( count( $hide_cats_array ) ) {
123
+ if ( array_intersect( $product_cats, $hide_cats_array ) ) {
124
+ $field['disabled'] = true;
125
+ }
126
+ }
127
+
128
+ // show field
129
+ // ---------------------------------------------------------------
130
+ if ( count( $show_cats_array ) ) {
131
+
132
+ if ( ! array_intersect( $product_cats, $show_cats_array ) ) {
133
+ $field['disabled'] = true;
134
+ } else {
135
+ $field['disabled'] = false;
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+
142
+ return $field;
143
+ }
144
+
145
+ function disable_by_product( $field ) {
146
+ if ( empty( $field['disabled'] ) && ( ! empty( $field['hide_product'] ) || ! empty( $field['show_product'] ) ) ) {
147
+
148
+ if ( is_object( WC()->cart ) && count( $cart_contents = WC()->cart->get_cart_contents() ) ) {
149
+
150
+ $hide_ids_array = (array) $field['hide_product'];
151
+
152
+ $show_ids_array = (array) $field['show_product'];
153
+
154
+ $more_product = empty( $field['more_product'] );
155
+
156
+ $product_ids = array_column( $cart_contents, 'product_id' );
157
+
158
+ // field without more
159
+ // -------------------------------------------------------------------
160
+ if ( $more_product && count( $cart_contents ) < 2 ) {
161
+ // hide field
162
+ // -----------------------------------------------------------------
163
+ if ( count( $hide_ids_array ) ) {
164
+ if ( array_intersect( $product_ids, $hide_ids_array ) ) {
165
+ $field['disabled'] = true;
166
+ }
167
+ }
168
+
169
+ // show field
170
+ // -----------------------------------------------------------------
171
+ if ( count( $show_ids_array ) ) {
172
+ if ( ! array_intersect( $product_ids, $show_ids_array ) ) {
173
+ $field['disabled'] = true;
174
+ } else {
175
+ $field['disabled'] = false;
176
+ }
177
+ }
178
+ }
179
+
180
+ // field with more
181
+ // -------------------------------------------------------------------
182
+ if ( ! $more_product ) {
183
+
184
+ // hide field
185
+ // -------------------------------------------------------------
186
+ if ( count( $hide_ids_array ) ) {
187
+
188
+ if ( array_intersect( $product_ids, $hide_ids_array ) ) {
189
+ $field['disabled'] = true;
190
+ }
191
+ }
192
+
193
+ // show field
194
+ // ---------------------------------------------------------------
195
+ if ( count( $show_ids_array ) ) {
196
+ if ( ! array_intersect( $product_ids, $show_ids_array ) ) {
197
+ $field['disabled'] = true;
198
+ } else {
199
+ $field['disabled'] = false;
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+ return $field;
207
+ }
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
209
 
210
  WOOCCM_Fields_Display::instance();
readme.txt CHANGED
@@ -5,9 +5,9 @@ Tags: checkout field editor, woocommerce checkout field editor, checkout manager
5
  Requires at least: 4.9
6
  Tested up to: 6.0.1
7
  Requires PHP: 5.6
8
- Stable tag: 6.0.2
9
  WC requires at least: 3.1.0
10
- WC tested up to: 6.6
11
  License: GPLv3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -17,7 +17,7 @@ Checkout Field Manager (Checkout Manager) for WooCommerce is the best pluginn mo
17
 
18
  [Premium](https://quadlayers.com/portfolio/woocommerce-checkout-manager/) | [Demo](https://quadlayers.com/woocommerce-checkout-manager/checkout/?add-to-cart=32) | [Documentation](https://quadlayers.com/documentation/woocommerce-checkout-manager/) | [Community](https://www.facebook.com/groups/quadlayers/)
19
 
20
- WooCommerce Checkout Manager is a plugin built to be the wizard of checkout pages. Helps to modify in an intuitive way, allows fields customization, to extend billing information and to create any field required at WooCommerce checkout.
21
 
22
  == Description ==
23
 
@@ -96,6 +96,8 @@ The premium version of Checkout Field Manager (Checkout Manager) plugin offer yo
96
  > * Display/Hide checkbox fields in account, checkout, orders, emails or invoices
97
  > * Add price to the checkout total based in checkout field value
98
  > * Display checkout fields in orders admin table list and allow sort and filter
 
 
99
 
100
  == Frequently Asked Questions ==
101
 
@@ -147,8 +149,17 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
 
 
 
 
150
  = 6.0.2 =
151
- * Fix: Values changed to keys in select, multiselect, checkbox, multicheckbox, radio,
152
 
153
  = 6.0.1 =
154
  * Fix: Default show aditional checkout fields in order
5
  Requires at least: 4.9
6
  Tested up to: 6.0.1
7
  Requires PHP: 5.6
8
+ Stable tag: 6.0.5
9
  WC requires at least: 3.1.0
10
+ WC tested up to: 6.6.1
11
  License: GPLv3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
17
 
18
  [Premium](https://quadlayers.com/portfolio/woocommerce-checkout-manager/) | [Demo](https://quadlayers.com/woocommerce-checkout-manager/checkout/?add-to-cart=32) | [Documentation](https://quadlayers.com/documentation/woocommerce-checkout-manager/) | [Community](https://www.facebook.com/groups/quadlayers/)
19
 
20
+ WooCommerce Checkout Manager is the best checkout form customizer and editor for WooCommerce. This plugin allows you to delete, change and re-order the WooCommerce checkout fields and create more than 20 custom fields inside the billing or shipping checkout forms.
21
 
22
  == Description ==
23
 
96
  > * Display/Hide checkbox fields in account, checkout, orders, emails or invoices
97
  > * Add price to the checkout total based in checkout field value
98
  > * Display checkout fields in orders admin table list and allow sort and filter
99
+ > * Woocommerce Cart and Checkout on same page
100
+ > * Woocommerce Upload File
101
 
102
  == Frequently Asked Questions ==
103
 
149
 
150
  == Changelog ==
151
 
152
+ = 6.0.5 =
153
+ * Fix: WooCommerce compatibility
154
+
155
+ = 6.0.4 =
156
+ * Fix: First choice in checkout select conditional fields
157
+
158
+ = 6.0.3 =
159
+ * Fix: Fix Call to a member function get_cart_contents() on null
160
+
161
  = 6.0.2 =
162
+ * Fix: Values changed to keys in select, multiselect, checkbox, multicheckbox, radio
163
 
164
  = 6.0.1 =
165
  * Fix: Default show aditional checkout fields in order
woocommerce-checkout-manager.php CHANGED
@@ -4,13 +4,13 @@
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.0.2
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: 6.6
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  die( '-1' );
@@ -20,7 +20,7 @@ if ( ! defined( 'WOOCCM_PLUGIN_NAME' ) ) {
20
  define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
21
  }
22
  if ( ! defined( 'WOOCCM_PLUGIN_VERSION' ) ) {
23
- define( 'WOOCCM_PLUGIN_VERSION', '6.0.2' );
24
  }
25
  if ( ! defined( 'WOOCCM_PLUGIN_FILE' ) ) {
26
  define( 'WOOCCM_PLUGIN_FILE', __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.0.5
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: 6.6.1
14
  */
15
  if ( ! defined( 'ABSPATH' ) ) {
16
  die( '-1' );
20
  define( 'WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce' );
21
  }
22
  if ( ! defined( 'WOOCCM_PLUGIN_VERSION' ) ) {
23
+ define( 'WOOCCM_PLUGIN_VERSION', '6.0.5' );
24
  }
25
  if ( ! defined( 'WOOCCM_PLUGIN_FILE' ) ) {
26
  define( 'WOOCCM_PLUGIN_FILE', __FILE__ );