WooCommerce Checkout Manager - Version 4.5.0

Version Description

  • Improvement: new woocommerce checkout billing fields admin panel
  • Improvement: new woocommerce checkout shipping fields admin panel
  • Improvement: new woocommerce checkout additional fields admin panel
  • Fix: woocommerce checkout conditional fields
Download this release

Release Info

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

Code changes from version 4.4.9 to 4.5.0

Files changed (81) hide show
  1. assets/css/wooccm-admin.css +95 -1
  2. assets/css/wooccm-admin.css.map +1 -1
  3. assets/css/wooccm.css +3 -6
  4. assets/css/wooccm.css.map +1 -1
  5. assets/js/wooccm-admin.js +70 -4
  6. assets/js/wooccm-admin.min.js +1 -1
  7. assets/js/wooccm-checkout.js +50 -45
  8. assets/js/wooccm-checkout.min.js +1 -1
  9. assets/js/wooccm-modal.js +141 -41
  10. assets/js/wooccm-modal.min.js +1 -1
  11. assets/js/wooccm-order-upload.js +12 -9
  12. assets/js/wooccm-order-upload.min.js +1 -1
  13. assets/less/wooccm-admin.less +109 -1
  14. assets/less/wooccm.less +13 -9
  15. includes/admin.php +29 -22
  16. includes/formatting.php +3 -3
  17. includes/templates/admin/clean/woocheckout-billing-clone.php +159 -0
  18. includes/templates/admin/clean/woocheckout-billing-tbody.php +273 -0
  19. includes/templates/admin/clean/woocheckout-billing-thead.php +131 -0
  20. includes/templates/admin/woocheckout-additional-clone.php +74 -73
  21. includes/templates/admin/woocheckout-additional-tbody.php +4 -4
  22. includes/templates/admin/woocheckout-additional-thead.php +2 -2
  23. includes/templates/admin/woocheckout-additional.php +2 -1
  24. includes/templates/admin/woocheckout-billing-clone.php +5 -4
  25. includes/templates/admin/woocheckout-billing-tbody.php +4 -5
  26. includes/templates/admin/woocheckout-billing-thead.php +2 -3
  27. includes/templates/admin/woocheckout-billing.php +4 -4
  28. includes/templates/admin/woocheckout-shipping-clone.php +4 -4
  29. includes/templates/admin/woocheckout-shipping-tbody.php +4 -4
  30. includes/templates/admin/woocheckout-shipping-thead.php +2 -2
  31. includes/templates/admin/woocheckout-shipping.php +4 -13
  32. includes/templates/functions/required/add_required.php +0 -2
  33. new/class-wooccm-admin.php +122 -0
  34. new/class-wooccm-install.php +19 -0
  35. new/class-wooccm-notices.php +100 -0
  36. new/class-wooccm.php +92 -0
  37. new/controller/checkout.php +107 -0
  38. new/controller/class-field-controller.php +383 -0
  39. new/{orders.php → controller/order.php} +123 -210
  40. new/{checkout.php → controller/upload.php} +11 -66
  41. new/fields_init.php +0 -354
  42. new/install.php +0 -2
  43. new/model/class-wooccm-field-additional.php +17 -0
  44. new/model/class-wooccm-field-billing.php +29 -0
  45. new/model/class-wooccm-field-old.php +540 -0
  46. new/model/class-wooccm-field-shipping.php +27 -0
  47. new/model/class-wooccm-field.php +145 -0
  48. new/view/backend/meta-boxes/html-order-uploads.php +61 -0
  49. new/view/backend/order.php +66 -0
  50. new/view/backend/pages/additional.php +11 -0
  51. new/view/backend/pages/advanced.php +29 -0
  52. new/view/backend/pages/billing.php +11 -0
  53. new/view/backend/pages/general.php +133 -0
  54. new/view/backend/pages/modals/edit.php +55 -0
  55. new/view/backend/pages/modals/parts/edit-info.php +45 -0
  56. new/view/backend/pages/modals/parts/edit-info_1.php +77 -0
  57. new/view/backend/pages/modals/parts/edit-tabs.php +30 -0
  58. new/view/backend/pages/modals/parts/panel-advanced.php +19 -0
  59. new/view/backend/pages/modals/parts/panel-amount.php +38 -0
  60. new/view/backend/pages/modals/parts/panel-conditional.php +24 -0
  61. new/view/backend/pages/modals/parts/panel-datepicker.php +50 -0
  62. new/view/backend/pages/modals/parts/panel-display.php +74 -0
  63. new/view/backend/pages/modals/parts/panel-general.php +71 -0
  64. new/view/backend/pages/modals/parts/panel-suggestions.php +63 -0
  65. new/view/backend/pages/modals/parts/panel-timepicker.php +20 -0
  66. new/view/backend/pages/orders.php +8 -0
  67. new/view/backend/pages/parts/actions.php +7 -0
  68. new/view/backend/pages/parts/header.php +23 -0
  69. new/view/backend/pages/parts/loop.php +130 -0
  70. new/view/backend/pages/shipping.php +11 -0
  71. new/view/frontend/checkout.php +105 -0
  72. new/{fields_additional.php → view/frontend/fields/additional.php} +1 -1
  73. new/{fields_conditional.php → view/frontend/fields/conditional.php} +0 -0
  74. new/{fields_display.php → view/frontend/fields/display.php} +0 -0
  75. new/{fields_filters.php → view/frontend/fields/filters.php} +0 -0
  76. new/{fields_handler.php → view/frontend/fields/handler.php} +0 -0
  77. new/{fields_register.php → view/frontend/fields/register.php} +7 -3
  78. new/view/frontend/order.php +66 -0
  79. readme.txt +7 -1
  80. templates/order/order-uploads.php +1 -1
  81. woocommerce-checkout-manager.php +13 -438
assets/css/wooccm-admin.css CHANGED
@@ -1,5 +1,8 @@
 
 
 
1
  .woocommerce_options_panel .select2-container {
2
- width: 80%!important;
3
  line-height: 16px;
4
  }
5
  .woocommerce_options_panel .select2-container .select2-selection--multiple {
@@ -15,4 +18,95 @@
15
  box-shadow: 0 0 2px rgba(30, 140, 190, 0.8) !important;
16
  outline: 2px solid transparent!important;
17
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  /*# sourceMappingURL=wooccm-admin.css.map */
1
+ .woocommerce_options_panel .woocommerce-help-tip {
2
+ margin: 0 0 0 0.5em;
3
+ }
4
  .woocommerce_options_panel .select2-container {
5
+ width: 50%!important;
6
  line-height: 16px;
7
  }
8
  .woocommerce_options_panel .select2-container .select2-selection--multiple {
18
  box-shadow: 0 0 2px rgba(30, 140, 190, 0.8) !important;
19
  outline: 2px solid transparent!important;
20
  }
21
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] .marketplace-suggestion-container,
22
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-footer] .marketplace-suggestion-container,
23
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-header] .marketplace-suggestion-container {
24
+ padding: 1em 1.5em;
25
+ }
26
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container img.marketplace-suggestion-icon {
27
+ height: 40px;
28
+ margin: 0;
29
+ margin-right: 1.5em;
30
+ -webkit-box-flex: 0;
31
+ -webkit-flex: 0 0 40px;
32
+ flex: 0 0 40px;
33
+ }
34
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-cta {
35
+ -webkit-box-flex: 1;
36
+ -webkit-flex: 1 1 30%;
37
+ flex: 1 1 30%;
38
+ min-width: 160px;
39
+ text-align: right;
40
+ }
41
+ a.suggestion-dismiss::before {
42
+ font-family: Dashicons;
43
+ speak: none;
44
+ font-weight: 400;
45
+ font-variant: normal;
46
+ text-transform: none;
47
+ line-height: 1;
48
+ -webkit-font-smoothing: antialiased;
49
+ content: "";
50
+ text-decoration: none;
51
+ font-size: 1.5em;
52
+ }
53
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] .marketplace-suggestion-container .marketplace-suggestion-container-cta a.button {
54
+ display: inline-block;
55
+ min-width: 120px;
56
+ text-align: center;
57
+ margin: 0;
58
+ }
59
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] {
60
+ border: none;
61
+ border-top: 1px solid #eee;
62
+ border-bottom: 1px solid #eee;
63
+ }
64
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-cta .suggestion-dismiss {
65
+ text-decoration: none;
66
+ position: relative;
67
+ top: 5px;
68
+ right: auto;
69
+ margin-left: 1em;
70
+ }
71
+ a.suggestion-dismiss {
72
+ border: none;
73
+ box-shadow: none;
74
+ color: #ddd;
75
+ }
76
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container {
77
+ -webkit-box-align: start;
78
+ -webkit-align-items: flex-start;
79
+ align-items: flex-start;
80
+ display: -webkit-box;
81
+ display: -webkit-flex;
82
+ display: flex;
83
+ -webkit-box-orient: vertical;
84
+ -webkit-box-direction: normal;
85
+ -webkit-flex-direction: column;
86
+ flex-direction: column;
87
+ position: relative;
88
+ }
89
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-content h4 {
90
+ margin: 0;
91
+ }
92
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] .marketplace-suggestion-container .marketplace-suggestion-container-content p {
93
+ padding: 0;
94
+ line-height: 1.5;
95
+ }
96
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-content p {
97
+ margin: 0;
98
+ margin-top: 4px;
99
+ color: #444;
100
+ }
101
+ @media screen and (min-width: 600px) {
102
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container {
103
+ -webkit-box-align: center;
104
+ -webkit-align-items: center;
105
+ align-items: center;
106
+ -webkit-box-orient: horizontal;
107
+ -webkit-box-direction: normal;
108
+ -webkit-flex-direction: row;
109
+ flex-direction: row;
110
+ }
111
+ }
112
  /*# sourceMappingURL=wooccm-admin.css.map */
assets/css/wooccm-admin.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../less/wooccm-admin.less"],"names":[],"mappings":"AAAA,0BACE;EACE,oBAAA;EACA,iBAAA;;AAHJ,0BACE,mBAKE;EACE,iBAAA;EACA,gBAAA;EACA,+CAAA;;AATN,0BAaE,4BAA4B,6BAA6B,6BAA6B;EACpF,mBAAA;;AAdJ,0BAgBE,4BAA2B,yBAA0B;EACnD,+BAAA;EACA,2CAAA;EACA,wCAAA","file":"wooccm-admin.css"}
1
+ {"version":3,"sources":["../less/wooccm-admin.less"],"names":[],"mappings":"AAAA,0BAEE;EACE,mBAAA;;AAHJ,0BAME;EACE,oBAAA;EACA,iBAAA;;AARJ,0BAME,mBAKE;EACE,iBAAA;EACA,gBAAA;EACA,+CAAA;;AAdN,0BAkBE,4BAA4B,6BAA6B,6BAA6B;EACpF,mBAAA;;AAnBJ,0BAqBE,4BAA2B,yBAA0B;EACnD,+BAAA;EACA,2CAAA;EACA,wCAAA;;AAIJ,kCAAkC,mBAAmB,iEAAkE;AAAmC,kCAAkC,mBAAmB,mEAAoE;AACnR,kCAAkC,mBAAmB,mEAAoE;EACvH,kBAAA;;AAGF,kCAAkC,mBAAoB,kCAAkC,IAAG;EACzF,YAAA;EACA,SAAA;EACA,mBAAA;EACA,mBAAA;EACA,sBAAA;EACA,cAAA;;AAGF,kCAAkC,mBAAoB,kCAAkC;EACtF,mBAAA;EACA,qBAAA;EACA,aAAA;EACA,gBAAA;EACA,iBAAA;;AAGF,CAAC,mBAAmB;EAClB,sBAAA;EACA,WAAA;EACA,gBAAA;EACA,oBAAA;EACA,oBAAA;EACA,cAAA;EACA,mCAAA;EACA,SAAS,GAAT;EACA,qBAAA;EACA,gBAAA;;AAGF,kCAAkC,mBAAmB,iEAAkE,kCAAkC,sCAAsC,EAAC;EAC9L,qBAAA;EACA,gBAAA;EACA,kBAAA;EACA,SAAA;;AAGF,kCAAkC,mBAAmB;EACnD,YAAA;EACA,0BAAA;EACA,6BAAA;;AAGF,kCAAkC,mBAAoB,kCAAkC,sCAAsC;EAC5H,qBAAA;EACA,kBAAA;EACA,QAAA;EACA,WAAA;EACA,gBAAA;;AAEF,CAAC;EACC,YAAA;EACA,gBAAA;EACA,WAAA;;AAGF,kCAAkC,mBAAoB;EACpD,wBAAA;EACA,+BAAA;EACA,uBAAA;EACA,oBAAA;EACA,qBAAA;EACA,aAAA;EACA,4BAAA;EACA,6BAAA;EACA,8BAAA;EACA,sBAAA;EACA,kBAAA;;AAGF,kCAAkC,mBAAoB,kCAAkC,0CAA0C;EAChI,SAAA;;AAGF,kCAAkC,mBAAmB,iEAAkE,kCAAkC,0CAA0C;EACjM,UAAA;EACA,gBAAA;;AAGF,kCAAkC,mBAAoB,kCAAkC,0CAA0C;EAChI,SAAA;EACA,eAAA;EACA,WAAA;;AAGF,mBAAqC;EAEnC,kCAAkC,mBAAoB;IACpD,yBAAA;IACA,2BAAA;IACA,mBAAA;IACA,8BAAA;IACA,6BAAA;IACA,2BAAA;IACA,mBAAA","file":"wooccm-admin.css"}
assets/css/wooccm.css CHANGED
@@ -1,12 +1,9 @@
1
- .wooccm-clearfix {
2
- float: none;
3
- }
4
- .wooccm-clearfix:before,
5
- .wooccm-clearfix:after {
6
  content: '';
7
  display: table;
8
  }
9
- .wooccm-clearfix:after {
10
  clear: both;
11
  }
12
  .button.fileinput-button {
1
+ .woocommerce form .form-row.wooccm-clearfix:before,
2
+ .woocommerce form .form-row.wooccm-clearfix:after {
 
 
 
3
  content: '';
4
  display: table;
5
  }
6
+ .woocommerce form .form-row.wooccm-clearfix:after {
7
  clear: both;
8
  }
9
  .button.fileinput-button {
assets/css/wooccm.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../less/wooccm.less"],"names":[],"mappings":"AAAA;EACE,WAAA;;AACA,gBAAC;AACC,gBAAC;EACD,SAAQ,EAAR;EACA,cAAA;;AAEF,gBAAC;EACC,WAAA;;AAMF,OAAC;EACC,kBAAA;EACA,0BAAA;;AAFF,OAAC,iBAIC;EACE,kBAAA;EACA,MAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;EACA,YAAW,kBAAX;EACA,gBAAA;EACA,cAAA;EACA,eAAA;;AAMN;EACE,cAAA;EACA,UAAA;EACA,aAAA;EACA,eAAA;EACA,mBAAA;EACA,sBAAA;;AANF,kBAQE;EACE,aAAA;EACA,uBAAA;EACA,oBAAA;EACA,sBAAA;EACA,uBAAA;EACA,UAAA;EAEA,kBAAA;;AAhBJ,kBAQE,mBAWE;EACE,UAAA;EACA,kBAAA;EACA,QAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,sBAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,eAAA;EACA,iBAAA;;AAnCN,kBAQE,mBA8BE;EACE,WAAA;EACA,gBAAA;;AAxCN,kBAQE,mBAmCE;EACE,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,gBAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;;AAnDN,kBAQE,mBAmCE,mCAUE;EACE,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,QAAA;EACA,YAAA;EACA,WAAA;EACA,YAAA;;AAEA,kBAtDN,mBAmCE,mCAUE,MASG;EACC,MAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EAEA,gBAAA;EACA,YAAA;EACA,WAAA","file":"wooccm.css"}
1
+ {"version":3,"sources":["../less/wooccm.less"],"names":[],"mappings":"AAKI,YALS,KAAK,UAEf,gBAGE;AACC,YANO,KAAK,UAEf,gBAII;EACD,SAAQ,EAAR;EACA,cAAA;;AAEF,YAVS,KAAK,UAEf,gBAQE;EACC,WAAA;;AAOJ,OAAC;EACC,kBAAA;EACA,0BAAA;;AAFF,OAAC,iBAIC;EACE,kBAAA;EACA,MAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;EACA,YAAW,kBAAX;EACA,gBAAA;EACA,cAAA;EACA,eAAA;;AAMN;EACE,cAAA;EACA,UAAA;EACA,aAAA;EACA,eAAA;EACA,mBAAA;EACA,sBAAA;;AANF,kBAQE;EACE,aAAA;EACA,uBAAA;EACA,oBAAA;EACA,sBAAA;EACA,uBAAA;EACA,UAAA;EAEA,kBAAA;;AAhBJ,kBAQE,mBAWE;EACE,UAAA;EACA,kBAAA;EACA,QAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,sBAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,eAAA;EACA,iBAAA;;AAnCN,kBAQE,mBA8BE;EACE,WAAA;EACA,gBAAA;;AAxCN,kBAQE,mBAmCE;EACE,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,gBAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;;AAnDN,kBAQE,mBAmCE,mCAUE;EACE,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,QAAA;EACA,YAAA;EACA,WAAA;EACA,YAAA;;AAEA,kBAtDN,mBAmCE,mCAUE,MASG;EACC,MAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EAEA,gBAAA;EACA,YAAA;EACA,WAAA","file":"wooccm.css"}
assets/js/wooccm-admin.js CHANGED
@@ -76,6 +76,36 @@
76
  };
77
  }
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  $(document).on('wooccm-enhanced-select', function (e) {
80
 
81
  $('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
@@ -127,6 +157,7 @@
127
  return {
128
  term: params.term,
129
  action: $(this).data('action') || 'wooccm_select_search_products',
 
130
  security: wc_enhanced_select_params.search_products_nonce,
131
  selected: $(this).select2('val') || 0,
132
  exclude: $(this).data('exclude'),
@@ -194,17 +225,19 @@
194
 
195
  });
196
 
197
- $(document).on('click', '.wooccm-field-toggle-enabled', function () {
 
198
 
199
  var $link = $(this),
200
  $tr = $link.closest('tr'),
201
  $toggle = $link.find('.woocommerce-input-toggle');
202
 
203
  $.ajax({
204
- url: woocommerce_admin.ajax_url,
205
  data: {
206
- action: 'wooccm_toggle_field_enabled',
207
- nonce: wooccm.nonce,
 
208
  field_id: $tr.data('field_id')
209
  },
210
  dataType: 'json',
@@ -226,7 +259,40 @@
226
  //window.location.href = $link.attr('href');
227
  //}
228
  }
 
229
  });
 
230
  return false;
231
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  })(jQuery);
76
  };
77
  }
78
 
79
+ $(document).on('wooccm-tab-panels', function (e, active) {
80
+
81
+ var $modal = $(e.target),
82
+ $tabs = $modal.find('ul.wc-tabs'),
83
+ $active = $tabs.find('a[href="' + active + '"]');
84
+
85
+ $tabs.show();
86
+
87
+ $tabs.find('a').click(function (e) {
88
+ e.preventDefault();
89
+
90
+ var panel_wrap = $(this).closest('div.panel-wrap');
91
+
92
+ $tabs.find('li', panel_wrap).removeClass('active');
93
+
94
+ $(this).parent().addClass('active');
95
+
96
+ $('div.panel', panel_wrap).hide();
97
+
98
+ $($(this).attr('href')).show();
99
+ });
100
+
101
+ if ($active.length && $($active.attr('href')).length) {
102
+ $active.click();
103
+ } else {
104
+ $tabs.find('li.active').find('a').click();
105
+ }
106
+
107
+ });
108
+
109
  $(document).on('wooccm-enhanced-select', function (e) {
110
 
111
  $('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
157
  return {
158
  term: params.term,
159
  action: $(this).data('action') || 'wooccm_select_search_products',
160
+ //nonce: wooccm_admin.nonce,
161
  security: wc_enhanced_select_params.search_products_nonce,
162
  selected: $(this).select2('val') || 0,
163
  exclude: $(this).data('exclude'),
225
 
226
  });
227
 
228
+ $(document).on('click', '.wooccm-field-toggle-attribute', function (e) {
229
+ e.preventDefault();
230
 
231
  var $link = $(this),
232
  $tr = $link.closest('tr'),
233
  $toggle = $link.find('.woocommerce-input-toggle');
234
 
235
  $.ajax({
236
+ url: wooccm_admin.ajax_url,
237
  data: {
238
+ action: 'wooccm_toggle_field_attribute',
239
+ nonce: wooccm_admin.nonce,
240
+ field_attr: $(this).data('field_attr'),
241
  field_id: $tr.data('field_id')
242
  },
243
  dataType: 'json',
259
  //window.location.href = $link.attr('href');
260
  //}
261
  }
262
+
263
  });
264
+
265
  return false;
266
  });
267
+
268
+ $(document).on('change', '.wooccm-field-change-attribute', function (e) {
269
+ e.preventDefault();
270
+
271
+ var $change = $(this),
272
+ $tr = $change.closest('tr');
273
+
274
+ $.ajax({
275
+ url: wooccm_admin.ajax_url,
276
+ data: {
277
+ action: 'wooccm_change_field_attribute',
278
+ nonce: wooccm_admin.nonce,
279
+ field_attr: $change.data('field_attr'),
280
+ field_value: $change.val(),
281
+ field_id: $tr.data('field_id'),
282
+ },
283
+ dataType: 'json',
284
+ type: 'POST',
285
+ beforeSend: function (response) {
286
+ $change.prop('disabled', true);
287
+ },
288
+ success: function (response) {
289
+ console.log(response.data);
290
+ },
291
+ complete: function (response) {
292
+ $change.prop('disabled', false);
293
+ },
294
+ });
295
+ return false;
296
+ });
297
+
298
  })(jQuery);
assets/js/wooccm-admin.min.js CHANGED
@@ -1 +1 @@
1
- (function(b){b.fn.serializeArrayAll=function(){var f={};var e=this.serializeArray();b.each(e,function(){if(f[this.name]!==undefined){if(!f[this.name].push){f[this.name]=[f[this.name]]}f[this.name].push(this.value||"")}else{f[this.name]=this.value||""}});var d=b("input[type=radio],input[type=checkbox]",this);b.each(d,function(){if(!f.hasOwnProperty(this.name)){f[this.name]=""}});return f};function c(f){var e=b(f).next().is(".hasDatepicker")?"minDate":"maxDate",g="minDate"===e?b(f).next():b(f).prev(),d=b(f).datepicker("getDate");b(g).datepicker("option",e,d);b(f).change()}function a(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(d){var e=d.input.length-d.maximum;if(1===e){return wc_enhanced_select_params.i18n_input_too_long_1}return wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",e)},inputTooShort:function(d){var e=d.minimum-d.input.length;if(1===e){return wc_enhanced_select_params.i18n_input_too_short_1}return wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",e)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(d){if(d.maximum===1){return wc_enhanced_select_params.i18n_selection_too_long_1}return wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",d.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each(function(){b(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:true,onSelect:function(){c(b(this))}});b(this).find("input").each(function(){c(b(this))})})});b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-select").filter(":not(.enhanced)").each(function(){var e=b.extend({minimumResultsForSearch:10,allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder")},a());b(this).selectWoo(e).addClass("enhanced")});b(".wooccm-product-search").filter(":not(.enhanced)").each(function(){var g={allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder"),minimumInputLength:b(this).data("minimum_input_length")?b(this).data("minimum_input_length"):"3",escapeMarkup:function(h){return h},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(h){return{term:h.term,action:b(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:b(this).select2("val")||0,exclude:b(this).data("exclude"),include:b(this).data("include"),limit:b(this).data("limit"),display_stock:b(this).data("display_stock")}},processResults:function(i){var h=[];if(i){b.each(i,function(k,j){h.push({id:k,text:j})})}return{results:h}},cache:true}};g=b.extend(g,a());b(this).selectWoo(g).addClass("enhanced");if(b(this).data("sortable")){var f=b(this);var e=b(this).next(".select2-container").find("ul.select2-selection__rendered");e.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:true,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){b(e.find(".select2-selection__choice").get().reverse()).each(function(){var i=b(this).data("data").id;var h=f.find('option[value="'+i+'"]')[0];f.prepend(h)})}})}else{if(b(this).prop("multiple")){b(this).on("change",function(){var h=b(this).children();h.sort(function(j,i){var l=j.text.toLowerCase();var k=i.text.toLowerCase();if(l>k){return 1}if(l<k){return -1}return 0});b(this).html(h)})}}})});b(document).on("click",".wooccm-field-toggle-enabled",function(){var d=b(this),f=d.closest("tr"),e=d.find(".woocommerce-input-toggle");b.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_toggle_field_enabled",nonce:wooccm.nonce,field_id:f.data("field_id")},dataType:"json",type:"POST",beforeSend:function(g){e.addClass("woocommerce-input-toggle--loading")},success:function(g){if(true===g.data){e.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");e.addClass("woocommerce-input-toggle--enabled");e.removeClass("woocommerce-input-toggle--loading")}else{if(true!==g.data){e.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");e.addClass("woocommerce-input-toggle--disabled");e.removeClass("woocommerce-input-toggle--loading")}}}});return false})})(jQuery);
1
+ (function(b){b.fn.serializeArrayAll=function(){var f={};var e=this.serializeArray();b.each(e,function(){if(f[this.name]!==undefined){if(!f[this.name].push){f[this.name]=[f[this.name]]}f[this.name].push(this.value||"")}else{f[this.name]=this.value||""}});var d=b("input[type=radio],input[type=checkbox]",this);b.each(d,function(){if(!f.hasOwnProperty(this.name)){f[this.name]=""}});return f};function c(f){var e=b(f).next().is(".hasDatepicker")?"minDate":"maxDate",g="minDate"===e?b(f).next():b(f).prev(),d=b(f).datepicker("getDate");b(g).datepicker("option",e,d);b(f).change()}function a(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(d){var e=d.input.length-d.maximum;if(1===e){return wc_enhanced_select_params.i18n_input_too_long_1}return wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",e)},inputTooShort:function(d){var e=d.minimum-d.input.length;if(1===e){return wc_enhanced_select_params.i18n_input_too_short_1}return wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",e)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(d){if(d.maximum===1){return wc_enhanced_select_params.i18n_selection_too_long_1}return wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",d.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}b(document).on("wooccm-tab-panels",function(i,h){var g=b(i.target),f=g.find("ul.wc-tabs"),d=f.find('a[href="'+h+'"]');f.show();f.find("a").click(function(k){k.preventDefault();var j=b(this).closest("div.panel-wrap");f.find("li",j).removeClass("active");b(this).parent().addClass("active");b("div.panel",j).hide();b(b(this).attr("href")).show()});if(d.length&&b(d.attr("href")).length){d.click()}else{f.find("li.active").find("a").click()}});b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each(function(){b(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:true,onSelect:function(){c(b(this))}});b(this).find("input").each(function(){c(b(this))})})});b(document).on("wooccm-enhanced-select",function(d){b(".wooccm-enhanced-select").filter(":not(.enhanced)").each(function(){var e=b.extend({minimumResultsForSearch:10,allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder")},a());b(this).selectWoo(e).addClass("enhanced")});b(".wooccm-product-search").filter(":not(.enhanced)").each(function(){var g={allowClear:b(this).data("allow_clear")?true:false,placeholder:b(this).data("placeholder"),minimumInputLength:b(this).data("minimum_input_length")?b(this).data("minimum_input_length"):"3",escapeMarkup:function(h){return h},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(h){return{term:h.term,action:b(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:b(this).select2("val")||0,exclude:b(this).data("exclude"),include:b(this).data("include"),limit:b(this).data("limit"),display_stock:b(this).data("display_stock")}},processResults:function(i){var h=[];if(i){b.each(i,function(k,j){h.push({id:k,text:j})})}return{results:h}},cache:true}};g=b.extend(g,a());b(this).selectWoo(g).addClass("enhanced");if(b(this).data("sortable")){var f=b(this);var e=b(this).next(".select2-container").find("ul.select2-selection__rendered");e.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:true,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){b(e.find(".select2-selection__choice").get().reverse()).each(function(){var i=b(this).data("data").id;var h=f.find('option[value="'+i+'"]')[0];f.prepend(h)})}})}else{if(b(this).prop("multiple")){b(this).on("change",function(){var h=b(this).children();h.sort(function(j,i){var l=j.text.toLowerCase();var k=i.text.toLowerCase();if(l>k){return 1}if(l<k){return -1}return 0});b(this).html(h)})}}})});b(document).on("click",".wooccm-field-toggle-attribute",function(h){h.preventDefault();var d=b(this),g=d.closest("tr"),f=d.find(".woocommerce-input-toggle");b.ajax({url:wooccm_admin.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_admin.nonce,field_attr:b(this).data("field_attr"),field_id:g.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){f.addClass("woocommerce-input-toggle--loading")},success:function(e){if(true===e.data){f.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");f.addClass("woocommerce-input-toggle--enabled");f.removeClass("woocommerce-input-toggle--loading")}else{if(true!==e.data){f.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled");f.addClass("woocommerce-input-toggle--disabled");f.removeClass("woocommerce-input-toggle--loading")}}}});return false});b(document).on("change",".wooccm-field-change-attribute",function(g){g.preventDefault();var d=b(this),f=d.closest("tr");b.ajax({url:wooccm_admin.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_admin.nonce,field_attr:d.data("field_attr"),field_value:d.val(),field_id:f.data("field_id"),},dataType:"json",type:"POST",beforeSend:function(e){d.prop("disabled",true)},success:function(e){console.log(e.data)},complete:function(e){d.prop("disabled",false)},});return false})})(jQuery);
assets/js/wooccm-checkout.js CHANGED
@@ -26,23 +26,23 @@
26
  if (filetype.match('image.*')) {
27
  source_class = 'image';
28
  } else if (filetype.match('application/ms.*')) {
29
- source = wooccm.icons.spreadsheet;
30
  source_class = 'spreadsheet';
31
  } else if (filetype.match('application/x.*')) {
32
- source = wooccm.icons.archive;
33
  source_class = 'application';
34
  } else if (filetype.match('audio.*')) {
35
- source = wooccm.icons.audio;
36
  source_class = 'audio';
37
  } else if (filetype.match('text.*')) {
38
- source = wooccm.icons.text;
39
  source_class = 'text';
40
  } else if (filetype.match('video.*')) {
41
- source = wooccm.icons.video;
42
  source_class = 'video';
43
  } else {
44
  //if ((false === filetype.match('application/ms.*') && false === filetype.match('application/x.*') && false === filetype.match('audio.*') && false === filetype.match('text.*') && false === filetype.match('video.*')) || (0 === filetype.length || !filetype)) {
45
- source = wooccm.icons.interactive;
46
  source_class = 'interactive';
47
  }
48
 
@@ -134,13 +134,13 @@
134
  $.each(files, function (i, file) {
135
 
136
  var count = $field_list.find('span[data-file_id]').length + i;
137
- if (count >= wooccm.limit.max_files) {
138
- alert('Exeeds max files limit of ' + wooccm.limit.max_files);
139
  return false;
140
  }
141
 
142
- if (file.size > wooccm.limit.max_file_size) {
143
- alert('Exeeds max file size of ' + wooccm.limit.max_file_size);
144
  return true;
145
  }
146
 
@@ -194,7 +194,7 @@
194
  if (window.FormData && fileList[$field.attr('id')].length) {
195
 
196
  if (!is_blocked($form)) {
197
- $place_order.html(wooccm.message.uploading);
198
  block($form);
199
  }
200
 
@@ -202,8 +202,8 @@
202
  $field_list.find('span[data-file_id]').each(function (i, file) {
203
 
204
  var file_id = $(file).data('file_id');
205
- if (i > wooccm.limit.max_files) {
206
- console.log('Exeeds max files limit of ' + wooccm.limit.max_files);
207
  return false;
208
  }
209
 
@@ -212,8 +212,8 @@
212
  return true;
213
  }
214
 
215
- if (fileList[$field.attr('id')][file_id].size > wooccm.limit.max_file_size) {
216
- console.log('Exeeds max file size of ' + wooccm.limit.max_files);
217
  return true;
218
  }
219
 
@@ -223,17 +223,17 @@
223
  //return;
224
 
225
  data.append('action', 'wooccm_checkout_attachment_upload');
226
- data.append('nonce', wooccm.nonce);
227
  $.ajax({
228
  async: false,
229
- url: wooccm.ajaxurl,
230
  type: 'POST',
231
  cache: false,
232
  data: data,
233
  processData: false,
234
  contentType: false,
235
  beforeSend: function (response) {
236
- //$place_order.html(wooccm.message.uploading);
237
  },
238
  success: function (response) {
239
  //$results.removeClass('woocommerce-message');
@@ -282,14 +282,15 @@
282
  $('.wooccm-conditional-child').each(function (i, field) {
283
 
284
  var $field = $(field),
285
- $parent = $('.wooccm-field-' + $field.find('[data-conditional-parent]').data('conditional-parent')),
286
  show_if_value = $field.find('[data-conditional-parent-value]').data('conditional-parent-value');
287
 
288
  if ($parent.length) {
289
 
290
- $parent.on('change keyup', function (e) {
291
 
292
- var $this = $(e.target),
 
293
  value = $this.val();
294
 
295
  if ($this.prop('type') == 'checkbox') {
@@ -302,32 +303,36 @@
302
  $field.fadeOut();
303
  }
304
 
 
 
 
305
  });
306
 
307
- $parent.find('select').trigger('change');
308
- $parent.find('textarea').trigger('keyup');
309
- $parent.find('input[type=button]').trigger('click');
310
- $parent.find('input[type=radio]:checked').trigger('keyup');
311
- $parent.find('input[type=checkbox]:checked').trigger('keyup');
312
- $parent.find('input[type=color]').trigger('keyup');
313
- $parent.find('input[type=date]').trigger('keyup');
314
- $parent.find('input[type=datetime-local]').trigger('keyup');
315
- $parent.find('input[type=email]').trigger('keyup');
316
- $parent.find('input[type=file]').trigger('keyup');
317
- $parent.find('input[type=hidden]').trigger('keyup');
318
- $parent.find('input[type=image]').trigger('keyup');
319
- $parent.find('input[type=month]').trigger('keyup');
320
- $parent.find('input[type=number]').trigger('keyup');
321
- $parent.find('input[type=password]').trigger('keyup');
322
- $parent.find('input[type=range]').trigger('keyup');
323
- $parent.find('input[type=reset]').trigger('keyup');
324
- $parent.find('input[type=search]').trigger('keyup');
325
- $parent.find('input[type=submit]').trigger('keyup');
326
- $parent.find('input[type=tel]').trigger('keyup');
327
- $parent.find('input[type=text]').trigger('keyup');
328
- $parent.find('input[type=time]').trigger('keyup');
329
- $parent.find('input[type=url]').trigger('keyup');
330
- $parent.find('input[type=week]').trigger('keyup');
 
331
 
332
  } else {
333
  $field.show();
26
  if (filetype.match('image.*')) {
27
  source_class = 'image';
28
  } else if (filetype.match('application/ms.*')) {
29
+ source = wooccm_upload.icons.spreadsheet;
30
  source_class = 'spreadsheet';
31
  } else if (filetype.match('application/x.*')) {
32
+ source = wooccm_upload.icons.archive;
33
  source_class = 'application';
34
  } else if (filetype.match('audio.*')) {
35
+ source = wooccm_upload.icons.audio;
36
  source_class = 'audio';
37
  } else if (filetype.match('text.*')) {
38
+ source = wooccm_upload.icons.text;
39
  source_class = 'text';
40
  } else if (filetype.match('video.*')) {
41
+ source = wooccm_upload.icons.video;
42
  source_class = 'video';
43
  } else {
44
  //if ((false === filetype.match('application/ms.*') && false === filetype.match('application/x.*') && false === filetype.match('audio.*') && false === filetype.match('text.*') && false === filetype.match('video.*')) || (0 === filetype.length || !filetype)) {
45
+ source = wooccm_upload.icons.interactive;
46
  source_class = 'interactive';
47
  }
48
 
134
  $.each(files, function (i, file) {
135
 
136
  var count = $field_list.find('span[data-file_id]').length + i;
137
+ if (count >= wooccm_upload.limit.max_files) {
138
+ alert('Exeeds max files limit of ' + wooccm_upload.limit.max_files);
139
  return false;
140
  }
141
 
142
+ if (file.size > wooccm_upload.limit.max_file_size) {
143
+ alert('Exeeds max file size of ' + wooccm_upload.limit.max_file_size);
144
  return true;
145
  }
146
 
194
  if (window.FormData && fileList[$field.attr('id')].length) {
195
 
196
  if (!is_blocked($form)) {
197
+ $place_order.html(wooccm_upload.message.uploading);
198
  block($form);
199
  }
200
 
202
  $field_list.find('span[data-file_id]').each(function (i, file) {
203
 
204
  var file_id = $(file).data('file_id');
205
+ if (i > wooccm_upload.limit.max_files) {
206
+ console.log('Exeeds max files limit of ' + wooccm_upload.limit.max_files);
207
  return false;
208
  }
209
 
212
  return true;
213
  }
214
 
215
+ if (fileList[$field.attr('id')][file_id].size > wooccm_upload.limit.max_file_size) {
216
+ console.log('Exeeds max file size of ' + wooccm_upload.limit.max_files);
217
  return true;
218
  }
219
 
223
  //return;
224
 
225
  data.append('action', 'wooccm_checkout_attachment_upload');
226
+ data.append('nonce', wooccm_upload.nonce);
227
  $.ajax({
228
  async: false,
229
+ url: wooccm_upload.ajaxurl,
230
  type: 'POST',
231
  cache: false,
232
  data: data,
233
  processData: false,
234
  contentType: false,
235
  beforeSend: function (response) {
236
+ //$place_order.html(wooccm_upload.message.uploading);
237
  },
238
  success: function (response) {
239
  //$results.removeClass('woocommerce-message');
282
  $('.wooccm-conditional-child').each(function (i, field) {
283
 
284
  var $field = $(field),
285
+ $parent = $('#' + $field.find('[data-conditional-parent]').data('conditional-parent')),
286
  show_if_value = $field.find('[data-conditional-parent-value]').data('conditional-parent-value');
287
 
288
  if ($parent.length) {
289
 
290
+ $parent.on('wooccm_change change keyup', function (e) {
291
 
292
+ // e.target not working because of select2
293
+ var $this = $(e.currentTarget).find('input,select,textarea').first(),
294
  value = $this.val();
295
 
296
  if ($this.prop('type') == 'checkbox') {
303
  $field.fadeOut();
304
  }
305
 
306
+ $this.off('wooccm_change');
307
+ $this.off('keyup');
308
+
309
  });
310
 
311
+ // dont use change event because trigger update_checkout event
312
+ $parent.find('select:first').trigger('wooccm_change');
313
+ $parent.find('textarea:first').trigger('wooccm_change');
314
+ $parent.find('input[type=button]:first').trigger('wooccm_change');
315
+ $parent.find('input[type=radio]:checked:first').trigger('wooccm_change');
316
+ $parent.find('input[type=checkbox]:checked:first').trigger('wooccm_change');
317
+ $parent.find('input[type=color]:first').trigger('wooccm_change');
318
+ $parent.find('input[type=date]:first').trigger('wooccm_change');
319
+ $parent.find('input[type=datetime-local]:first').trigger('wooccm_change');
320
+ $parent.find('input[type=email]:first').trigger('wooccm_change');
321
+ $parent.find('input[type=file]:first').trigger('wooccm_change');
322
+ $parent.find('input[type=hidden]:first').trigger('wooccm_change');
323
+ $parent.find('input[type=image]:first').trigger('wooccm_change');
324
+ $parent.find('input[type=month]:first').trigger('wooccm_change');
325
+ $parent.find('input[type=number]:first').trigger('wooccm_change');
326
+ $parent.find('input[type=password]:first').trigger('wooccm_change');
327
+ $parent.find('input[type=range]:first').trigger('wooccm_change');
328
+ $parent.find('input[type=reset]:first').trigger('wooccm_change');
329
+ $parent.find('input[type=search]:first').trigger('wooccm_change');
330
+ $parent.find('input[type=submit]:first').trigger('wooccm_change');
331
+ $parent.find('input[type=tel]:first').trigger('wooccm_change');
332
+ $parent.find('input[type=text]:first').trigger('wooccm_change');
333
+ $parent.find('input[type=time]:first').trigger('wooccm_change');
334
+ $parent.find('input[type=url]:first').trigger('wooccm_change');
335
+ $parent.find('input[type=week]:first').trigger('wooccm_change');
336
 
337
  } else {
338
  $field.show();
assets/js/wooccm-checkout.min.js CHANGED
@@ -1 +1 @@
1
- (function(e){var f=function(h){return h.is(".processing")||h.parents(".processing").length};var g=function(h){if(!f(h)){h.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(h){h.removeClass("processing").unblock()};var d=function(n,l,m,h,k){var o=e(n),p;if(k.match("image.*")){p="image"}else{if(k.match("application/ms.*")){m=wooccm.icons.spreadsheet;p="spreadsheet"}else{if(k.match("application/x.*")){m=wooccm.icons.archive;p="application"}else{if(k.match("audio.*")){m=wooccm.icons.audio;p="audio"}else{if(k.match("text.*")){m=wooccm.icons.text;p="text"}else{if(k.match("video.*")){m=wooccm.icons.video;p="video"}else{m=wooccm.icons.interactive;p="interactive"}}}}}}var j='<span data-file_id="'+l+'" title="'+h+'" class="wooccmupload_file">\n <span class="wooccmupload_file_container">\n <a title="'+h+'" class="wooccmupload_file_delete" class="wooccm_dele wooccm-btn wooccm-btn-danger">×</a>\n <span class="wooccmupload_file_image_container">\n <img class="'+p+'" alt="'+h+'" src="'+m+'"/>\n </span>\n </span>\n </span>';o.append(j).fadeIn()};function b(i,h){if(h){i.find("label .optional").remove();i.addClass("validate-required");if(i.find("label .required").length===0){i.find("label").append('&nbsp;<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>')}}else{i.find("label .required").remove();i.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field");if(i.find("label .optional").length===0){i.find("label").append('&nbsp;<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>")}}}e(document).on("country_to_state_changing",function(i,k,m){var j=m,h;var l=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(l,function(n,o){var p=j.find(o),q=p.find("[data-required]").data("required")||0;b(p,q)})});var c=[];e(".wooccmupload-field").each(function(j,m){var k=e(m),l=k.find("[type=file]"),h=k.find(".wooccmupload_button"),n=k.find(".wooccmupload_list");c[k.attr("id")]=[];h.on("click",function(i){i.preventDefault();l.trigger("click")});n.on("click",".wooccmupload_file_delete",function(i){e(this).closest(".wooccmupload_file").remove()});l.on("change",function(o){var i=e(this)[0].files;if(i.length){if(window.FileReader){e.each(i,function(q,p){var r=n.find("span[data-file_id]").length+q;if(r>=wooccm.limit.max_files){alert("Exeeds max files limit of "+wooccm.limit.max_files);return false}if(p.size>wooccm.limit.max_file_size){alert("Exeeds max file size of "+wooccm.limit.max_file_size);return true}reader=new FileReader();reader.onload=(function(s){return function(t){setTimeout(function(){d(n,c[k.attr("id")].push(p)-1,t.target.result,s.name,s.type)},200)}})(p);console.log(p.name);reader.readAsDataURL(p)})}}})});e("#order_review").on("ajaxSuccess",function(l){var k=e(l.target),j=k.find("#place_order"),i=e(".wooccmupload-field"),h=i.length;if(h){j.addClass("wooccm-upload-process")}});e(document).on("click","#place_order.wooccm-upload-process",function(l){l.preventDefault();var i=e("form.checkout"),k=e(this),j=e(".wooccmupload-field"),h=j.length;j.each(function(m,p){var n=e(p),r=n.find(".wooccmupload_field"),q=n.find(".wooccmupload_list");if(window.FormData&&c[n.attr("id")].length){if(!f(i)){k.html(wooccm.message.uploading);g(i)}var o=new FormData();q.find("span[data-file_id]").each(function(t,s){var u=e(s).data("file_id");if(t>wooccm.limit.max_files){console.log("Exeeds max files limit of "+wooccm.limit.max_files);return false}if(c[n.attr("id")][u]===undefined){console.log("Undefined "+u);return true}if(c[n.attr("id")][u].size>wooccm.limit.max_file_size){console.log("Exeeds max file size of "+wooccm.limit.max_files);return true}console.log("We're ready to upload "+c[n.attr("id")][u].name);o.append("wooccm_checkout_attachment_upload[]",c[n.attr("id")][u])});o.append("action","wooccm_checkout_attachment_upload");o.append("nonce",wooccm.nonce);e.ajax({async:false,url:wooccm.ajaxurl,type:"POST",cache:false,data:o,processData:false,contentType:false,beforeSend:function(s){},success:function(s){if(s.success){r.val(s.data)}else{e("body").trigger("update_checkout")}},complete:function(s){h=h-1}})}else{h=h-1}if(h==0){a(i);k.removeClass("wooccm-upload-process").trigger("click")}})});e(document).on("change",".wooccm-add-checkout-fees",function(h){e("body").trigger("update_checkout")});e(".wooccm-conditional-child").each(function(h,m){var j=e(m),l=e(".wooccm-field-"+j.find("[data-conditional-parent]").data("conditional-parent")),k=j.find("[data-conditional-parent-value]").data("conditional-parent-value");if(l.length){l.on("change keyup",function(o){var n=e(o.target),i=n.val();if(n.prop("type")=="checkbox"){i=n.is(":checked")}if(k==i||(e.isArray(i)&&i.indexOf(k)>-1)){j.fadeIn()}else{j.fadeOut()}});l.find("select").trigger("change");l.find("textarea").trigger("keyup");l.find("input[type=button]").trigger("click");l.find("input[type=radio]:checked").trigger("keyup");l.find("input[type=checkbox]:checked").trigger("keyup");l.find("input[type=color]").trigger("keyup");l.find("input[type=date]").trigger("keyup");l.find("input[type=datetime-local]").trigger("keyup");l.find("input[type=email]").trigger("keyup");l.find("input[type=file]").trigger("keyup");l.find("input[type=hidden]").trigger("keyup");l.find("input[type=image]").trigger("keyup");l.find("input[type=month]").trigger("keyup");l.find("input[type=number]").trigger("keyup");l.find("input[type=password]").trigger("keyup");l.find("input[type=range]").trigger("keyup");l.find("input[type=reset]").trigger("keyup");l.find("input[type=search]").trigger("keyup");l.find("input[type=submit]").trigger("keyup");l.find("input[type=tel]").trigger("keyup");l.find("input[type=text]").trigger("keyup");l.find("input[type=time]").trigger("keyup");l.find("input[type=url]").trigger("keyup");l.find("input[type=week]").trigger("keyup")}else{j.show()}});e(".wooccm-type-datepicker").each(function(h,k){var j=e(k),l=j.find("input[type=text]");if(e.isFunction(e.fn.datepicker)){l.datepicker({dateFormat:l.data("formatdate")||"dd-mm-yy",minDate:l.data("mindate")||undefined,maxDate:l.data("maxdate")||undefined,beforeShowDay:function(n){var i=n.getDay(),m=l.data("disable")||false;if(!m){return[true]}else{return[m[i]!==undefined]}}})}});e(".wooccm-type-timepicker").each(function(h,k){var j=e(k),l=j.find("input[type=text]");if(e.isFunction(e.fn.timepicker)){l.timepicker({showPeriod:true,showLeadingZero:true,hours:l.data("hours")||undefined,minutes:l.data("minutes")||undefined,})}});e(".wooccm-colorpicker-farbtastic").each(function(h,k){var j=e(k),m=j.find("input[type=text]"),l=j.find(".wooccmcolorpicker_container");m.hide();if(e.isFunction(e.fn.farbtastic)){l.farbtastic("#"+m.attr("id"));l.on("click",function(i){m.fadeIn()})}});e(".wooccm-colorpicker-iris").each(function(h,k){var j=e(k),l=j.find("input[type=text]");l.css("color","#fff").css("background",l.val()).hide();l.iris({wccmclass:l.attr("id"),palettes:true,color:"",hide:false,change:function(i,m){l.css("color","#000").css("background",m.color.toString()).fadeIn()}})})})(jQuery);
1
+ (function(e){var f=function(h){return h.is(".processing")||h.parents(".processing").length};var g=function(h){if(!f(h)){h.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(h){h.removeClass("processing").unblock()};var d=function(n,l,m,h,k){var o=e(n),p;if(k.match("image.*")){p="image"}else{if(k.match("application/ms.*")){m=wooccm_upload.icons.spreadsheet;p="spreadsheet"}else{if(k.match("application/x.*")){m=wooccm_upload.icons.archive;p="application"}else{if(k.match("audio.*")){m=wooccm_upload.icons.audio;p="audio"}else{if(k.match("text.*")){m=wooccm_upload.icons.text;p="text"}else{if(k.match("video.*")){m=wooccm_upload.icons.video;p="video"}else{m=wooccm_upload.icons.interactive;p="interactive"}}}}}}var j='<span data-file_id="'+l+'" title="'+h+'" class="wooccmupload_file">\n <span class="wooccmupload_file_container">\n <a title="'+h+'" class="wooccmupload_file_delete" class="wooccm_dele wooccm-btn wooccm-btn-danger">×</a>\n <span class="wooccmupload_file_image_container">\n <img class="'+p+'" alt="'+h+'" src="'+m+'"/>\n </span>\n </span>\n </span>';o.append(j).fadeIn()};function b(i,h){if(h){i.find("label .optional").remove();i.addClass("validate-required");if(i.find("label .required").length===0){i.find("label").append('&nbsp;<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>')}}else{i.find("label .required").remove();i.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field");if(i.find("label .optional").length===0){i.find("label").append('&nbsp;<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>")}}}e(document).on("country_to_state_changing",function(i,k,m){var j=m,h;var l=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(l,function(n,o){var p=j.find(o),q=p.find("[data-required]").data("required")||0;b(p,q)})});var c=[];e(".wooccmupload-field").each(function(j,m){var k=e(m),l=k.find("[type=file]"),h=k.find(".wooccmupload_button"),n=k.find(".wooccmupload_list");c[k.attr("id")]=[];h.on("click",function(i){i.preventDefault();l.trigger("click")});n.on("click",".wooccmupload_file_delete",function(i){e(this).closest(".wooccmupload_file").remove()});l.on("change",function(o){var i=e(this)[0].files;if(i.length){if(window.FileReader){e.each(i,function(q,p){var r=n.find("span[data-file_id]").length+q;if(r>=wooccm_upload.limit.max_files){alert("Exeeds max files limit of "+wooccm_upload.limit.max_files);return false}if(p.size>wooccm_upload.limit.max_file_size){alert("Exeeds max file size of "+wooccm_upload.limit.max_file_size);return true}reader=new FileReader();reader.onload=(function(s){return function(t){setTimeout(function(){d(n,c[k.attr("id")].push(p)-1,t.target.result,s.name,s.type)},200)}})(p);console.log(p.name);reader.readAsDataURL(p)})}}})});e("#order_review").on("ajaxSuccess",function(l){var k=e(l.target),j=k.find("#place_order"),i=e(".wooccmupload-field"),h=i.length;if(h){j.addClass("wooccm-upload-process")}});e(document).on("click","#place_order.wooccm-upload-process",function(l){l.preventDefault();var i=e("form.checkout"),k=e(this),j=e(".wooccmupload-field"),h=j.length;j.each(function(m,p){var n=e(p),r=n.find(".wooccmupload_field"),q=n.find(".wooccmupload_list");if(window.FormData&&c[n.attr("id")].length){if(!f(i)){k.html(wooccm_upload.message.uploading);g(i)}var o=new FormData();q.find("span[data-file_id]").each(function(t,s){var u=e(s).data("file_id");if(t>wooccm_upload.limit.max_files){console.log("Exeeds max files limit of "+wooccm_upload.limit.max_files);return false}if(c[n.attr("id")][u]===undefined){console.log("Undefined "+u);return true}if(c[n.attr("id")][u].size>wooccm_upload.limit.max_file_size){console.log("Exeeds max file size of "+wooccm_upload.limit.max_files);return true}console.log("We're ready to upload "+c[n.attr("id")][u].name);o.append("wooccm_checkout_attachment_upload[]",c[n.attr("id")][u])});o.append("action","wooccm_checkout_attachment_upload");o.append("nonce",wooccm_upload.nonce);e.ajax({async:false,url:wooccm_upload.ajaxurl,type:"POST",cache:false,data:o,processData:false,contentType:false,beforeSend:function(s){},success:function(s){if(s.success){r.val(s.data)}else{e("body").trigger("update_checkout")}},complete:function(s){h=h-1}})}else{h=h-1}if(h==0){a(i);k.removeClass("wooccm-upload-process").trigger("click")}})});e(document).on("change",".wooccm-add-checkout-fees",function(h){e("body").trigger("update_checkout")});e(".wooccm-conditional-child").each(function(h,m){var j=e(m),l=e("#"+j.find("[data-conditional-parent]").data("conditional-parent")),k=j.find("[data-conditional-parent-value]").data("conditional-parent-value");if(l.length){l.on("wooccm_change change keyup",function(o){var n=e(o.currentTarget).find("input,select,textarea").first(),i=n.val();if(n.prop("type")=="checkbox"){i=n.is(":checked")}if(k==i||(e.isArray(i)&&i.indexOf(k)>-1)){j.fadeIn()}else{j.fadeOut()}n.off("wooccm_change");n.off("keyup")});l.find("select:first").trigger("wooccm_change");l.find("textarea:first").trigger("wooccm_change");l.find("input[type=button]:first").trigger("wooccm_change");l.find("input[type=radio]:checked:first").trigger("wooccm_change");l.find("input[type=checkbox]:checked:first").trigger("wooccm_change");l.find("input[type=color]:first").trigger("wooccm_change");l.find("input[type=date]:first").trigger("wooccm_change");l.find("input[type=datetime-local]:first").trigger("wooccm_change");l.find("input[type=email]:first").trigger("wooccm_change");l.find("input[type=file]:first").trigger("wooccm_change");l.find("input[type=hidden]:first").trigger("wooccm_change");l.find("input[type=image]:first").trigger("wooccm_change");l.find("input[type=month]:first").trigger("wooccm_change");l.find("input[type=number]:first").trigger("wooccm_change");l.find("input[type=password]:first").trigger("wooccm_change");l.find("input[type=range]:first").trigger("wooccm_change");l.find("input[type=reset]:first").trigger("wooccm_change");l.find("input[type=search]:first").trigger("wooccm_change");l.find("input[type=submit]:first").trigger("wooccm_change");l.find("input[type=tel]:first").trigger("wooccm_change");l.find("input[type=text]:first").trigger("wooccm_change");l.find("input[type=time]:first").trigger("wooccm_change");l.find("input[type=url]:first").trigger("wooccm_change");l.find("input[type=week]:first").trigger("wooccm_change")}else{j.show()}});e(".wooccm-type-datepicker").each(function(h,k){var j=e(k),l=j.find("input[type=text]");if(e.isFunction(e.fn.datepicker)){l.datepicker({dateFormat:l.data("formatdate")||"dd-mm-yy",minDate:l.data("mindate")||undefined,maxDate:l.data("maxdate")||undefined,beforeShowDay:function(n){var i=n.getDay(),m=l.data("disable")||false;if(!m){return[true]}else{return[m[i]!==undefined]}}})}});e(".wooccm-type-timepicker").each(function(h,k){var j=e(k),l=j.find("input[type=text]");if(e.isFunction(e.fn.timepicker)){l.timepicker({showPeriod:true,showLeadingZero:true,hours:l.data("hours")||undefined,minutes:l.data("minutes")||undefined,})}});e(".wooccm-colorpicker-farbtastic").each(function(h,k){var j=e(k),m=j.find("input[type=text]"),l=j.find(".wooccmcolorpicker_container");m.hide();if(e.isFunction(e.fn.farbtastic)){l.farbtastic("#"+m.attr("id"));l.on("click",function(i){m.fadeIn()})}});e(".wooccm-colorpicker-iris").each(function(h,k){var j=e(k),l=j.find("input[type=text]");l.css("color","#fff").css("background",l.val()).hide();l.iris({wccmclass:l.attr("id"),palettes:true,color:"",hide:false,change:function(i,m){l.css("color","#000").css("background",m.color.toString()).fadeIn()}})})})(jQuery);
assets/js/wooccm-modal.js CHANGED
@@ -24,46 +24,61 @@
24
  };
25
 
26
  var Field = Backbone.Model.extend({
27
- defaults: wooccm.fields.args
28
  });
29
 
30
  var FieldView = Backbone.View.extend({
31
- id: 'wooccm_modal',
32
  events: {
33
  'click .media-modal-backdrop': 'close',
34
  'click .media-modal-close': 'close',
35
- 'click .media-modal-delete': 'Delete',
36
- 'click .media-modal-prev': 'update',
37
- 'click .media-modal-next': 'update',
 
38
  'change .media-modal-change': 'change',
39
  'submit .media-modal-form': 'save',
40
  },
41
  templates: {},
42
  initialize: function () {
43
- _.bindAll(this, 'open', 'update', 'change', 'load', 'render', 'close', 'save');
44
  this.init();
45
  this.open();
46
  },
47
  init: function () {
48
- this.templates.window = wp.template('wpmi-modal-window');
49
  },
50
  render: function () {
51
- this.$el.attr('tabindex', '0');
52
- this.$el.html(this.templates.window(this.model.attributes));
53
- this.$el.focus().trigger('wc-init-tabbed-panels');
54
- this.$el.focus().trigger('init_tooltips');
55
- this.$el.focus().trigger('wooccm-enhanced-select');
 
 
 
 
 
 
 
 
 
 
56
  },
57
  load: function () {
58
 
59
- var $modal = this;
 
 
 
 
 
 
60
  $.ajax({
61
- url: woocommerce_admin.ajax_url,
62
  data: {
63
- action: 'wooccm_edit_field',
64
- nonce: wooccm.nonce,
65
- //options_name: $tr.data('options_name'),
66
- //options_key: $tr.data('options_key'),
67
  field_id: this.model.attributes.id
68
  },
69
  dataType: 'json',
@@ -78,18 +93,24 @@
78
  alert('Error!');
79
  },
80
  success: function (response) {
81
- console.log(response);
82
- $modal.model.set(response.data)
83
- $modal.render();
 
 
 
 
 
84
  }
85
  });
86
  },
87
- update: function (e) {
88
  e.preventDefault();
89
 
90
- var $modal = this,
91
  $button = $(e.target),
92
- field_id = $modal.model.get('id');
 
93
 
94
  count++;
95
 
@@ -100,18 +121,18 @@
100
  timer = setTimeout(function () {
101
 
102
  if ($button.hasClass('media-modal-next')) {
103
- field_id = field_id + count;
104
  } else {
105
- field_id = field_id - count;
106
  }
107
 
108
- $modal.model.set({
109
  id: field_id
110
  });
111
 
112
  count = 0;
113
 
114
- $modal.load();
115
 
116
  }, 300);
117
  },
@@ -121,6 +142,26 @@
121
 
122
  $('body').addClass('modal-open').append(this.$el);
123
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  change: function (e) {
125
 
126
  e.preventDefault();
@@ -130,6 +171,7 @@
130
  value = $field.val();
131
 
132
  this.model.attributes[name] = value;
 
133
 
134
  this.render();
135
  },
@@ -139,42 +181,50 @@
139
  $(document).off('focusin');
140
  $('body').removeClass('modal-open');
141
  this.remove();
142
- //wpmi.__instance = undefined;
143
  },
144
  save: function (e) {
145
-
146
  e.preventDefault();
147
- var $form = $(e.target),
148
- $modal = this.$el,
 
 
149
  $details = $modal.find('.attachment-details');
150
 
151
  $.ajax({
152
- url: woocommerce_admin.ajax_url,
153
  data: {
154
  action: 'wooccm_save_field',
155
- nonce: wooccm.nonce,
156
  field_id: this.model.attributes.id,
157
- //options_name: $tr.data('options_name'),
158
- //options_key: $tr.data('options_key'),
159
  field_data: $form.serializeArrayAll()
160
  },
161
  dataType: 'json',
162
  type: 'POST',
163
  beforeSend: function () {
164
  $details.addClass('save-waiting');
165
- //block($modal);
166
  },
167
  complete: function () {
168
  $details.addClass('save-complete');
169
  $details.removeClass('save-waiting');
170
- //unblock($modal);
171
- //$modal.close(e);
172
  },
173
  error: function () {
174
  alert('Error!');
175
  },
176
  success: function (response) {
177
- console.log(response);
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
  });
180
  return false;
@@ -199,11 +249,61 @@
199
  },
200
  });
201
 
202
- $('.wooccm_billing_settings_edit').on('click', function (e) {
 
 
 
 
 
 
203
  e.preventDefault();
204
 
205
  new FieldModal(e);
206
  });
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
  })(jQuery);
24
  };
25
 
26
  var Field = Backbone.Model.extend({
27
+ defaults: wooccm_admin.field.args
28
  });
29
 
30
  var FieldView = Backbone.View.extend({
31
+ //id: 'wooccm_modal_js',
32
  events: {
33
  'click .media-modal-backdrop': 'close',
34
  'click .media-modal-close': 'close',
35
+ //'click .media-modal-delete': 'delete',
36
+ 'click .media-modal-prev': 'edit',
37
+ 'click .media-modal-next': 'edit',
38
+ //'click .media-modal-tab': 'tab',
39
  'change .media-modal-change': 'change',
40
  'submit .media-modal-form': 'save',
41
  },
42
  templates: {},
43
  initialize: function () {
44
+ _.bindAll(this, 'open', 'edit', 'change', 'load', 'render', 'close', 'save');
45
  this.init();
46
  this.open();
47
  },
48
  init: function () {
49
+ this.templates.window = wp.template('wooccm-modal-window');
50
  },
51
  render: function () {
52
+
53
+ var modal = this;
54
+
55
+ // get active tab from the previous modal
56
+ var tab = this.$el.find('ul.wc-tabs li.active a').attr('href');
57
+
58
+ modal.$el.html(modal.templates.window(modal.model.attributes));
59
+
60
+ _.delay(function () {
61
+
62
+ modal.$el.trigger('wooccm-enhanced-select');
63
+ modal.$el.trigger('wooccm-tab-panels', tab);
64
+ modal.$el.trigger('init_tooltips');
65
+ }, 100);
66
+
67
  },
68
  load: function () {
69
 
70
+ var modal = this;
71
+
72
+ if (modal.model.attributes.id == undefined) {
73
+ modal.render();
74
+ return;
75
+ }
76
+
77
  $.ajax({
78
+ url: wooccm_admin.ajax_url,
79
  data: {
80
+ action: 'wooccm_load_field',
81
+ nonce: wooccm_admin.nonce,
 
 
82
  field_id: this.model.attributes.id
83
  },
84
  dataType: 'json',
93
  alert('Error!');
94
  },
95
  success: function (response) {
96
+ if (response.success) {
97
+ console.log(response.data);
98
+ //console.log(this.model.attributes);
99
+ modal.model.set(response.data);
100
+ modal.render();
101
+ } else {
102
+ alert(response.data);
103
+ }
104
  }
105
  });
106
  },
107
+ edit: function (e) {
108
  e.preventDefault();
109
 
110
+ var modal = this,
111
  $button = $(e.target),
112
+ field_count = parseInt($('.wc_gateways tr[data-field_id]').length - 1),
113
+ field_id = parseInt(modal.model.get('id'));
114
 
115
  count++;
116
 
121
  timer = setTimeout(function () {
122
 
123
  if ($button.hasClass('media-modal-next')) {
124
+ field_id = Math.min(field_id + count, field_count);
125
  } else {
126
+ field_id = Math.max(field_id - count, 0);
127
  }
128
 
129
+ modal.model.set({
130
  id: field_id
131
  });
132
 
133
  count = 0;
134
 
135
+ modal.load();
136
 
137
  }, 300);
138
  },
142
 
143
  $('body').addClass('modal-open').append(this.$el);
144
  },
145
+ /*tab: function (e) {
146
+ e.preventDefault();
147
+
148
+ //console.log(e);
149
+
150
+ var $modal = this.$el,
151
+ $tab = $(e.target),
152
+ $tabs = $modal.find('ul.wc-tabs'),
153
+ $wrap = $modal.find('div.panel-wrap'),
154
+ $panel = $wrap.find($tab.attr('href'));
155
+
156
+ $tabs.find('li').removeClass('active');
157
+
158
+ $tab.parent().addClass('active');
159
+
160
+ $wrap.find('div.panel').hide();
161
+
162
+ $panel.show();
163
+
164
+ },*/
165
  change: function (e) {
166
 
167
  e.preventDefault();
171
  value = $field.val();
172
 
173
  this.model.attributes[name] = value;
174
+ this.model.changed[name] = value;
175
 
176
  this.render();
177
  },
181
  $(document).off('focusin');
182
  $('body').removeClass('modal-open');
183
  this.remove();
 
184
  },
185
  save: function (e) {
 
186
  e.preventDefault();
187
+
188
+ var modal = this,
189
+ $form = $(e.target),
190
+ $modal = modal.$el.find('#wooccm_modal'),
191
  $details = $modal.find('.attachment-details');
192
 
193
  $.ajax({
194
+ url: wooccm_admin.ajax_url,
195
  data: {
196
  action: 'wooccm_save_field',
197
+ nonce: wooccm_admin.nonce,
198
  field_id: this.model.attributes.id,
 
 
199
  field_data: $form.serializeArrayAll()
200
  },
201
  dataType: 'json',
202
  type: 'POST',
203
  beforeSend: function () {
204
  $details.addClass('save-waiting');
205
+ block($modal);
206
  },
207
  complete: function () {
208
  $details.addClass('save-complete');
209
  $details.removeClass('save-waiting');
210
+ unblock($modal);
 
211
  },
212
  error: function () {
213
  alert('Error!');
214
  },
215
  success: function (response) {
216
+ if (response.success) {
217
+
218
+ if (response.data.id != modal.model.attributes.id) {
219
+ location.reload();
220
+ //modal.model.set(response.data);
221
+ //modal.render();
222
+ //$('table.form-table').trigger('wooccm-panel-reload');
223
+ }
224
+
225
+ } else {
226
+ alert(response.data);
227
+ }
228
  }
229
  });
230
  return false;
249
  },
250
  });
251
 
252
+ $('#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add').on('click', function (e) {
253
+ e.preventDefault();
254
+
255
+ new FieldModal(e);
256
+ });
257
+
258
+ $('.wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit').on('click', function (e) {
259
  e.preventDefault();
260
 
261
  new FieldModal(e);
262
  });
263
 
264
+ $('.wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete').on('click', function (e) {
265
+ e.preventDefault();
266
+
267
+ var $button = $(e.target),
268
+ $field = $button.closest('[data-field_id]'),
269
+ field_id = $field.data('field_id');
270
+
271
+ var c = confirm(wooccm_admin.message.remove);
272
+
273
+ if (!c) {
274
+ return false;
275
+ }
276
+
277
+ $.ajax({
278
+ url: wooccm_admin.ajax_url,
279
+ data: {
280
+ action: 'wooccm_delete_field',
281
+ nonce: wooccm_admin.nonce,
282
+ field_id: field_id,
283
+ },
284
+ dataType: 'json',
285
+ type: 'POST',
286
+ beforeSend: function () {
287
+ },
288
+ complete: function () {
289
+ //$('table.form-table').trigger('wooccm-panel-reload');
290
+ },
291
+ error: function () {
292
+ alert('Error!');
293
+ },
294
+ success: function (response) {
295
+ if (response.success) {
296
+
297
+ $field.remove();
298
+
299
+ } else {
300
+ alert(response.data);
301
+ }
302
+ }
303
+ });
304
+
305
+ return false;
306
+ });
307
+
308
 
309
  })(jQuery);
assets/js/wooccm-modal.min.js CHANGED
@@ -1 +1 @@
1
- (function(e){var g=0,b;var d=function(j){return j.is(".processing")||j.parents(".processing").length};var c=function(j){if(!d(j)){j.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var f=function(j){j.removeClass("processing").unblock()};var h=Backbone.Model.extend({defaults:wooccm.fields.args});var i=Backbone.View.extend({id:"wooccm_modal",events:{"click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-delete":"Delete","click .media-modal-prev":"update","click .media-modal-next":"update","change .media-modal-change":"change","submit .media-modal-form":"save",},templates:{},initialize:function(){_.bindAll(this,"open","update","change","load","render","close","save");this.init();this.open()},init:function(){this.templates.window=wp.template("wpmi-modal-window")},render:function(){this.$el.attr("tabindex","0");this.$el.html(this.templates.window(this.model.attributes));this.$el.focus().trigger("wc-init-tabbed-panels");this.$el.focus().trigger("init_tooltips");this.$el.focus().trigger("wooccm-enhanced-select")},load:function(){var j=this;e.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_edit_field",nonce:wooccm.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(k){console.log(k);j.model.set(k.data);j.render()}})},update:function(m){m.preventDefault();var j=this,l=e(m.target),k=j.model.get("id");g++;if(b){clearTimeout(b)}b=setTimeout(function(){if(l.hasClass("media-modal-next")){k=k+g}else{k=k-g}j.model.set({id:k});g=0;j.load()},300)},open:function(j){this.load();e("body").addClass("modal-open").append(this.$el)},change:function(m){m.preventDefault();var k=e(m.target),j=k.attr("name"),l=k.val();this.model.attributes[j]=l;this.render()},close:function(j){j.preventDefault();this.undelegateEvents();e(document).off("focusin");e("body").removeClass("modal-open");this.remove()},save:function(m){m.preventDefault();var k=e(m.target),l=this.$el,j=l.find(".attachment-details");e.ajax({url:woocommerce_admin.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm.nonce,field_id:this.model.attributes.id,field_data:k.serializeArrayAll()},dataType:"json",type:"POST",beforeSend:function(){j.addClass("save-waiting")},complete:function(){j.addClass("save-complete");j.removeClass("save-waiting")},error:function(){alert("Error!")},success:function(n){console.log(n)}});return false}});var a=Backbone.View.extend({initialize:function(m){var l=e(m.target),k=l.closest("[data-field_id]").data("field_id");var j=new h();j.set({id:k});new i({model:j})},});e(".wooccm_billing_settings_edit").on("click",function(j){j.preventDefault();new a(j)})})(jQuery);
1
+ (function(e){var g=0,b;var d=function(j){return j.is(".processing")||j.parents(".processing").length};var c=function(j){if(!d(j)){j.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var f=function(j){j.removeClass("processing").unblock()};var h=Backbone.Model.extend({defaults:wooccm_admin.field.args});var i=Backbone.View.extend({events:{"click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","change .media-modal-change":"change","submit .media-modal-form":"save",},templates:{},initialize:function(){_.bindAll(this,"open","edit","change","load","render","close","save");this.init();this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-window")},render:function(){var k=this;var j=this.$el.find("ul.wc-tabs li.active a").attr("href");k.$el.html(k.templates.window(k.model.attributes));_.delay(function(){k.$el.trigger("wooccm-enhanced-select");k.$el.trigger("wooccm-tab-panels",j);k.$el.trigger("init_tooltips")},100)},load:function(){var j=this;if(j.model.attributes.id==undefined){j.render();return}e.ajax({url:wooccm_admin.ajax_url,data:{action:"wooccm_load_field",nonce:wooccm_admin.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(k){if(k.success){console.log(k.data);j.model.set(k.data);j.render()}else{alert(k.data)}}})},edit:function(n){n.preventDefault();var l=this,m=e(n.target),k=parseInt(e(".wc_gateways tr[data-field_id]").length-1),j=parseInt(l.model.get("id"));g++;if(b){clearTimeout(b)}b=setTimeout(function(){if(m.hasClass("media-modal-next")){j=Math.min(j+g,k)}else{j=Math.max(j-g,0)}l.model.set({id:j});g=0;l.load()},300)},open:function(j){this.load();e("body").addClass("modal-open").append(this.$el)},change:function(m){m.preventDefault();var k=e(m.target),j=k.attr("name"),l=k.val();this.model.attributes[j]=l;this.model.changed[j]=l;this.render()},close:function(j){j.preventDefault();this.undelegateEvents();e(document).off("focusin");e("body").removeClass("modal-open");this.remove()},save:function(n){n.preventDefault();var m=this,k=e(n.target),l=m.$el.find("#wooccm_modal"),j=l.find(".attachment-details");e.ajax({url:wooccm_admin.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_admin.nonce,field_id:this.model.attributes.id,field_data:k.serializeArrayAll()},dataType:"json",type:"POST",beforeSend:function(){j.addClass("save-waiting");c(l)},complete:function(){j.addClass("save-complete");j.removeClass("save-waiting");f(l)},error:function(){alert("Error!")},success:function(o){if(o.success){if(o.data.id!=m.model.attributes.id){location.reload()}}else{alert(o.data)}}});return false}});var a=Backbone.View.extend({initialize:function(m){var l=e(m.target),k=l.closest("[data-field_id]").data("field_id");var j=new h();j.set({id:k});new i({model:j})},});e("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",function(j){j.preventDefault();new a(j)});e(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",function(j){j.preventDefault();new a(j)});e(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",function(m){m.preventDefault();var l=e(m.target),k=l.closest("[data-field_id]"),j=k.data("field_id");var n=confirm(wooccm_admin.message.remove);if(!n){return false}e.ajax({url:wooccm_admin.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_admin.nonce,field_id:j,},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(o){if(o.success){k.remove()}else{alert(o.data)}}});return false})})(jQuery);
assets/js/wooccm-order-upload.js CHANGED
@@ -37,21 +37,23 @@
37
  $(document).on('click', '#wooccm_order_attachment_update', function (e) {
38
 
39
  $.ajax({
40
- url: wooccm.ajaxurl,
41
  type: 'POST',
42
  cache: false,
43
  data: {
44
  action: 'wooccm_order_attachment_update',
45
- nonce: wooccm.nonce,
46
  delete_attachments_ids: $('#delete_attachments_ids').val(),
47
  all_attachments_ids: $('#all_attachments_ids').val()
48
  },
49
  beforeSend: function (response) {
50
- $('.wccm_results').html(wooccm.message.saving);
51
  },
52
  success: function (response) {
53
  if (response.success) {
54
- $('.wccm_results').html(wooccm.message.deleted);
 
 
55
  } else {
56
  $('.wccm_results').html(response.data);
57
  }
@@ -98,11 +100,11 @@
98
  if (data) {
99
 
100
  data.append('action', 'wooccm_order_attachment_upload');
101
- data.append('nonce', wooccm.nonce);
102
  data.append('order_id', order_id);
103
 
104
  $.ajax({
105
- url: wooccm.ajaxurl,
106
  type: 'POST',
107
  cache: false,
108
  data: data,
@@ -110,15 +112,16 @@
110
  contentType: false,
111
  beforeSend: function (response) {
112
 
113
- $('.wccm_results').html(wooccm.message.uploading);
114
 
115
  block($('#wooccm_order_attachment_inner'));
116
  },
117
  success: function (response) {
118
 
119
  if (response.success) {
120
- $('#wooccm_order_attachment_inner').replaceWith(response.data);
121
- $('.wccm_results').html(wooccm.message.success);
 
122
  } else {
123
  $('.wccm_results').html(response.data);
124
  }
37
  $(document).on('click', '#wooccm_order_attachment_update', function (e) {
38
 
39
  $.ajax({
40
+ url: wooccm_upload.ajaxurl,
41
  type: 'POST',
42
  cache: false,
43
  data: {
44
  action: 'wooccm_order_attachment_update',
45
+ nonce: wooccm_upload.nonce,
46
  delete_attachments_ids: $('#delete_attachments_ids').val(),
47
  all_attachments_ids: $('#all_attachments_ids').val()
48
  },
49
  beforeSend: function (response) {
50
+ $('.wccm_results').html(wooccm_upload.message.saving);
51
  },
52
  success: function (response) {
53
  if (response.success) {
54
+ $('.wccm_results').html(wooccm_upload.message.deleted);
55
+
56
+ $('#wooccm_order_attachment_update').prop('disabled', true);
57
  } else {
58
  $('.wccm_results').html(response.data);
59
  }
100
  if (data) {
101
 
102
  data.append('action', 'wooccm_order_attachment_upload');
103
+ data.append('nonce', wooccm_upload.nonce);
104
  data.append('order_id', order_id);
105
 
106
  $.ajax({
107
+ url: wooccm_upload.ajaxurl,
108
  type: 'POST',
109
  cache: false,
110
  data: data,
112
  contentType: false,
113
  beforeSend: function (response) {
114
 
115
+ $('.wccm_results').html(wooccm_upload.message.uploading);
116
 
117
  block($('#wooccm_order_attachment_inner'));
118
  },
119
  success: function (response) {
120
 
121
  if (response.success) {
122
+ $('#wooccm_order_attachment_inner').fadeOut();
123
+ $('#wooccm_order_attachment_inner').replaceWith($(response.data).fadeIn());
124
+ $('.wccm_results').html(wooccm_upload.message.success);
125
  } else {
126
  $('.wccm_results').html(response.data);
127
  }
assets/js/wooccm-order-upload.min.js CHANGED
@@ -1 +1 @@
1
- (function(b){var c=function(e){return e.is(".processing")||e.parents(".processing").length};var d=function(e){if(!c(e)){e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(e){e.removeClass("processing").unblock()};b(document).ready(function(e){e(document).on("click",".wooccm_delete_attachment",function(h){var g=e(this).closest("tr"),f=e(this).data("attachment_id");g.hide();e("#wooccm_order_attachment_update").prop("disabled",false);e("#delete_attachments_ids").val(e("#delete_attachments_ids").val().replace(f,""))});e(document).on("click","#wooccm_order_attachment_update",function(f){e.ajax({url:wooccm.ajaxurl,type:"POST",cache:false,data:{action:"wooccm_order_attachment_update",nonce:wooccm.nonce,delete_attachments_ids:e("#delete_attachments_ids").val(),all_attachments_ids:e("#all_attachments_ids").val()},beforeSend:function(g){e(".wccm_results").html(wooccm.message.saving)},success:function(g){if(g.success){e(".wccm_results").html(wooccm.message.deleted)}else{e(".wccm_results").html(g.data)}}})});e(document).on("change","#wooccm_order_attachment_upload",function(m){var l=false,n=e(this).data("order_id");if(window.FormData){l=new FormData()}var k=0,g=this.files.length,h,f,j;for(;k<g;k++){j=this.files[k];if(l){l.append("wooccm_order_attachment_upload[]",j)}}if(l){l.append("action","wooccm_order_attachment_upload");l.append("nonce",wooccm.nonce);l.append("order_id",n);e.ajax({url:wooccm.ajaxurl,type:"POST",cache:false,data:l,processData:false,contentType:false,beforeSend:function(i){e(".wccm_results").html(wooccm.message.uploading);d(e("#wooccm_order_attachment_inner"))},success:function(i){if(i.success){e("#wooccm_order_attachment_inner").replaceWith(i.data);e(".wccm_results").html(wooccm.message.success)}else{e(".wccm_results").html(i.data)}a(e("#wooccm_order_attachment_inner"))}})}})})})(jQuery);
1
+ (function(b){var c=function(e){return e.is(".processing")||e.parents(".processing").length};var d=function(e){if(!c(e)){e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(e){e.removeClass("processing").unblock()};b(document).ready(function(e){e(document).on("click",".wooccm_delete_attachment",function(h){var g=e(this).closest("tr"),f=e(this).data("attachment_id");g.hide();e("#wooccm_order_attachment_update").prop("disabled",false);e("#delete_attachments_ids").val(e("#delete_attachments_ids").val().replace(f,""))});e(document).on("click","#wooccm_order_attachment_update",function(f){e.ajax({url:wooccm_upload.ajaxurl,type:"POST",cache:false,data:{action:"wooccm_order_attachment_update",nonce:wooccm_upload.nonce,delete_attachments_ids:e("#delete_attachments_ids").val(),all_attachments_ids:e("#all_attachments_ids").val()},beforeSend:function(g){e(".wccm_results").html(wooccm_upload.message.saving)},success:function(g){if(g.success){e(".wccm_results").html(wooccm_upload.message.deleted);e("#wooccm_order_attachment_update").prop("disabled",true)}else{e(".wccm_results").html(g.data)}}})});e(document).on("change","#wooccm_order_attachment_upload",function(m){var l=false,n=e(this).data("order_id");if(window.FormData){l=new FormData()}var k=0,g=this.files.length,h,f,j;for(;k<g;k++){j=this.files[k];if(l){l.append("wooccm_order_attachment_upload[]",j)}}if(l){l.append("action","wooccm_order_attachment_upload");l.append("nonce",wooccm_upload.nonce);l.append("order_id",n);e.ajax({url:wooccm_upload.ajaxurl,type:"POST",cache:false,data:l,processData:false,contentType:false,beforeSend:function(i){e(".wccm_results").html(wooccm_upload.message.uploading);d(e("#wooccm_order_attachment_inner"))},success:function(i){if(i.success){e("#wooccm_order_attachment_inner").fadeOut();e("#wooccm_order_attachment_inner").replaceWith(e(i.data).fadeIn());e(".wccm_results").html(wooccm_upload.message.success)}else{e(".wccm_results").html(i.data)}a(e("#wooccm_order_attachment_inner"))}})}})})})(jQuery);
assets/less/wooccm-admin.less CHANGED
@@ -1,6 +1,11 @@
1
  .woocommerce_options_panel {
 
 
 
 
 
2
  .select2-container {
3
- width: 80%!important;
4
  line-height: 16px;
5
  //box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
6
 
@@ -19,4 +24,107 @@
19
  box-shadow: 0 0 2px rgba(30, 140, 190, 0.8)!important;
20
  outline: 2px solid transparent!important;
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
1
  .woocommerce_options_panel {
2
+
3
+ .woocommerce-help-tip {
4
+ margin: 0 0 0 0.5em;
5
+ }
6
+
7
  .select2-container {
8
+ width: 50%!important;
9
  line-height: 16px;
10
  //box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
11
 
24
  box-shadow: 0 0 2px rgba(30, 140, 190, 0.8)!important;
25
  outline: 2px solid transparent!important;
26
  }
27
+ }
28
+
29
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] .marketplace-suggestion-container, .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-footer] .marketplace-suggestion-container,
30
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-header] .marketplace-suggestion-container{
31
+ padding: 1em 1.5em;
32
+ }
33
+
34
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container img.marketplace-suggestion-icon {
35
+ height: 40px;
36
+ margin: 0;
37
+ margin-right: 1.5em;
38
+ -webkit-box-flex: 0;
39
+ -webkit-flex: 0 0 40px;
40
+ flex: 0 0 40px;
41
+ }
42
+
43
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-cta {
44
+ -webkit-box-flex: 1;
45
+ -webkit-flex: 1 1 30%;
46
+ flex: 1 1 30%;
47
+ min-width: 160px;
48
+ text-align: right;
49
+ }
50
+
51
+ a.suggestion-dismiss::before {
52
+ font-family: Dashicons;
53
+ speak: none;
54
+ font-weight: 400;
55
+ font-variant: normal;
56
+ text-transform: none;
57
+ line-height: 1;
58
+ -webkit-font-smoothing: antialiased;
59
+ content: "";
60
+ text-decoration: none;
61
+ font-size: 1.5em;
62
+ }
63
+
64
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] .marketplace-suggestion-container .marketplace-suggestion-container-cta a.button {
65
+ display: inline-block;
66
+ min-width: 120px;
67
+ text-align: center;
68
+ margin: 0;
69
+ }
70
+
71
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] {
72
+ border: none;
73
+ border-top: 1px solid #eee;
74
+ border-bottom: 1px solid #eee;
75
+ }
76
+
77
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-cta .suggestion-dismiss {
78
+ text-decoration: none;
79
+ position: relative;
80
+ top: 5px;
81
+ right: auto;
82
+ margin-left: 1em;
83
+ }
84
+ a.suggestion-dismiss {
85
+ border: none;
86
+ box-shadow: none;
87
+ color: #ddd;
88
+ }
89
+
90
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container {
91
+ -webkit-box-align: start;
92
+ -webkit-align-items: flex-start;
93
+ align-items: flex-start;
94
+ display: -webkit-box;
95
+ display: -webkit-flex;
96
+ display: flex;
97
+ -webkit-box-orient: vertical;
98
+ -webkit-box-direction: normal;
99
+ -webkit-flex-direction: column;
100
+ flex-direction: column;
101
+ position: relative;
102
+ }
103
+
104
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-content h4 {
105
+ margin: 0;
106
+ }
107
+
108
+ .marketplace-suggestions-container.showing-suggestion[data-marketplace-suggestions-context=product-edit-meta-tab-body] .marketplace-suggestion-container .marketplace-suggestion-container-content p {
109
+ padding: 0;
110
+ line-height: 1.5;
111
+ }
112
+
113
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container .marketplace-suggestion-container-content p {
114
+ margin: 0;
115
+ margin-top: 4px;
116
+ color: #444;
117
+ }
118
+
119
+ @media screen and (min-width: 600px) {
120
+
121
+ .marketplace-suggestions-container.showing-suggestion .marketplace-suggestion-container {
122
+ -webkit-box-align: center;
123
+ -webkit-align-items: center;
124
+ align-items: center;
125
+ -webkit-box-orient: horizontal;
126
+ -webkit-box-direction: normal;
127
+ -webkit-flex-direction: row;
128
+ flex-direction: row;
129
+ }
130
  }
assets/less/wooccm.less CHANGED
@@ -1,15 +1,19 @@
1
- .wooccm-clearfix {
2
- float: none;
3
- &:before,
 
 
 
 
 
 
 
4
  &:after{
5
- content:'';
6
- display:table;
7
- }
8
- &:after{
9
- clear: both;
10
  }
11
- }
12
 
 
13
 
14
  .button {
15
  &.fileinput-button {
1
+ .woocommerce form .form-row {
2
+
3
+ &.wooccm-clearfix {
4
+ //float: none;
5
+ //clear:both;
6
+ &:before,
7
+ &:after{
8
+ content:'';
9
+ display:table;
10
+ }
11
  &:after{
12
+ clear: both;
13
+ }
 
 
 
14
  }
 
15
 
16
+ }
17
 
18
  .button {
19
  &.fileinput-button {
includes/admin.php CHANGED
@@ -720,6 +720,7 @@ function wooccm_options_validate($input) {
720
  }
721
 
722
  if (empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
 
723
  unset($input['buttons'][$i]);
724
 
725
  if ($i != 999) {
@@ -740,17 +741,18 @@ function wooccm_options_validate($input) {
740
  }
741
  }
742
 
743
- if (!empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
 
744
  unset($input['buttons'][$i]);
745
 
746
  if ($i != 999) {
747
- $detect_error++;
748
- $fieldnum = $i + 1;
749
- add_settings_error(
750
- 'wooccm_settings_errors', esc_attr('settings_updated'), __('Sorry! An error occurred. WooCommerce Checkout Manager removed Additional field #' . $fieldnum . ' because no Label or Placeholder name was provided.', 'woocommerce-checkout-manager'), 'error'
751
- );
752
  }
753
- }
754
  }
755
  }
756
  if ($detect_error == 0) {
@@ -826,17 +828,19 @@ function wooccm_options_validate_shipping($input) {
826
  }
827
  }
828
 
829
- if (!empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
 
 
830
  unset($input['shipping_buttons'][$i]);
831
 
832
  if ($i != 999) {
833
- $detect_error++;
834
- $fieldnum = $i + 1;
835
- add_settings_error(
836
- 'wooccm_settings_errors', esc_attr('settings_updated'), __('Sorry! An error occurred. WooCommerce Checkout Manager removed Shipping field #' . $fieldnum . ' because no Label or Placeholder name was provided.', 'woocommerce-checkout-manager'), 'error'
837
- );
838
  }
839
- }
840
  }
841
  }
842
 
@@ -907,6 +911,7 @@ function wooccm_options_validate_billing($input) {
907
  }
908
 
909
  if (empty($btn['cow']) && (!empty($btn['label']) || !empty($btn['placeholder']))) {
 
910
  $newNum = $i + 1;
911
  if (wooccm_mul_array('myfield' . $newNum, $input['billing_buttons'])) {
912
  $input['billing_buttons'][$i]['cow'] = 'myfield' . $newNum . 'c';
@@ -915,18 +920,20 @@ function wooccm_options_validate_billing($input) {
915
  }
916
  }
917
 
918
- if (!empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
 
 
919
  $detect_error++;
920
  unset($input['billing_buttons'][$i]);
921
 
922
  if ($i != 999) {
923
- $detect_error++;
924
- $fieldnum = $i + 1;
925
- add_settings_error(
926
- 'wooccm_settings_errors', esc_attr('settings_updated'), __('Sorry! An error occurred. WooCommerce Checkout Manager removed Billing field #' . $fieldnum . ' because no Label or Placeholder name was provided.', 'woocommerce-checkout-manager'), 'error'
927
- );
928
  }
929
- }
930
  }
931
  }
932
 
@@ -1432,4 +1439,4 @@ function wooccm_js_str($s) {
1432
  function wooccm_js_array($array) {
1433
  $temp = array_map('wooccm_js_str', $array);
1434
  return '[' . implode(',', $temp) . ']';
1435
- }
720
  }
721
 
722
  if (empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
723
+
724
  unset($input['buttons'][$i]);
725
 
726
  if ($i != 999) {
741
  }
742
  }
743
 
744
+ /* if (!empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
745
+
746
  unset($input['buttons'][$i]);
747
 
748
  if ($i != 999) {
749
+ $detect_error++;
750
+ $fieldnum = $i + 1;
751
+ add_settings_error(
752
+ 'wooccm_settings_errors', esc_attr('settings_updated'), __('Sorry! An error occurred. WooCommerce Checkout Manager removed Additional field #' . $fieldnum . ' because no Label or Placeholder name was provided.', 'woocommerce-checkout-manager'), 'error'
753
+ );
754
  }
755
+ } */
756
  }
757
  }
758
  if ($detect_error == 0) {
828
  }
829
  }
830
 
831
+ /*
832
+ *
833
+ * if (!empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
834
  unset($input['shipping_buttons'][$i]);
835
 
836
  if ($i != 999) {
837
+ $detect_error++;
838
+ $fieldnum = $i + 1;
839
+ add_settings_error(
840
+ 'wooccm_settings_errors', esc_attr('settings_updated'), __('Sorry! An error occurred. WooCommerce Checkout Manager removed Shipping field #' . $fieldnum . ' because no Label or Placeholder name was provided.', 'woocommerce-checkout-manager'), 'error'
841
+ );
842
  }
843
+ } */
844
  }
845
  }
846
 
911
  }
912
 
913
  if (empty($btn['cow']) && (!empty($btn['label']) || !empty($btn['placeholder']))) {
914
+
915
  $newNum = $i + 1;
916
  if (wooccm_mul_array('myfield' . $newNum, $input['billing_buttons'])) {
917
  $input['billing_buttons'][$i]['cow'] = 'myfield' . $newNum . 'c';
920
  }
921
  }
922
 
923
+ /*
924
+ *
925
+ * if (!empty($btn['cow']) && empty($btn['label']) && empty($btn['placeholder'])) {
926
  $detect_error++;
927
  unset($input['billing_buttons'][$i]);
928
 
929
  if ($i != 999) {
930
+ $detect_error++;
931
+ $fieldnum = $i + 1;
932
+ add_settings_error(
933
+ 'wooccm_settings_errors', esc_attr('settings_updated'), __('Sorry! An error occurred. WooCommerce Checkout Manager removed Billing field #' . $fieldnum . ' because no Label or Placeholder name was provided.', 'woocommerce-checkout-manager'), 'error'
934
+ );
935
  }
936
+ } */
937
  }
938
  }
939
 
1439
  function wooccm_js_array($array) {
1440
  $temp = array_map('wooccm_js_str', $array);
1441
  return '[' . implode(',', $temp) . ']';
1442
+ }
includes/formatting.php CHANGED
@@ -13,7 +13,7 @@ function wooccm_mul_array( $val, $array ) {
13
 
14
  }
15
 
16
- function wooccm_mul_array2( $val ) {
17
 
18
  global $wpdb;
19
 
@@ -57,7 +57,7 @@ function wooccm_does_existw( $array ) {
57
  }
58
  }
59
 
60
- }
61
 
62
  function wooccm_clean( $string ) {
63
 
@@ -82,7 +82,7 @@ function wooccm_wpml_string( $input = '' ) {
82
 
83
  // Sort Checkout fields based on order
84
  function wooccm_sort_fields( $a, $b ) {
85
-
86
  if( !isset( $a['order'] ) || !isset( $b['order'] ) )
87
  return 0;
88
 
13
 
14
  }
15
 
16
+ /*function wooccm_mul_array2( $val ) {
17
 
18
  global $wpdb;
19
 
57
  }
58
  }
59
 
60
+ }*/
61
 
62
  function wooccm_clean( $string ) {
63
 
82
 
83
  // Sort Checkout fields based on order
84
  function wooccm_sort_fields( $a, $b ) {
85
+
86
  if( !isset( $a['order'] ) || !isset( $b['order'] ) )
87
  return 0;
88
 
includes/templates/admin/clean/woocheckout-billing-clone.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Checkout Manager
4
+ *
5
+ */
6
+
7
+ // Exit if accessed directly
8
+ if ( !defined( 'ABSPATH' ) )
9
+ exit;
10
+ ?>
11
+
12
+ <td style="display:none;text-align:center;" class="more_toggler1c"><input type="checkbox" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][more_content]" title="<?php esc_attr_e( 'More than two content', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
13
+
14
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_p]" placeholder="<?php _e('Product ID(s) e.g 1674||1233','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Hide field from this Products Only', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
15
+
16
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_px]" placeholder="<?php _e('Product ID(s) e.g 1674||1233','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Display Field for these Products Only', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
17
+
18
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_p_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Hide field from Category', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
19
+
20
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_px_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Show Field for Category', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
21
+
22
+ <td style="display:none;" class="hide_stuff_time"><input type="text" placeholder="6" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][start_hour]" value="" /></td>
23
+
24
+ <td style="display:none;" class="hide_stuff_time"><input type="text" placeholder="9" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][end_hour]" value="" /></td>
25
+
26
+ <td style="display:none;" class="hide_stuff_time"><input type="text" placeholder="15" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][interval_min]" value="" /></td>
27
+
28
+ <td style="display:none;" class="hide_stuff_time"><input type="text" placeholder="0, 10, 20, 30, 40" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][manual_min]" value="" /></td>
29
+
30
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][format_date]" placeholder="dd-mm-yy" title="dd-mm-yy" value="" /></td>
31
+
32
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][min_before]" placeholder="+3" title="Days Before" value="" /></td>
33
+
34
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][max_after]" placeholder="3" title="Days After" value="" /></td>
35
+
36
+ <td style="display:none;text-align:center;" class="hide_stuff_color daoo"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler]" type="checkbox" value="" /></td>
37
+
38
+ <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler0]" type="checkbox" value="" /></td>
39
+
40
+ <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler1]" type="checkbox" value="" /></td>
41
+
42
+ <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler2]" type="checkbox" value="" /></td>
43
+
44
+ <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler3]" type="checkbox" value="" /></td>
45
+
46
+ <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler4]" type="checkbox" value="" /></td>
47
+
48
+ <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler5]" type="checkbox" value="" /></td>
49
+
50
+ <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler6]" type="checkbox" value="" /></td>
51
+
52
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days" title="<?php esc_attr_e( 'Min Date', 'woocommerce-checkout-manager' ); ?>"><span class="spongagge"><?php _e( 'Min Date', 'woocommerce-checkout-manager' ); ?></span></td>
53
+
54
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_yy]" placeholder="<?php _e('2013','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'yy', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
55
+
56
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_mm]" placeholder="<?php _e('10','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'mm', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
57
+
58
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_dd]" placeholder="<?php _e('25','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'dd', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
59
+
60
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days" title="<?php esc_attr_e( 'Max Date', 'woocommerce-checkout-manager' ); ?>"><span class="spongagge"><?php _e( 'Max Date', 'woocommerce-checkout-manager' ); ?></span></td>
61
+
62
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_max_yy]" placeholder="<?php _e('2013','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'yy', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
63
+
64
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_max_mm]" placeholder="<?php _e('10','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'mm', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
65
+
66
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_max_dd]" placeholder="<?php _e('25','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'dd', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
67
+
68
+ <td class="more_toggler1" style="text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][checkbox]" type="checkbox" title="<?php esc_attr_e( 'Add/Remove Required Attribute', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
69
+
70
+ <td class="more_toggler1" style="text-align:center;">
71
+ <select name="wccs_settings3[billing_buttons][<?php echo $i; ?>][position]" > <!--Call run() function-->
72
+ <option value="form-row-wide" ><?php _e( 'Wide','woocommerce-checkout-manager' ); ?></option>
73
+ <option value="form-row-first" ><?php _e( 'Left','woocommerce-checkout-manager' ); ?></option>
74
+ <option value="form-row-last" ><?php _e( 'Right','woocommerce-checkout-manager' ); ?></option>
75
+ </select>
76
+ </td>
77
+
78
+ <td class="more_toggler1" style="text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][clear_row]" type="checkbox" title="<?php esc_attr_e( 'Clear Row', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
79
+
80
+ <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_checkout]" type="checkbox" title="<?php esc_attr_e( 'Deny Checkout', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
81
+
82
+ <td class="filter_field_tog add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Filter Toggler', 'woocommerce-checkout-manager' ); ?></td>
83
+
84
+ <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" title="<?php esc_attr_e( 'Remove tax', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
85
+
86
+ <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" title="<?php esc_attr_e( 'Deny Receipt', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
87
+ <!--
88
+ <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" title="<?php esc_attr_e( 'Add Amount', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
89
+ -->
90
+ <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fee_name]" type="text" title="<?php esc_attr_e( 'Amount Name', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" /></td>
91
+
92
+ <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount_field]" type="text" title="<?php esc_attr_e( 'Add Amount Field', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="50" /></td>
93
+
94
+ <td class="filter_field add_amount_field hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_time hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][conditional_parent_use]" type="checkbox" title="<?php esc_attr_e( 'Conditional Field On', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
95
+
96
+ <td class="condition_tick" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][conditional_parent]" type="checkbox" title="<?php esc_attr_e( 'Conditional Parent', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
97
+
98
+ <td class="more_toggler1"><input placeholder="<?php _e('My Field Name','woocommerce-checkout-manager'); ?>" type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][label]" title="<?php esc_attr_e( 'Label of the New Field', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
99
+
100
+ <td class="more_toggler1"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][placeholder]" placeholder="<?php _e('Example red','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Placeholder - Preview of Data to Input', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
101
+
102
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][chosen_valt]" placeholder="<?php _e('Yes','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Chosen value for conditional', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
103
+
104
+ <td style="display:none;" class="condition_tick"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][conditional_tie]" placeholder="<?php _e('Parent Abbr. Name','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Parent Abbr. Name', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
105
+
106
+ <td style="display:none;" class="filter_field"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][colorpickerd]" id="billing-colorpic<?php echo $i; ?>" title="<?php esc_attr_e( 'Default Color', 'woocommerce-checkout-manager' ); ?>" value="#000000" /></td>
107
+
108
+ <td style="display:none;" class="filter_field">
109
+ <select name="wccs_settings3[billing_buttons][<?php echo $i; ?>][colorpickertype]" > <!--Call run() function-->
110
+ <option value="farbtastic" ><?php _e('Farbtastic','woocommerce-checkout-manager'); ?></option>
111
+ <option value="iris" ><?php _e('Iris','woocommerce-checkout-manager'); ?></option>
112
+ </select>
113
+ </td>
114
+
115
+ <td style="display:none;text-align:center;" class="filter_field"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][user_role]" type="checkbox" value="" /></td>
116
+
117
+ <td class="filter_field" style="display:none;"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][role_options]" placeholder="Option 1||Option 2||Option 3" value="" /></td>
118
+
119
+ <td class="filter_field" style="display:none;"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][role_options2]" placeholder="Option 1||Option 2||Option 3" value="" /></td>
120
+
121
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][extra_class]" value="" /></td>
122
+
123
+ <td style="display:none;text-align:center;" class="hide_stuff_op wccm1"><input type="checkbox" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fancy]" title="<?php esc_attr_e( 'Adapt to woocommerce style', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
124
+
125
+ <td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][force_title2]" value="" placeholder="<?php _e('Name Guide','woocommerce-checkout-manager'); ?>" /></td>
126
+
127
+ <td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][option_array]" value="" placeholder="Option 1||Option 2||Option 3" /></td>
128
+
129
+ <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
130
+ <!--
131
+ <td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
132
+
133
+ <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
134
+ -->
135
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
136
+
137
+ <td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?></td>
138
+
139
+ <td class="more_toggler1">
140
+ <select name="wccs_settings3[billing_buttons][<?php echo $i; ?>][type]" > <!--Call run() function-->
141
+ <option value="wooccmtext" ><?php _e('Text Input','woocommerce-checkout-manager'); ?></option>
142
+ <option value="wooccmtextarea" ><?php _e('Textarea','woocommerce-checkout-manager'); ?></option>
143
+ <option value="wooccmpassword" ><?php _e('Password','woocommerce-checkout-manager'); ?></option>
144
+ <option value="wooccmradio" ><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
145
+ <option value="checkbox_wccm" ><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
146
+ <option value="wooccmselect" ><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
147
+ <!--<option value="datepicker" ><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
148
+ <option value="time" ><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>-->
149
+ <option value="colorpicker" ><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
150
+ <option value="heading" ><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
151
+ <option value="multiselect" ><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
152
+ <option value="multicheckbox" ><?php _e('Multi-Checkbox','woocommerce-checkout-manager'); ?></option>
153
+ <option value="wooccmcountry" ><?php _e('Country','woocommerce-checkout-manager'); ?></option>
154
+ <option value="wooccmstate" ><?php _e('State','woocommerce-checkout-manager'); ?></option>
155
+ <option value="wooccmupload"><?php _e('File Picker','woocommerce-checkout-manager'); ?></option>
156
+ </select>
157
+ </td>
158
+
159
+ <td class="more_toggler1"><input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][cow]" placeholder="MyField" title="<?php esc_attr_e( 'Abbreviation (No spaces)', 'woocommerce-checkout-manager' ); ?>" value="" <?php if ( empty($options['checkness']['abbreviation'])) { echo 'readonly="readonly"'; } ?> /></td>
includes/templates/admin/clean/woocheckout-billing-tbody.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Checkout Manager
4
+ *
5
+ */
6
+
7
+ // Exit if accessed directly
8
+ if ( !defined( 'ABSPATH' ) ) exit;
9
+ ?>
10
+
11
+ <td style="display:none; text-align:center;" class="more_toggler1c">
12
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][more_content]" type="checkbox" value="1" <?php if ( !empty ($field['more_content'])) echo "checked='checked'"; ?> />
13
+ </td>
14
+
15
+ <td style="display:none;" class="more_toggler1c">
16
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_p]" placeholder="<?php _e('Product ID(s) e.g 1674||1233','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['single_p'] ) ? $field['single_p'] : '' ); ?>" />
17
+ </td>
18
+
19
+ <td style="display:none;" class="more_toggler1c">
20
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_px]" placeholder="<?php _e('Product ID(s) e.g 1674||1233','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['single_px'] ) ? $field['single_px'] : '' ); ?>" />
21
+ </td>
22
+
23
+ <td style="display:none;" class="more_toggler1c">
24
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_p_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['single_p_cat'] ) ? $field['single_p_cat'] : '' ); ?>" />
25
+ </td>
26
+
27
+ <td style="display:none;" class="more_toggler1c">
28
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_px_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['single_px_cat'] ) ? $field['single_px_cat'] : '' ); ?>" />
29
+ </td>
30
+
31
+ <td style="display:none;" class="hide_stuff_time">
32
+ <input type="text" placeholder="6" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][start_hour]" value="<?php echo ( !empty( $field['start_hour'] ) ? $field['start_hour'] : '' ); ?>" />
33
+ </td>
34
+
35
+ <td style="display:none;" class="hide_stuff_time">
36
+ <input type="text" placeholder="9" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][end_hour]" value="<?php echo ( !empty( $field['end_hour'] ) ? $field['end_hour'] : '' ); ?>" />
37
+ </td>
38
+
39
+ <td style="display:none;" class="hide_stuff_time">
40
+ <input type="text" placeholder="15" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][interval_min]" value="<?php echo ( !empty( $field['interval_min'] ) ? $field['interval_min'] : '' ); ?>" />
41
+ </td>
42
+
43
+ <td style="display:none;" class="hide_stuff_time">
44
+ <input type="text" placeholder="0, 10, 20, 30, 40" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][manual_min]" value="<?php echo ( !empty( $field['manual_min'] ) ? $field['manual_min'] : '' ); ?>" />
45
+ </td>
46
+
47
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
48
+ <input type="text" placeholder="dd-mm-yy" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][format_date]" value="<?php echo ( !empty( $field['format_date'] ) ? $field['format_date'] : '' ); ?>" />
49
+ </td>
50
+
51
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
52
+ <input type="text" placeholder="+3" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][min_before]" value="<?php echo ( !empty( $field['min_before'] ) ? $field['min_before'] : '' ); ?>" />
53
+ </td>
54
+
55
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
56
+ <input type="text" placeholder="3" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][max_after]" value="<?php echo ( !empty( $field['max_after'] ) ? $field['max_after'] : '' ); ?>" />
57
+ </td>
58
+
59
+ <td style="display:none; text-align:center;" class="hide_stuff_color daoo">
60
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler]" type="checkbox" value="true" <?php if ( !empty ($field['days_disabler'])) echo "checked='checked'"; ?> />
61
+ </td>
62
+
63
+ <td style="display:none; text-align:center;" class="hide_stuff_days">
64
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler0]" type="checkbox" value="1" <?php if ( !empty ($field['days_disabler0'])) echo "checked='checked'"; ?> />
65
+ </td>
66
+
67
+ <td style="display:none; text-align:center;" class="hide_stuff_days">
68
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler1]" type="checkbox" value="1" <?php if ( !empty ($field['days_disabler1'])) echo "checked='checked'"; ?> />
69
+ </td>
70
+
71
+ <td style="display:none; text-align:center;" class="hide_stuff_days">
72
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler2]" type="checkbox" value="1" <?php if ( !empty ($field['days_disabler2'])) echo "checked='checked'"; ?> />
73
+ </td>
74
+
75
+ <td style="display:none; text-align:center;" class="hide_stuff_days">
76
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler3]" type="checkbox" value="1" <?php if ( !empty ($field['days_disabler3'])) echo "checked='checked'"; ?> />
77
+ </td>
78
+
79
+ <td style="display:none; text-align:center;" class="hide_stuff_days">
80
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler4]" type="checkbox" value="1" <?php if ( !empty ($field['days_disabler4'])) echo "checked='checked'"; ?> />
81
+ </td>
82
+
83
+ <td style="display:none; text-align:center;" class="hide_stuff_days">
84
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler5]" type="checkbox" value="1" <?php if ( !empty ($field['days_disabler5'])) echo "checked='checked'"; ?> />
85
+ </td>
86
+
87
+ <td style="display:none; text-align:center;" class="hide_stuff_days">
88
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][days_disabler6]" type="checkbox" value="1" <?php if ( !empty ($field['days_disabler6'])) echo "checked='checked'"; ?> />
89
+ </td>
90
+
91
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
92
+ <span class="spongagge"><?php _e( 'Min Date', 'woocommerce-checkout-manager' ); ?></span>
93
+ </td>
94
+
95
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
96
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_yy]" placeholder="<?php _e('2013','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'yy', 'woocommerce-checkout-manager' ); ?>" value="<?php echo ( !empty( $field['single_yy'] ) ? $field['single_yy'] : '' ); ?>" />
97
+ </td>
98
+
99
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
100
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_mm]" placeholder="<?php _e('10','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'mm', 'woocommerce-checkout-manager' ); ?>" value="<?php echo ( !empty( $field['single_mm'] ) ? $field['single_mm'] : '' ); ?>" />
101
+ </td>
102
+
103
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
104
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_dd]" placeholder="<?php _e('25','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'dd', 'woocommerce-checkout-manager' ); ?>" value="<?php echo ( !empty( $field['single_dd'] ) ? $field['single_dd'] : '' ); ?>" />
105
+ </td>
106
+
107
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
108
+ <span class="spongagge"><?php _e( 'Max Date', 'woocommerce-checkout-manager' ); ?></span>
109
+ </td>
110
+
111
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
112
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_max_yy]" placeholder="<?php _e('2013','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'yy', 'woocommerce-checkout-manager' ); ?>" value="<?php echo ( !empty( $field['single_max_yy'] ) ? $field['single_max_yy'] : '' ); ?>" />
113
+ </td>
114
+
115
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
116
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_max_mm]" placeholder="<?php _e('10','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'mm', 'woocommerce-checkout-manager' ); ?>" value="<?php echo ( !empty( $field['single_max_mm'] ) ? $field['single_max_mm'] : '' ); ?>" />
117
+ </td>
118
+
119
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days">
120
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][single_max_dd]" placeholder="<?php _e('25','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'dd', 'woocommerce-checkout-manager' ); ?>" value="<?php echo ( !empty( $field['single_max_dd'] ) ? $field['single_max_dd'] : '' ); ?>" />
121
+ </td>
122
+
123
+ <td class="more_toggler1" style="text-align:center;">
124
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][checkbox]" type="checkbox" title="<?php _e( 'Whether or not the Checkout field is required', 'woocommerce-checkout-manager' ); ?>" value="true" <?php if ( !empty( $field['checkbox'] ) ) echo "checked='checked'"; ?> />
125
+ </td>
126
+
127
+ <td class="more_toggler1" style="text-align:center;">
128
+ <select name="wccs_settings3[billing_buttons][<?php echo $i; ?>][position]" title="<?php _e( 'Placement of the Checkout field', 'woocommerce-checkout-manager' ); ?>"> <!--Call run() function-->
129
+ <option value="form-row-wide" <?php ( !isset( $field['position'] ) ) ? '' : selected( $field['position'], 'form-row-wide' ); ?>><?php _e( 'Wide','woocommerce-checkout-manager' ); ?></option>
130
+ <option value="form-row-first" <?php ( !isset( $field['position'] ) ) ? '' : selected( $field['position'], 'form-row-first' ); ?>><?php _e( 'Left','woocommerce-checkout-manager' ); ?></option>
131
+ <option value="form-row-last" <?php ( !isset( $field['position'] ) ) ? '' : selected( $field['position'], 'form-row-last' ); ?>><?php _e( 'Right','woocommerce-checkout-manager' ); ?></option>
132
+ </select>
133
+ </td>
134
+
135
+ <td class="more_toggler1" style="text-align:center;">
136
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][clear_row]" type="checkbox" title="<?php _e( 'Applies a clear fix to the Checkout field', 'woocommerce-checkout-manager' ); ?>" value="true" <?php if ( !empty( $field['clear_row'] ) ) echo "checked='checked'"; ?> />
137
+ </td>
138
+
139
+ <td class="filter_field" style="display:none;text-align:center;">
140
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_checkout]" type="checkbox" value="true" <?php if( !empty( $field['deny_checkout'] ) ) echo "checked='checked'"; ?> />
141
+ </td>
142
+
143
+ <td class="filter_field_tog add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;">
144
+ <?php _e('Filter Toggler', 'woocommerce-checkout-manager' ); ?>
145
+ </td>
146
+
147
+ <td class="filter_field" style="display:none;text-align:center;">
148
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" value="true" <?php if ( !empty ($field['tax_remove'])) echo "checked='checked'"; ?> />
149
+ </td>
150
+
151
+ <td class="filter_field" style="display:none;text-align:center;">
152
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" value="true" <?php if ( !empty ($field['deny_receipt'])) echo "checked='checked'"; ?> />
153
+ </td>
154
+ <!--
155
+ <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
156
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" value="true" <?php if ( !empty ($field['add_amount'])) echo "checked='checked'"; ?> />
157
+ </td>
158
+ -->
159
+ <td class="add_amount_field" style="display:none;text-align:center;">
160
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fee_name]" type="text" value="<?php echo ( !empty( $field['fee_name'] ) ? $field['fee_name'] : '' ); ?>" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" />
161
+ </td>
162
+
163
+ <td class="add_amount_field" style="display:none;text-align:center;">
164
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount_field]" type="text" value="<?php echo ( !empty( $field['add_amount_field'] ) ? $field['add_amount_field'] : '' ); ?>" placeholder="50" />
165
+ </td>
166
+
167
+ <td class="filter_field add_amount_field hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_time hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
168
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][conditional_parent_use]" type="checkbox" value="true" <?php if ( !empty ($field['conditional_parent_use'])) echo "checked='checked'"; ?> />
169
+ </td>
170
+
171
+ <td class="condition_tick" style="display:none;text-align:center;">
172
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][conditional_parent]" type="checkbox" value="true" <?php if ( !empty ($field['conditional_parent'])) echo "checked='checked'"; ?> />
173
+ </td>
174
+
175
+ <td class="more_toggler1">
176
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][label]" title="<?php _e( 'Label text for the Checkout field', 'woocommerce-checkout-manager' ); ?>" placeholder="<?php _e('My Field Name','woocommerce-checkout-manager'); ?>" value="<?php echo esc_attr( $field['label'] ); ?>" />
177
+ </td>
178
+
179
+ <td class="more_toggler1">
180
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][placeholder]" title="<?php _e( 'Placeholder text for the Checkout field', 'woocommerce-checkout-manager' ); ?>" placeholder="<?php _e('Example red','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['placeholder'] ) ? $field['placeholder'] : '' ); ?>" <?php if( $field['cow'] == 'country' || $field['cow'] == 'state' ) { echo 'readonly="readonly"'; } ?> />
181
+ </td>
182
+
183
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field">
184
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][chosen_valt]" placeholder="<?php _e('Yes','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['chosen_valt'] ) ? $field['chosen_valt'] : '' ); ?>" />
185
+ </td>
186
+
187
+ <td style="display:none;" class="condition_tick">
188
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][conditional_tie]" placeholder="<?php _e('Parent Abbr. Name','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['conditional_tie'] ) ? $field['conditional_tie'] : '' ); ?>" />
189
+ </td>
190
+
191
+ <td style="display:none;" class="filter_field">
192
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][colorpickerd]" id="billing-colorpic<?php echo $i; ?>" placeholder="<?php _e('#000000','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['colorpickerd'] ) ? $field['colorpickerd'] : '' ); ?>" />
193
+ </td>
194
+
195
+ <td style="display:none;" class="filter_field">
196
+ <select name="wccs_settings3[billing_buttons][<?php echo $i; ?>][colorpickertype]">
197
+ <option value="farbtastic" <?php (!isset($field['colorpickertype'])) ? '' : selected( $field['colorpickertype'], 'farbtastic' ); ?>><?php _e('Farbtastic','woocommerce-checkout-manager'); ?></option>
198
+ <option value="iris" <?php (!isset($field['colorpickertype'])) ? '' : selected( $field['colorpickertype'], 'iris' ); ?>><?php _e('Iris','woocommerce-checkout-manager'); ?></option>
199
+ </select>
200
+ </td>
201
+
202
+ <td style="display:none;text-align:center;" class="filter_field">
203
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][user_role]" type="checkbox" value="user_role" <?php if ( !empty ($field['user_role'])) echo "checked='checked'"; ?> />
204
+ </td>
205
+
206
+ <td class="filter_field" style="display:none;">
207
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][role_options]" placeholder="Option 1||Option 2||Option 3" value="<?php echo ( !empty( $field['role_options'] ) ? $field['role_options'] : '' ); ?>" />
208
+ </td>
209
+
210
+ <td class="filter_field" style="display:none;">
211
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][role_options2]" placeholder="Option 1||Option 2||Option 3" value="<?php echo ( !empty( $field['role_options2'] ) ? $field['role_options2'] : '' ); ?>" />
212
+ </td>
213
+
214
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field">
215
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][extra_class]" value="<?php echo ( !empty( $field['extra_class'] ) ? $field['extra_class'] : '' ); ?>" />
216
+ </td>
217
+
218
+ <td style="display:none;text-align:center;" class="hide_stuff_op wccm1">
219
+ <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fancy]" type="checkbox" value="country_select" <?php if ( !empty ($field['fancy'])) echo "checked='checked'"; ?> />
220
+ </td>
221
+
222
+ <td class="hide_stuff_op wccm1" style="display:none;">
223
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][force_title2]" placeholder="<?php _e('Name Guide','woocommerce-checkout-manager'); ?>" value="<?php echo ( !empty( $field['force_title2'] ) ? $field['force_title2'] : '' ); ?>" />
224
+ </td>
225
+
226
+ <td class="hide_stuff_op wccm1" style="display:none;">
227
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][option_array]" placeholder="Option 1||Option 2||Option 3" value="<?php echo ( !empty( $field['option_array'] ) ? $field['option_array'] : '' ); ?>" />
228
+ </td>
229
+
230
+ <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;">
231
+ <?php _e('Options Toggler', 'woocommerce-checkout-manager' ); ?>
232
+ </td>
233
+ <!--
234
+ <td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;">
235
+ <?php _e('Time Toggler', 'woocommerce-checkout-manager' ); ?>
236
+ </td>
237
+
238
+ <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;">
239
+ <?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?>
240
+ </td>
241
+ -->
242
+
243
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1">
244
+ <?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?>
245
+ </td>
246
+
247
+ <td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c" title="<?php _e( 'Open additional options for this Checkout field', 'woocommerce-checkout-manager' ); ?>">
248
+ <?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?>
249
+ </td>
250
+
251
+ <td class="more_toggler1">
252
+ <select name="wccs_settings3[billing_buttons][<?php echo $i; ?>][type]" title="<?php _e( 'Type of the Checkout field', 'woocommerce-checkout-manager' ); ?>" <?php if ( $field['cow'] == 'country' || $field['cow'] == 'state' ) { echo 'readonly="readonly" style="pointer-events:none;"'; } ?> > <!--Call run() function-->
253
+ <option value="wooccmtext" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmtext' ); ?>><?php _e('Text Input','woocommerce-checkout-manager'); ?></option>
254
+ <option value="wooccmtextarea" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmtextarea' ); ?>><?php _e('Textarea','woocommerce-checkout-manager'); ?></option>
255
+ <option value="wooccmpassword" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmpassword' ); ?>><?php _e('Password','woocommerce-checkout-manager'); ?></option>
256
+ <option value="wooccmradio" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmradio' ); ?>><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
257
+ <option value="checkbox_wccm" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'checkbox_wccm' ); ?>><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
258
+ <option value="wooccmselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmselect' ); ?>><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
259
+ <!--<option value="datepicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'datepicker' ); ?>><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
260
+ <option value="time" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'time' ); ?>><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>-->
261
+ <option value="colorpicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'colorpicker' ); ?>><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
262
+ <option value="heading" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'heading' ); ?>><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
263
+ <option value="multiselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'multiselect' ); ?>><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
264
+ <option value="multicheckbox" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'multicheckbox' ); ?>><?php _e('Multi-Checkbox','woocommerce-checkout-manager'); ?></option>
265
+ <option <?php if ( $field['cow'] == 'country' ) { echo 'selected="selected"'; } ?> value="wooccmcountry" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmcountry' ); ?>><?php _e('Country','woocommerce-checkout-manager'); ?></option>
266
+ <option <?php if ( $field['cow'] == 'state' ) { echo 'selected="selected"'; } ?> value="wooccmstate" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmstate' ); ?>><?php _e('State','woocommerce-checkout-manager'); ?></option>
267
+ <option value="wooccmupload" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmupload' ); ?>><?php _e('File Picker','woocommerce-checkout-manager'); ?></option>
268
+ </select>
269
+ </td>
270
+
271
+ <td class="more_toggler1">
272
+ <input type="text" name="wccs_settings3[billing_buttons][<?php echo $i; ?>][cow]" placeholder="MyField" title="<?php _e( 'To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-manager' ); ?>" value="<?php echo $field['cow']; ?>" <?php if ( empty($options['checkness']['abbreviation'])) { echo 'readonly="readonly"'; } ?> <?php if ( in_array($field['cow'],$htmlbillingabbr) ) { echo 'readonly="readonly" style="pointer-events:none;"'; } ?> />
273
+ </td>
includes/templates/admin/clean/woocheckout-billing-thead.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Checkout Manager
4
+ */
5
+
6
+ // Exit if accessed directly
7
+ if ( !defined( 'ABSPATH' ) ) exit;
8
+ ?>
9
+
10
+
11
+ <th class="more_toggler1c" style="display:none;width: 5%;"><?php _e('More' , 'woocommerce-checkout-manager' ); ?></th>
12
+
13
+ <th class="more_toggler1c hidefieldproduct" style="display:none;width: 17%;"><?php _e('Hide Field from Product' , 'woocommerce-checkout-manager' ); ?></th>
14
+
15
+ <th class="more_toggler1c" style="display:none;width: 17%;"><?php _e('Show Field for Product' , 'woocommerce-checkout-manager' ); ?></th>
16
+
17
+ <th class="more_toggler1c hidefieldcat" style="display:none;width: 20%;"><?php _e('Hide Field from Category' , 'woocommerce-checkout-manager' ); ?></th>
18
+
19
+ <th class="more_toggler1c" style="display:none;width: 20%;"><?php _e('Show Field for Category' , 'woocommerce-checkout-manager' ); ?></th>
20
+
21
+ <th class="hide_stuff_time" style="display:none;width: 16%;"><?php _e('Start Hour' , 'woocommerce-checkout-manager' ); ?></th>
22
+
23
+ <th class="hide_stuff_time" style="display:none;width: 16%;"><?php _e('End Hour' , 'woocommerce-checkout-manager' ); ?></th>
24
+
25
+ <th class="hide_stuff_time" style="display:none;width: 16%;"><?php _e('Interval Min.' , 'woocommerce-checkout-manager' ); ?></th>
26
+
27
+ <th class="hide_stuff_time" style="display:none;width: 16%;"><?php _e('Manual Min.' , 'woocommerce-checkout-manager' ); ?></th>
28
+
29
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;width: 16%;"><?php _e('Date Format' , 'woocommerce-checkout-manager' ); ?></th>
30
+
31
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;width: 5%;"><?php _e('Days before' , 'woocommerce-checkout-manager' ); ?></th>
32
+
33
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;width: 5%;"><?php _e('Days After' , 'woocommerce-checkout-manager' ); ?></th>
34
+
35
+ <th class="hide_stuff_color daoo" style="display:none;width: 7%;"><?php _e('Days Enabler' , 'woocommerce-checkout-manager' ); ?></th>
36
+
37
+ <th class="hide_stuff_days" style="display:none;width: 7%;"><?php _e('Sundays' , 'woocommerce-checkout-manager' ); ?></th>
38
+
39
+ <th class="hide_stuff_days" style="display:none;width: 7%;"><?php _e('Mondays' , 'woocommerce-checkout-manager' ); ?></th>
40
+
41
+ <th class="hide_stuff_days" style="display:none;width: 7%;"><?php _e('Tuesdays' , 'woocommerce-checkout-manager' ); ?></th>
42
+
43
+ <th class="hide_stuff_days" style="display:none;width: 7%;"><?php _e('Wednesdays' , 'woocommerce-checkout-manager' ); ?></th>
44
+
45
+ <th class="hide_stuff_days" style="display:none;width: 7%;"><?php _e('Thursdays' , 'woocommerce-checkout-manager' ); ?></th>
46
+
47
+ <th class="hide_stuff_days" style="display:none;width: 7%;"><?php _e('Fridays' , 'woocommerce-checkout-manager' ); ?></th>
48
+
49
+ <th class="hide_stuff_days" style="display:none;width: 7%;"><?php _e('Satudays' , 'woocommerce-checkout-manager' ); ?></th>
50
+
51
+ <th class="hide_stuff_color separator hide_stuff_days" style="display:none;" width="3%"><?php _e('' , 'woocommerce-checkout-manager' ); ?></th>
52
+
53
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;text-align:center;" width="5%"><?php _e('YY' , 'woocommerce-checkout-manager' ); ?></th>
54
+
55
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;" width="4%"><?php _e('MM' , 'woocommerce-checkout-manager' ); ?></th>
56
+
57
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;" width="4%"><?php _e('DD' , 'woocommerce-checkout-manager' ); ?></th>
58
+
59
+ <th class="hide_stuff_color separator hide_stuff_days" style="display:none;" width="3%"><?php _e('' , 'woocommerce-checkout-manager' ); ?></th>
60
+
61
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;text-align:center;" width="5%"><?php _e('YY' , 'woocommerce-checkout-manager' ); ?></th>
62
+
63
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;" width="4%"><?php _e('MM' , 'woocommerce-checkout-manager' ); ?></th>
64
+
65
+ <th class="hide_stuff_color hide_stuff_days" style="display:none;" width="4%"><?php _e('DD' , 'woocommerce-checkout-manager' ); ?></th>
66
+
67
+ <th class="more_toggler1" width="8%"><?php _e('Required' , 'woocommerce-checkout-manager' ); ?></th>
68
+
69
+ <th class="more_toggler1" width="5%"><?php _e('Position' , 'woocommerce-checkout-manager' ); ?></th>
70
+
71
+ <th class="more_toggler1" width="5%"><?php _e('Clear' , 'woocommerce-checkout-manager' ); ?></th>
72
+
73
+ <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Checkout' , 'woocommerce-checkout-manager' ); ?></th>
74
+
75
+ <th style="cursor: pointer; text-align: center; font-size: 30px;display:none;" class="filter_field_tog add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;" width="5%"><span class="toggle_shower">&equiv;</span></th>
76
+
77
+ <th class="filter_field" style="display:none;" width="5%"><?php _e('Remove Tax' , 'woocommerce-checkout-manager' ); ?></th>
78
+
79
+ <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Receipt' , 'woocommerce-checkout-manager' ); ?></th>
80
+ <!--
81
+ <th class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c add_amount" style="display:none;" width="5%"><?php _e('Add Amount' , 'woocommerce-checkout-manager' ); ?></th>
82
+ -->
83
+ <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Amount Name' , 'woocommerce-checkout-manager' ); ?></th>
84
+
85
+ <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Enter Amount' , 'woocommerce-checkout-manager' ); ?></th>
86
+
87
+ <th class="filter_field add_amount_field hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c apply_tick" style="display:none;" width="9%"><?php _e('Conditional' , 'woocommerce-checkout-manager' ); ?></th>
88
+
89
+ <th class="condition_tick" style="display:none;" width="9%"><?php _e('Conditional Parent' , 'woocommerce-checkout-manager' ); ?></th>
90
+
91
+ <th class="more_toggler1"><?php _e('Label' , 'woocommerce-checkout-manager' ); ?></th>
92
+
93
+ <th class="more_toggler1"><?php _e('Placeholder' , 'woocommerce-checkout-manager' ); ?></th>
94
+
95
+ <th style="display:none; width: 10%;" class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field"><?php _e('Chosen Value' , 'woocommerce-checkout-manager' ); ?></th>
96
+
97
+ <th style="display:none;" class="condition_tick" width="16%"><?php _e('Conditional Tie' , 'woocommerce-checkout-manager' ); ?></th>
98
+
99
+ <th style="display:none;width:5%;" class="filter_field" width="1%"><?php _e('Default Color' , 'woocommerce-checkout-manager' ); ?></th>
100
+
101
+ <th style="display:none;" class="filter_field" width="5%"><?php _e('Picker Type' , 'woocommerce-checkout-manager' ); ?></th>
102
+
103
+ <th style="display:none;" class="filter_field" width="5%"><?php _e('User Role' , 'woocommerce-checkout-manager' ); ?></th>
104
+
105
+ <th class="filter_field roles" style="display:none;" width="15%"><?php _e('Show for Roles (Separated by ' , 'woocommerce-checkout-manager' ); ?><span class="toggle_shower current_opener">||</span> )</th>
106
+
107
+ <th class="filter_field" style="display:none;" width="15%"><?php _e('Hide from Roles (Separated by ' , 'woocommerce-checkout-manager' ); ?><span class="toggle_shower current_opener">||</span> )</th>
108
+
109
+ <th style="display:none;" class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field" width="13%"><?php _e('Class' , 'woocommerce-checkout-manager' ); ?></th>
110
+
111
+ <th class="hide_stuff_op wccm1" style="display:none;" width="10%"><?php _e('Adapt' , 'woocommerce-checkout-manager' ); ?></th>
112
+
113
+ <th class="hide_stuff_op wccm1" style="display:none;" width="10%"><?php _e('Title' , 'woocommerce-checkout-manager' ); ?></th>
114
+
115
+ <th class="hide_stuff_op wccm1" style="display:none;" width="60%"><?php _e('List of Options (Separated by ' , 'woocommerce-checkout-manager' ); ?><span class="toggle_shower current_opener">||</span> )</th>
116
+
117
+ <th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
118
+
119
+ <!--
120
+ <th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_opcheck hide_stuff_op hide_stuff_change hide_stuff_time_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
121
+
122
+ <th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_days hide_stuff_color_tog hide_stuff_op more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
123
+ -->
124
+ <th style="display:none;cursor:pointer;text-align:center;font-size:30px;" class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_time hide_stuff_op hide_stuff_color more_toggler1 more_toggler1a" width="2%"><span class="toggle_shower">&equiv;</span></th>
125
+
126
+ <th style="cursor:pointer;text-align:center;font-size:30px;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler hide_stuff_op more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
127
+
128
+ <th class="more_toggler1" style="width:10%;"><?php _e('Choose Type' , 'woocommerce-checkout-manager' ); ?></th>
129
+
130
+ <th class="more_toggler1" style="width:5%"><?php _e('Abbreviation' , 'woocommerce-checkout-manager' ); ?></th>
131
+
includes/templates/admin/woocheckout-additional-clone.php CHANGED
@@ -1,23 +1,22 @@
1
- <?php
2
  /**
3
  * WooCommerce Checkout Manager
4
  *
5
  */
6
-
7
  // Exit if accessed directly
8
- if ( !defined( 'ABSPATH' ) )
9
- exit;
10
  ?>
11
 
12
- <td style="display:none;text-align:center;" class="more_toggler1c"><input type="checkbox" name="wccs_settings[buttons][<?php echo $i; ?>][more_content]" title="<?php esc_attr_e( 'More than two content', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
13
 
14
- <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_p]" placeholder="<?php _e('Product ID(s) e.g 1674||1233','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Hide field from this Products Only', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
15
 
16
- <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_px]" placeholder="<?php _e('Product ID(s) e.g 1674||1233','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Display Field for these Products Only', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
17
 
18
- <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_p_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Hide field from Category', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
19
 
20
- <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_px_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Show Field for Category', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
21
 
22
  <td style="display:none;" class="hide_stuff_time"><input type="text" placeholder="6" name="wccs_settings[buttons][<?php echo $i; ?>][start_hour]" value="" /></td>
23
 
@@ -49,67 +48,67 @@ if ( !defined( 'ABSPATH' ) )
49
 
50
  <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings[buttons][<?php echo $i; ?>][days_disabler6]" type="checkbox" value="" /></td>
51
 
52
- <td style="display:none;" class="hide_stuff_color hide_stuff_days" title="<?php esc_attr_e( 'Min Date', 'woocommerce-checkout-manager' ); ?>"><span class="spongagge"><?php _e( 'Min Date', 'woocommerce-checkout-manager' ); ?></span></td>
53
 
54
- <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_yy]" placeholder="<?php _e('2013','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'yy', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
55
 
56
- <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_mm]" placeholder="<?php _e('10','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'mm', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
57
 
58
- <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_dd]" placeholder="<?php _e('25','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'dd', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
59
 
60
- <td style="display:none;" class="hide_stuff_color hide_stuff_days" title="<?php esc_attr_e( 'Max Date', 'woocommerce-checkout-manager' ); ?>"><span class="spongagge"><?php _e( 'Max Date', 'woocommerce-checkout-manager' ); ?></span></td>
61
 
62
- <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_max_yy]" placeholder="<?php _e('2013','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'yy', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
63
 
64
- <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_max_mm]" placeholder="<?php _e('10','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'mm', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
65
 
66
- <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_max_dd]" placeholder="<?php _e('25','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'dd', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
67
 
68
- <td class="more_toggler1" style="text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][checkbox]" type="checkbox" title="<?php esc_attr_e( 'Add/Remove Required Attribute', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
69
 
70
  <td class="more_toggler1" style="text-align:center;">
71
- <select name="wccs_settings[buttons][<?php echo $i; ?>][position]" > <!--Call run() function-->
72
- <option value="form-row-wide" ><?php _e( 'Wide','woocommerce-checkout-manager' ); ?></option>
73
- <option value="form-row-first" ><?php _e( 'Left','woocommerce-checkout-manager' ); ?></option>
74
- <option value="form-row-last" ><?php _e( 'Right','woocommerce-checkout-manager' ); ?></option>
75
- </select>
76
  </td>
77
 
78
- <td class="more_toggler1" style="text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][clear_row]" type="checkbox" title="<?php esc_attr_e( 'Clear Row', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
79
 
80
- <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][deny_checkout]" type="checkbox" title="<?php esc_attr_e( 'Deny Checkout', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
81
 
82
- <td class="filter_field_tog add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Filter Toggler', 'woocommerce-checkout-manager' ); ?></td>
83
 
84
- <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" title="<?php esc_attr_e( 'Remove tax', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
85
 
86
- <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" title="<?php esc_attr_e( 'Deny Receipt', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
87
-
88
- <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][add_amount]" type="checkbox" title="<?php esc_attr_e( 'Add Amount', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
89
-
90
- <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][fee_name]" type="text" title="<?php esc_attr_e( 'Amount Name', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" /></td>
91
 
92
- <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][add_amount_field]" type="text" title="<?php esc_attr_e( 'Add Amount Field', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="50" /></td>
93
 
94
- <td class="filter_field add_amount_field hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_time hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][conditional_parent_use]" type="checkbox" title="<?php esc_attr_e( 'Conditional Field On', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
95
 
96
- <td class="condition_tick" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][conditional_parent]" type="checkbox" title="<?php esc_attr_e( 'Conditional Parent', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
97
 
98
- <td class="more_toggler1"><input placeholder="<?php _e('My Field Name','woocommerce-checkout-manager'); ?>" type="text" name="wccs_settings[buttons][<?php echo $i; ?>][label]" title="<?php esc_attr_e( 'Label of the New Field', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
99
 
100
- <td class="more_toggler1"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][placeholder]" placeholder="<?php _e('Example red','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Placeholder - Preview of Data to Input', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
101
 
102
- <td style="display:none;" class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][chosen_valt]" placeholder="<?php _e('Yes','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Chosen value for conditional', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
103
 
104
- <td style="display:none;" class="condition_tick"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][conditional_tie]" placeholder="<?php _e('Parent Abbr. Name','woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e( 'Parent Abbr. Name', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
105
 
106
- <td style="display:none;" class="filter_field"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][colorpickerd]" id="billing-colorpic<?php echo $i; ?>" title="<?php esc_attr_e( 'Default Color', 'woocommerce-checkout-manager' ); ?>" value="#000000" /></td>
107
 
108
  <td style="display:none;" class="filter_field">
109
- <select name="wccs_settings[buttons][<?php echo $i; ?>][colorpickertype]" > <!--Call run() function-->
110
- <option value="farbtastic" ><?php _e('Farbtastic','woocommerce-checkout-manager'); ?></option>
111
- <option value="iris" ><?php _e('Iris','woocommerce-checkout-manager'); ?></option>
112
- </select>
113
  </td>
114
 
115
  <td style="display:none;text-align:center;" class="filter_field"><input name="wccs_settings[buttons][<?php echo $i; ?>][user_role]" type="checkbox" value="" /></td>
@@ -120,47 +119,49 @@ if ( !defined( 'ABSPATH' ) )
120
 
121
  <td style="display:none;" class="filter_field add_amount_field hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][extra_class]" value="" /></td>
122
 
123
- <td style="display:none;" class="hide_stuff_change"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][changenamep]" id="billing-colorpic<?php echo $i; ?>" placeholder="<?php _e( 'Billing Details', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
124
 
125
- <td style="display:none;" class="hide_stuff_change"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][changename]" id="billing-colorpic<?php echo $i; ?>" placeholder="<?php _e( 'Bill Form', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
126
 
127
- <td style="display:none;text-align:center;" class="hide_stuff_op wccm1"><input type="checkbox" name="wccs_settings[buttons][<?php echo $i; ?>][fancy]" title="<?php esc_attr_e( 'Adapt to woocommerce style', 'woocommerce-checkout-manager' ); ?>" value="" /></td>
128
 
129
- <td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][force_title2]" value="" placeholder="<?php _e( 'Name Guide', 'woocommerce-checkout-manager' ); ?>" /></td>
130
 
131
  <td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][option_array]" value="" placeholder="Option 1 || Option 2 || Option 3 || Option 4" /></td>
132
 
133
- <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Options Toggler', 'woocommerce-checkout-manager' ); ?></td>
134
 
135
- <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change_tog hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Swapper Toggler', 'woocommerce-checkout-manager' ); ?></td>
136
  <!--
137
- <td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e( 'Time Toggler', 'woocommerce-checkout-manager' ); ?></td>
138
 
139
- <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e( 'Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
140
  -->
141
- <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e( 'Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
142
 
143
- <td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e( 'More Toggler', 'woocommerce-checkout-manager' ); ?></td>
144
 
145
  <td class="more_toggler1">
146
- <select name="wccs_settings[buttons][<?php echo $i; ?>][type]"> <!--Call run() function-->
147
- <option value="wooccmtext"><?php _e('Text Input','woocommerce-checkout-manager'); ?></option>
148
- <option value="wooccmtextarea"><?php _e('Textarea','woocommerce-checkout-manager'); ?></option>
149
- <option value="wooccmpassword"><?php _e('Password','woocommerce-checkout-manager'); ?></option>
150
- <option value="wooccmradio"><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
151
- <option value="checkbox_wccm"><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
152
- <option value="wooccmselect"><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
153
- <option value="datepicker"><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
154
- <option value="changename"><?php _e('Text/ Html Swapper','woocommerce-checkout-manager'); ?></option>
155
- <option value="time"><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>
156
- <option value="colorpicker"><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
157
- <option value="heading"><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
158
- <option value="multiselect"><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
159
- <option value="multicheckbox" ><?php _e('Multi-Checkbox','woocommerce-checkout-manager'); ?></option>
160
- <option value="wooccmcountry"><?php _e('Country','woocommerce-checkout-manager'); ?></option>
161
- <option value="wooccmstate"><?php _e('State','woocommerce-checkout-manager'); ?></option>
162
- <option value="wooccmupload"><?php _e('File Picker','woocommerce-checkout-manager'); ?></option>
163
- </select>
164
  </td>
165
 
166
- <td class="more_toggler1"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][cow]" placeholder="MyField" title="<?php esc_attr_e( 'Abbreviation (No spaces)', 'woocommerce-checkout-manager' ); ?>" value="" <?php if ( empty($options['checkness']['abbreviation'])) { echo 'readonly="readonly"'; } ?> /></td>
 
 
1
+ <?php
2
  /**
3
  * WooCommerce Checkout Manager
4
  *
5
  */
 
6
  // Exit if accessed directly
7
+ if (!defined('ABSPATH'))
8
+ exit;
9
  ?>
10
 
11
+ <td style="display:none;text-align:center;" class="more_toggler1c"><input type="checkbox" name="wccs_settings[buttons][<?php echo $i; ?>][more_content]" title="<?php esc_attr_e('More than two content', 'woocommerce-checkout-manager'); ?>" value="" /></td>
12
 
13
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_p]" placeholder="<?php _e('Product ID(s) e.g 1674||1233', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('Hide field from this Products Only', 'woocommerce-checkout-manager'); ?>" value="" /></td>
14
 
15
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_px]" placeholder="<?php _e('Product ID(s) e.g 1674||1233', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('Display Field for these Products Only', 'woocommerce-checkout-manager'); ?>" value="" /></td>
16
 
17
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_p_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('Hide field from Category', 'woocommerce-checkout-manager'); ?>" value="" /></td>
18
 
19
+ <td style="display:none;" class="more_toggler1c"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_px_cat]" placeholder="<?php _e('Category Slug(s) e.g my-cat||my-cat2', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('Show Field for Category', 'woocommerce-checkout-manager'); ?>" value="" /></td>
20
 
21
  <td style="display:none;" class="hide_stuff_time"><input type="text" placeholder="6" name="wccs_settings[buttons][<?php echo $i; ?>][start_hour]" value="" /></td>
22
 
48
 
49
  <td style="display:none;text-align:center;" class="hide_stuff_days"><input name="wccs_settings[buttons][<?php echo $i; ?>][days_disabler6]" type="checkbox" value="" /></td>
50
 
51
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days" title="<?php esc_attr_e('Min Date', 'woocommerce-checkout-manager'); ?>"><span class="spongagge"><?php _e('Min Date', 'woocommerce-checkout-manager'); ?></span></td>
52
 
53
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_yy]" placeholder="<?php _e('2013', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('yy', 'woocommerce-checkout-manager'); ?>" value="" /></td>
54
 
55
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_mm]" placeholder="<?php _e('10', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('mm', 'woocommerce-checkout-manager'); ?>" value="" /></td>
56
 
57
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_dd]" placeholder="<?php _e('25', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('dd', 'woocommerce-checkout-manager'); ?>" value="" /></td>
58
 
59
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days" title="<?php esc_attr_e('Max Date', 'woocommerce-checkout-manager'); ?>"><span class="spongagge"><?php _e('Max Date', 'woocommerce-checkout-manager'); ?></span></td>
60
 
61
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_max_yy]" placeholder="<?php _e('2013', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('yy', 'woocommerce-checkout-manager'); ?>" value="" /></td>
62
 
63
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_max_mm]" placeholder="<?php _e('10', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('mm', 'woocommerce-checkout-manager'); ?>" value="" /></td>
64
 
65
+ <td style="display:none;" class="hide_stuff_color hide_stuff_days"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][single_max_dd]" placeholder="<?php _e('25', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('dd', 'woocommerce-checkout-manager'); ?>" value="" /></td>
66
 
67
+ <td class="more_toggler1" style="text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][checkbox]" type="checkbox" title="<?php esc_attr_e('Add/Remove Required Attribute', 'woocommerce-checkout-manager'); ?>" value="" /></td>
68
 
69
  <td class="more_toggler1" style="text-align:center;">
70
+ <select name="wccs_settings[buttons][<?php echo $i; ?>][position]" > <!--Call run() function-->
71
+ <option value="form-row-wide" ><?php _e('Wide', 'woocommerce-checkout-manager'); ?></option>
72
+ <option value="form-row-first" ><?php _e('Left', 'woocommerce-checkout-manager'); ?></option>
73
+ <option value="form-row-last" ><?php _e('Right', 'woocommerce-checkout-manager'); ?></option>
74
+ </select>
75
  </td>
76
 
77
+ <td class="more_toggler1" style="text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][clear_row]" type="checkbox" title="<?php esc_attr_e('Clear Row', 'woocommerce-checkout-manager'); ?>" value=" " /></td>
78
 
79
+ <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][deny_checkout]" type="checkbox" title="<?php esc_attr_e('Deny Checkout', 'woocommerce-checkout-manager'); ?>" value=" " /></td>
80
 
81
+ <td class="filter_field_tog add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Filter Toggler', 'woocommerce-checkout-manager'); ?></td>
82
 
83
+ <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" title="<?php esc_attr_e('Remove tax', 'woocommerce-checkout-manager'); ?>" value=" " /></td>
84
 
85
+ <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" title="<?php esc_attr_e('Deny Receipt', 'woocommerce-checkout-manager'); ?>" value=" " /></td>
86
+ <!--
87
+ <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][add_amount]" type="checkbox" title="<?php esc_attr_e('Add Amount', 'woocommerce-checkout-manager'); ?>" value=" " /></td>
88
+ -->
89
+ <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][fee_name]" type="text" title="<?php esc_attr_e('Amount Name', 'woocommerce-checkout-manager'); ?>" value="" placeholder="<?php _e('My Custom Charge', 'woocommerce-checkout-manager'); ?>" /></td>
90
 
91
+ <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][add_amount_field]" type="text" title="<?php esc_attr_e('Add Amount Field', 'woocommerce-checkout-manager'); ?>" value="" placeholder="50" /></td>
92
 
93
+ <td class="filter_field add_amount_field hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_time hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][conditional_parent_use]" type="checkbox" title="<?php esc_attr_e('Conditional Field On', 'woocommerce-checkout-manager'); ?>" value=" " /></td>
94
 
95
+ <td class="condition_tick" style="display:none;text-align:center;"><input name="wccs_settings[buttons][<?php echo $i; ?>][conditional_parent]" type="checkbox" title="<?php esc_attr_e('Conditional Parent', 'woocommerce-checkout-manager'); ?>" value=" " /></td>
96
 
97
+ <td class="more_toggler1"><input placeholder="<?php _e('My Field Name', 'woocommerce-checkout-manager'); ?>" type="text" name="wccs_settings[buttons][<?php echo $i; ?>][label]" title="<?php esc_attr_e('Label of the New Field', 'woocommerce-checkout-manager'); ?>" value="" /></td>
98
 
99
+ <td class="more_toggler1"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][placeholder]" placeholder="<?php _e('Example red', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('Placeholder - Preview of Data to Input', 'woocommerce-checkout-manager'); ?>" value="" /></td>
100
 
101
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][chosen_valt]" placeholder="<?php _e('Yes', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('Chosen value for conditional', 'woocommerce-checkout-manager'); ?>" value="" /></td>
102
 
103
+ <td style="display:none;" class="condition_tick"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][conditional_tie]" placeholder="<?php _e('Parent Abbr. Name', 'woocommerce-checkout-manager'); ?>" title="<?php esc_attr_e('Parent Abbr. Name', 'woocommerce-checkout-manager'); ?>" value="" /></td>
104
 
105
+ <td style="display:none;" class="filter_field"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][colorpickerd]" id="billing-colorpic<?php echo $i; ?>" title="<?php esc_attr_e('Default Color', 'woocommerce-checkout-manager'); ?>" value="#000000" /></td>
106
 
107
  <td style="display:none;" class="filter_field">
108
+ <select name="wccs_settings[buttons][<?php echo $i; ?>][colorpickertype]" > <!--Call run() function-->
109
+ <option value="farbtastic" ><?php _e('Farbtastic', 'woocommerce-checkout-manager'); ?></option>
110
+ <option value="iris" ><?php _e('Iris', 'woocommerce-checkout-manager'); ?></option>
111
+ </select>
112
  </td>
113
 
114
  <td style="display:none;text-align:center;" class="filter_field"><input name="wccs_settings[buttons][<?php echo $i; ?>][user_role]" type="checkbox" value="" /></td>
119
 
120
  <td style="display:none;" class="filter_field add_amount_field hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c condition_tick add_amount_field"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][extra_class]" value="" /></td>
121
 
122
+ <td style="display:none;" class="hide_stuff_change"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][changenamep]" id="billing-colorpic<?php echo $i; ?>" placeholder="<?php _e('Billing Details', 'woocommerce-checkout-manager'); ?>" value="" /></td>
123
 
124
+ <td style="display:none;" class="hide_stuff_change"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][changename]" id="billing-colorpic<?php echo $i; ?>" placeholder="<?php _e('Bill Form', 'woocommerce-checkout-manager'); ?>" value="" /></td>
125
 
126
+ <td style="display:none;text-align:center;" class="hide_stuff_op wccm1"><input type="checkbox" name="wccs_settings[buttons][<?php echo $i; ?>][fancy]" title="<?php esc_attr_e('Adapt to woocommerce style', 'woocommerce-checkout-manager'); ?>" value="" /></td>
127
 
128
+ <td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][force_title2]" value="" placeholder="<?php _e('Name Guide', 'woocommerce-checkout-manager'); ?>" /></td>
129
 
130
  <td class="hide_stuff_op wccm1" style="display:none;"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][option_array]" value="" placeholder="Option 1 || Option 2 || Option 3 || Option 4" /></td>
131
 
132
+ <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Options Toggler', 'woocommerce-checkout-manager'); ?></td>
133
 
134
+ <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change_tog hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Swapper Toggler', 'woocommerce-checkout-manager'); ?></td>
135
  <!--
136
+ <td class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_timef hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;"><?php _e('Time Toggler', 'woocommerce-checkout-manager'); ?></td>
137
 
138
+ <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager'); ?></td>
139
  -->
140
+ <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager'); ?></td>
141
 
142
+ <td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager'); ?></td>
143
 
144
  <td class="more_toggler1">
145
+ <select name="wccs_settings[buttons][<?php echo $i; ?>][type]"> <!--Call run() function-->
146
+ <option value="wooccmtext"><?php _e('Text Input', 'woocommerce-checkout-manager'); ?></option>
147
+ <option value="wooccmtextarea"><?php _e('Textarea', 'woocommerce-checkout-manager'); ?></option>
148
+ <option value="wooccmpassword"><?php _e('Password', 'woocommerce-checkout-manager'); ?></option>
149
+ <option value="wooccmradio"><?php _e('Radio Buttons', 'woocommerce-checkout-manager'); ?></option>
150
+ <option value="checkbox_wccm"><?php _e('Check Box', 'woocommerce-checkout-manager'); ?></option>
151
+ <option value="wooccmselect"><?php _e('Select Options', 'woocommerce-checkout-manager'); ?></option>
152
+ <!--<option value="datepicker"><?php _e('Date Picker', 'woocommerce-checkout-manager'); ?></option>
153
+ <option value="time"><?php _e('Time Picker', 'woocommerce-checkout-manager'); ?></option>-->
154
+ <option value="changename"><?php _e('Text/ Html Swapper', 'woocommerce-checkout-manager'); ?></option>
155
+ <option value="colorpicker"><?php _e('Color Picker', 'woocommerce-checkout-manager'); ?></option>
156
+ <option value="heading"><?php _e('Heading', 'woocommerce-checkout-manager'); ?></option>
157
+ <option value="multiselect"><?php _e('Multi-Select', 'woocommerce-checkout-manager'); ?></option>
158
+ <option value="multicheckbox" ><?php _e('Multi-Checkbox', 'woocommerce-checkout-manager'); ?></option>
159
+ <option value="wooccmcountry"><?php _e('Country', 'woocommerce-checkout-manager'); ?></option>
160
+ <option value="wooccmstate"><?php _e('State', 'woocommerce-checkout-manager'); ?></option>
161
+ <option value="wooccmupload"><?php _e('File Picker', 'woocommerce-checkout-manager'); ?></option>
162
+ </select>
163
  </td>
164
 
165
+ <td class="more_toggler1"><input type="text" name="wccs_settings[buttons][<?php echo $i; ?>][cow]" placeholder="MyField" title="<?php esc_attr_e('Abbreviation (No spaces)', 'woocommerce-checkout-manager'); ?>" value="" <?php if (empty($options['checkness']['abbreviation'])) {
166
+ echo 'readonly="readonly"';
167
+ } ?> /></td>
includes/templates/admin/woocheckout-additional-tbody.php CHANGED
@@ -151,11 +151,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
151
  <td class="filter_field" style="display:none;text-align:center;">
152
  <input name="wccs_settings[buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" value="true" <?php if ( !empty ($field['deny_receipt'])) echo "checked='checked'"; ?> />
153
  </td>
154
-
155
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
156
  <input name="wccs_settings[buttons][<?php echo $i; ?>][add_amount]" type="checkbox" value="true" <?php if ( !empty ($field['add_amount'])) echo "checked='checked'"; ?> />
157
  </td>
158
-
159
  <td class="add_amount_field" style="display:none;text-align:center;">
160
  <input name="wccs_settings[buttons][<?php echo $i; ?>][fee_name]" type="text" value="<?php echo $field['fee_name']; ?>" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" />
161
  </td>
@@ -267,8 +267,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
267
  <option value="wooccmradio" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmradio' ); ?>><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
268
  <option value="checkbox_wccm" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'checkbox_wccm' ); ?>><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
269
  <option value="wooccmselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmselect' ); ?>><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
270
- <option value="datepicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'datepicker' ); ?>><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
271
- <option value="changename" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'changename' ); ?>><?php _e('Text/ Html Swapper','woocommerce-checkout-manager'); ?></option>
272
  <option value="time" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'time' ); ?>><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>
273
  <option value="colorpicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'colorpicker' ); ?>><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
274
  <option value="heading" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'heading' ); ?>><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
151
  <td class="filter_field" style="display:none;text-align:center;">
152
  <input name="wccs_settings[buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" value="true" <?php if ( !empty ($field['deny_receipt'])) echo "checked='checked'"; ?> />
153
  </td>
154
+ <!--
155
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
156
  <input name="wccs_settings[buttons][<?php echo $i; ?>][add_amount]" type="checkbox" value="true" <?php if ( !empty ($field['add_amount'])) echo "checked='checked'"; ?> />
157
  </td>
158
+ -->
159
  <td class="add_amount_field" style="display:none;text-align:center;">
160
  <input name="wccs_settings[buttons][<?php echo $i; ?>][fee_name]" type="text" value="<?php echo $field['fee_name']; ?>" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" />
161
  </td>
267
  <option value="wooccmradio" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmradio' ); ?>><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
268
  <option value="checkbox_wccm" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'checkbox_wccm' ); ?>><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
269
  <option value="wooccmselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmselect' ); ?>><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
270
+ <!--<option value="datepicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'datepicker' ); ?>><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
271
+ <option value="changename" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'changename' ); ?>><?php _e('Text/ Html Swapper','woocommerce-checkout-manager'); ?></option>-->
272
  <option value="time" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'time' ); ?>><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>
273
  <option value="colorpicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'colorpicker' ); ?>><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
274
  <option value="heading" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'heading' ); ?>><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
includes/templates/admin/woocheckout-additional-thead.php CHANGED
@@ -78,9 +78,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
78
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Remove Tax' , 'woocommerce-checkout-manager' ); ?></th>
79
 
80
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Receipt' , 'woocommerce-checkout-manager' ); ?></th>
81
-
82
  <th class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c add_amount" style="display:none;" width="5%"><?php _e('Add Amount' , 'woocommerce-checkout-manager' ); ?></th>
83
-
84
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Amount Name' , 'woocommerce-checkout-manager' ); ?></th>
85
 
86
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Enter Amount' , 'woocommerce-checkout-manager' ); ?></th>
78
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Remove Tax' , 'woocommerce-checkout-manager' ); ?></th>
79
 
80
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Receipt' , 'woocommerce-checkout-manager' ); ?></th>
81
+ <!--
82
  <th class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c add_amount" style="display:none;" width="5%"><?php _e('Add Amount' , 'woocommerce-checkout-manager' ); ?></th>
83
+ -->
84
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Amount Name' , 'woocommerce-checkout-manager' ); ?></th>
85
 
86
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Enter Amount' , 'woocommerce-checkout-manager' ); ?></th>
includes/templates/admin/woocheckout-additional.php CHANGED
@@ -13,7 +13,8 @@
13
  <tbody>
14
 
15
  <?php
16
- if ($fields = WOOCCM_Fields::get_additional_fields()) {
 
17
  foreach ($fields as $i => $field) {
18
  ?>
19
 
13
  <tbody>
14
 
15
  <?php
16
+ if ($fields = WOOCCM()->field->additional->get_fields('old')) {
17
+
18
  foreach ($fields as $i => $field) {
19
  ?>
20
 
includes/templates/admin/woocheckout-billing-clone.php CHANGED
@@ -84,9 +84,9 @@ if ( !defined( 'ABSPATH' ) )
84
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" title="<?php esc_attr_e( 'Remove tax', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
85
 
86
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" title="<?php esc_attr_e( 'Deny Receipt', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
87
-
88
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" title="<?php esc_attr_e( 'Add Amount', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
89
-
90
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fee_name]" type="text" title="<?php esc_attr_e( 'Amount Name', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" /></td>
91
 
92
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount_field]" type="text" title="<?php esc_attr_e( 'Add Amount Field', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="50" /></td>
@@ -132,6 +132,7 @@ if ( !defined( 'ABSPATH' ) )
132
 
133
  <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
134
  -->
 
135
  <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
136
 
137
  <td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?></td>
@@ -144,8 +145,8 @@ if ( !defined( 'ABSPATH' ) )
144
  <option value="wooccmradio" ><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
145
  <option value="checkbox_wccm" ><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
146
  <option value="wooccmselect" ><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
147
- <option value="datepicker" ><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
148
- <option value="time" ><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>
149
  <option value="colorpicker" ><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
150
  <option value="heading" ><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
151
  <option value="multiselect" ><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
84
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" title="<?php esc_attr_e( 'Remove tax', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
85
 
86
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" title="<?php esc_attr_e( 'Deny Receipt', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
87
+ <!--
88
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" title="<?php esc_attr_e( 'Add Amount', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
89
+ -->
90
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fee_name]" type="text" title="<?php esc_attr_e( 'Amount Name', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" /></td>
91
 
92
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount_field]" type="text" title="<?php esc_attr_e( 'Add Amount Field', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="50" /></td>
132
 
133
  <td class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op more_toggler1 more_toggler1c hide_stuff_days" style="display:none;"><?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?></td>
134
  -->
135
+
136
  <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1"><?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?></td>
137
 
138
  <td class="filter_field add_amount_field condition_tick hide_stuff_time hide_stuff_change hide_stuff_opcheck hide_stuff_color hide_stuff_op more_toggler more_toggler1c"><?php _e('More Toggler', 'woocommerce-checkout-manager' ); ?></td>
145
  <option value="wooccmradio" ><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
146
  <option value="checkbox_wccm" ><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
147
  <option value="wooccmselect" ><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
148
+ <!--<option value="datepicker" ><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
149
+ <option value="time" ><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>-->
150
  <option value="colorpicker" ><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
151
  <option value="heading" ><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
152
  <option value="multiselect" ><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
includes/templates/admin/woocheckout-billing-tbody.php CHANGED
@@ -151,11 +151,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
151
  <td class="filter_field" style="display:none;text-align:center;">
152
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" value="true" <?php if ( !empty ($field['deny_receipt'])) echo "checked='checked'"; ?> />
153
  </td>
154
-
155
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
156
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" value="true" <?php if ( !empty ($field['add_amount'])) echo "checked='checked'"; ?> />
157
  </td>
158
-
159
  <td class="add_amount_field" style="display:none;text-align:center;">
160
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fee_name]" type="text" value="<?php echo ( !empty( $field['fee_name'] ) ? $field['fee_name'] : '' ); ?>" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" />
161
  </td>
@@ -239,7 +239,6 @@ if ( !defined( 'ABSPATH' ) ) exit;
239
  <?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?>
240
  </td>
241
  -->
242
-
243
  <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1">
244
  <?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?>
245
  </td>
@@ -256,8 +255,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
256
  <option value="wooccmradio" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmradio' ); ?>><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
257
  <option value="checkbox_wccm" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'checkbox_wccm' ); ?>><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
258
  <option value="wooccmselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmselect' ); ?>><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
259
- <option value="datepicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'datepicker' ); ?>><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
260
- <option value="time" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'time' ); ?>><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>
261
  <option value="colorpicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'colorpicker' ); ?>><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
262
  <option value="heading" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'heading' ); ?>><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
263
  <option value="multiselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'multiselect' ); ?>><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
151
  <td class="filter_field" style="display:none;text-align:center;">
152
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" value="true" <?php if ( !empty ($field['deny_receipt'])) echo "checked='checked'"; ?> />
153
  </td>
154
+ <!--
155
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
156
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" value="true" <?php if ( !empty ($field['add_amount'])) echo "checked='checked'"; ?> />
157
  </td>
158
+ -->
159
  <td class="add_amount_field" style="display:none;text-align:center;">
160
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][fee_name]" type="text" value="<?php echo ( !empty( $field['fee_name'] ) ? $field['fee_name'] : '' ); ?>" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" />
161
  </td>
239
  <?php _e('Date Toggler', 'woocommerce-checkout-manager' ); ?>
240
  </td>
241
  -->
 
242
  <td style="display:none;" class="filter_field add_amount_field hide_stuff_time condition_tick hide_stuff_change hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1">
243
  <?php _e('Hidden Toggler', 'woocommerce-checkout-manager' ); ?>
244
  </td>
255
  <option value="wooccmradio" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmradio' ); ?>><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
256
  <option value="checkbox_wccm" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'checkbox_wccm' ); ?>><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
257
  <option value="wooccmselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmselect' ); ?>><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
258
+ <!--<option value="datepicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'datepicker' ); ?>><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
259
+ <option value="time" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'time' ); ?>><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>-->
260
  <option value="colorpicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'colorpicker' ); ?>><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
261
  <option value="heading" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'heading' ); ?>><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
262
  <option value="multiselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'multiselect' ); ?>><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
includes/templates/admin/woocheckout-billing-thead.php CHANGED
@@ -77,9 +77,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
77
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Remove Tax' , 'woocommerce-checkout-manager' ); ?></th>
78
 
79
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Receipt' , 'woocommerce-checkout-manager' ); ?></th>
80
-
81
  <th class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c add_amount" style="display:none;" width="5%"><?php _e('Add Amount' , 'woocommerce-checkout-manager' ); ?></th>
82
-
83
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Amount Name' , 'woocommerce-checkout-manager' ); ?></th>
84
 
85
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Enter Amount' , 'woocommerce-checkout-manager' ); ?></th>
@@ -115,7 +115,6 @@ if ( !defined( 'ABSPATH' ) ) exit;
115
  <th class="hide_stuff_op wccm1" style="display:none;" width="60%"><?php _e('List of Options (Separated by ' , 'woocommerce-checkout-manager' ); ?><span class="toggle_shower current_opener">||</span> )</th>
116
 
117
  <th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
118
-
119
  <!--
120
  <th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_opcheck hide_stuff_op hide_stuff_change hide_stuff_time_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
121
 
77
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Remove Tax' , 'woocommerce-checkout-manager' ); ?></th>
78
 
79
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Receipt' , 'woocommerce-checkout-manager' ); ?></th>
80
+ <!--
81
  <th class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c add_amount" style="display:none;" width="5%"><?php _e('Add Amount' , 'woocommerce-checkout-manager' ); ?></th>
82
+ -->
83
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Amount Name' , 'woocommerce-checkout-manager' ); ?></th>
84
 
85
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Enter Amount' , 'woocommerce-checkout-manager' ); ?></th>
115
  <th class="hide_stuff_op wccm1" style="display:none;" width="60%"><?php _e('List of Options (Separated by ' , 'woocommerce-checkout-manager' ); ?><span class="toggle_shower current_opener">||</span> )</th>
116
 
117
  <th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
 
118
  <!--
119
  <th style="cursor:pointer;text-align:center;font-size:30px;display:none;" class="filter_field add_amount_field condition_tick hide_stuff_opcheck hide_stuff_op hide_stuff_change hide_stuff_time_tog hide_stuff_color more_toggler1 more_toggler1c" width="2%"><span class="toggle_shower">&equiv;</span></th>
120
 
includes/templates/admin/woocheckout-billing.php CHANGED
@@ -13,9 +13,9 @@
13
  <tbody>
14
 
15
  <?php
16
- if ($fields = WOOCCM_Fields::get_billing_fields()) {
17
-
18
- $billing = WOOCCM_Fields::get_default_address_fields();
19
 
20
  foreach ($fields as $i => $field) {
21
  ?>
@@ -29,7 +29,7 @@
29
 
30
  <?php require( WOOCCM_PLUGIN_DIR . 'includes/templates/admin/woocheckout-billing-tbody.php' ); ?>
31
 
32
- <?php if (in_array($field['cow'], $billing)) { ?>
33
  <td style="text-align:center;">
34
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][disabled]" type="checkbox" value="true" <?php if (!empty($field['disabled'])) echo "checked='checked'"; ?> />
35
  </td>
13
  <tbody>
14
 
15
  <?php
16
+ if ($fields = WOOCCM()->field->billing->get_fields('old')) {
17
+
18
+ $defaults = WOOCCM()->field->billing->get_defaults();
19
 
20
  foreach ($fields as $i => $field) {
21
  ?>
29
 
30
  <?php require( WOOCCM_PLUGIN_DIR . 'includes/templates/admin/woocheckout-billing-tbody.php' ); ?>
31
 
32
+ <?php if (in_array($field['cow'], $defaults)) { ?>
33
  <td style="text-align:center;">
34
  <input name="wccs_settings3[billing_buttons][<?php echo $i; ?>][disabled]" type="checkbox" value="true" <?php if (!empty($field['disabled'])) echo "checked='checked'"; ?> />
35
  </td>
includes/templates/admin/woocheckout-shipping-clone.php CHANGED
@@ -84,9 +84,9 @@ if ( !defined( 'ABSPATH' ) )
84
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" title="<?php esc_attr_e( 'Remove tax', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
85
 
86
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" title="<?php esc_attr_e( 'Deny Receipt', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
87
-
88
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" title="<?php esc_attr_e( 'Add Amount', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
89
-
90
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][fee_name]" type="text" title="<?php esc_attr_e( 'Amount Name', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" /></td>
91
 
92
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][add_amount_field]" type="text" title="<?php esc_attr_e( 'Add Amount Field', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="50" /></td>
@@ -145,8 +145,8 @@ if ( !defined( 'ABSPATH' ) )
145
  <option value="wooccmradio" ><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
146
  <option value="checkbox_wccm" ><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
147
  <option value="wooccmselect" ><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
148
- <option value="datepicker" ><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
149
- <option value="time" ><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>
150
  <option value="colorpicker" ><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
151
  <option value="heading" ><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
152
  <option value="multiselect" ><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
84
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][tax_remove]" type="checkbox" title="<?php esc_attr_e( 'Remove tax', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
85
 
86
  <td class="filter_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" title="<?php esc_attr_e( 'Deny Receipt', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
87
+ <!--
88
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" title="<?php esc_attr_e( 'Add Amount', 'woocommerce-checkout-manager' ); ?>" value=" " /></td>
89
+ -->
90
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][fee_name]" type="text" title="<?php esc_attr_e( 'Amount Name', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" /></td>
91
 
92
  <td class="add_amount_field" style="display:none;text-align:center;"><input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][add_amount_field]" type="text" title="<?php esc_attr_e( 'Add Amount Field', 'woocommerce-checkout-manager' ); ?>" value="" placeholder="50" /></td>
145
  <option value="wooccmradio" ><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
146
  <option value="checkbox_wccm" ><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
147
  <option value="wooccmselect" ><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
148
+ <!--<option value="datepicker" ><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
149
+ <option value="time" ><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>-->
150
  <option value="colorpicker" ><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
151
  <option value="heading" ><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
152
  <option value="multiselect" ><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
includes/templates/admin/woocheckout-shipping-tbody.php CHANGED
@@ -151,11 +151,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
151
  <td class="filter_field" style="display:none;text-align:center;">
152
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" value="true" <?php if ( !empty ($field['deny_receipt'])) echo "checked='checked'"; ?> />
153
  </td>
154
-
155
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
156
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" value="true" <?php if ( !empty ($field['add_amount'])) echo "checked='checked'"; ?> />
157
  </td>
158
-
159
  <td class="add_amount_field" style="display:none;text-align:center;">
160
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][fee_name]" type="text" value="<?php echo ( isset( $field['fee_name'] ) ? $field['fee_name'] : '' ); ?>" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" />
161
  </td>
@@ -255,8 +255,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
255
  <option value="wooccmradio" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmradio' ); ?>><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
256
  <option value="checkbox_wccm" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'checkbox_wccm' ); ?>><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
257
  <option value="wooccmselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmselect' ); ?>><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
258
- <option value="datepicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'datepicker' ); ?>><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
259
- <option value="time" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'time' ); ?>><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>
260
  <option value="colorpicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'colorpicker' ); ?>><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
261
  <option value="heading" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'heading' ); ?>><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
262
  <option value="multiselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'multiselect' ); ?>><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
151
  <td class="filter_field" style="display:none;text-align:center;">
152
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][deny_receipt]" type="checkbox" value="true" <?php if ( !empty ($field['deny_receipt'])) echo "checked='checked'"; ?> />
153
  </td>
154
+ <!--
155
  <td class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c" style="display:none;text-align:center;">
156
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][add_amount]" type="checkbox" value="true" <?php if ( !empty ($field['add_amount'])) echo "checked='checked'"; ?> />
157
  </td>
158
+ -->
159
  <td class="add_amount_field" style="display:none;text-align:center;">
160
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][fee_name]" type="text" value="<?php echo ( isset( $field['fee_name'] ) ? $field['fee_name'] : '' ); ?>" placeholder="<?php _e('My Custom Charge','woocommerce-checkout-manager'); ?>" />
161
  </td>
255
  <option value="wooccmradio" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmradio' ); ?>><?php _e('Radio Buttons','woocommerce-checkout-manager'); ?></option>
256
  <option value="checkbox_wccm" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'checkbox_wccm' ); ?>><?php _e('Check Box','woocommerce-checkout-manager'); ?></option>
257
  <option value="wooccmselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'wooccmselect' ); ?>><?php _e('Select Options','woocommerce-checkout-manager'); ?></option>
258
+ <!--<option value="datepicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'datepicker' ); ?>><?php _e('Date Picker','woocommerce-checkout-manager'); ?></option>
259
+ <option value="time" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'time' ); ?>><?php _e('Time Picker','woocommerce-checkout-manager'); ?></option>-->
260
  <option value="colorpicker" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'colorpicker' ); ?>><?php _e('Color Picker','woocommerce-checkout-manager'); ?></option>
261
  <option value="heading" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'heading' ); ?>><?php _e('Heading','woocommerce-checkout-manager'); ?></option>
262
  <option value="multiselect" <?php (!isset($field['type'])) ? '' : selected( $field['type'], 'multiselect' ); ?>><?php _e('Multi-Select','woocommerce-checkout-manager'); ?></option>
includes/templates/admin/woocheckout-shipping-thead.php CHANGED
@@ -76,9 +76,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
76
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Remove Tax' , 'woocommerce-checkout-manager' ); ?></th>
77
 
78
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Receipt' , 'woocommerce-checkout-manager' ); ?></th>
79
-
80
  <th class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c add_amount" style="display:none;" width="5%"><?php _e('Add Amount' , 'woocommerce-checkout-manager' ); ?></th>
81
-
82
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Amount Name' , 'woocommerce-checkout-manager' ); ?></th>
83
 
84
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Enter Amount' , 'woocommerce-checkout-manager' ); ?></th>
76
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Remove Tax' , 'woocommerce-checkout-manager' ); ?></th>
77
 
78
  <th class="filter_field" style="display:none;" width="5%"><?php _e('Deny Receipt' , 'woocommerce-checkout-manager' ); ?></th>
79
+ <!--
80
  <th class="filter_field condition_tick hide_stuff_change hide_stuff_time hide_stuff_opcheck hide_stuff_op hide_stuff_color more_toggler1 more_toggler1c add_amount" style="display:none;" width="5%"><?php _e('Add Amount' , 'woocommerce-checkout-manager' ); ?></th>
81
+ -->
82
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Amount Name' , 'woocommerce-checkout-manager' ); ?></th>
83
 
84
  <th class="add_amount_field" style="display:none;" width="5%"><?php _e('Enter Amount' , 'woocommerce-checkout-manager' ); ?></th>
includes/templates/admin/woocheckout-shipping.php CHANGED
@@ -13,18 +13,9 @@
13
  <tbody>
14
 
15
  <?php
16
- if ($fields = WOOCCM_Fields::get_shipping_fields()) {
17
- $shipping = array(
18
- 'country',
19
- 'first_name',
20
- 'last_name',
21
- 'company',
22
- 'address_1',
23
- 'address_2',
24
- 'city',
25
- 'state',
26
- 'postcode'
27
- );
28
 
29
  foreach ($fields as $i => $field) {
30
  ?>
@@ -38,7 +29,7 @@
38
 
39
  <?php require(WOOCCM_PLUGIN_DIR . 'includes/templates/admin/woocheckout-shipping-tbody.php'); ?>
40
 
41
- <?php if (in_array($field['cow'], $shipping)) { ?>
42
  <td style="text-align:center;">
43
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][disabled]" type="checkbox" value="true" <?php if (!empty($field['disabled'])) echo "checked='checked'"; ?> />
44
  </td>
13
  <tbody>
14
 
15
  <?php
16
+ if ($fields = WOOCCM()->field->shipping->get_fields('old')) {
17
+
18
+ $defaults = WOOCCM()->field->shipping->get_defaults();
 
 
 
 
 
 
 
 
 
19
 
20
  foreach ($fields as $i => $field) {
21
  ?>
29
 
30
  <?php require(WOOCCM_PLUGIN_DIR . 'includes/templates/admin/woocheckout-shipping-tbody.php'); ?>
31
 
32
+ <?php if (in_array($field['cow'], $defaults)) { ?>
33
  <td style="text-align:center;">
34
  <input name="wccs_settings2[shipping_buttons][<?php echo $i; ?>][disabled]" type="checkbox" value="true" <?php if (!empty($field['disabled'])) echo "checked='checked'"; ?> />
35
  </td>
includes/templates/functions/required/add_required.php CHANGED
@@ -16,8 +16,6 @@ function wooccm_custom_checkout_process() {
16
 
17
  foreach ($buttons as $btn) {
18
 
19
- //error_log(json_encode($btn));
20
-
21
  foreach ($woocommerce->cart->cart_contents as $key => $values) {
22
  $multiproductsx = ( isset($btn['single_p']) ? $btn['single_p'] : '' );
23
  $show_field_single = ( isset($btn['single_px']) ? $btn['single_px'] : '' );
16
 
17
  foreach ($buttons as $btn) {
18
 
 
 
19
  foreach ($woocommerce->cart->cart_contents as $key => $values) {
20
  $multiproductsx = ( isset($btn['single_p']) ? $btn['single_p'] : '' );
21
  $show_field_single = ( isset($btn['single_px']) ? $btn['single_px'] : '' );
new/class-wooccm-admin.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!class_exists('WOOCCM_Field_Admin')) {
3
+
4
+ class WOOCCM_Field_Admin {
5
+
6
+ protected static $instance;
7
+
8
+ function enqueue_scripts() {
9
+
10
+ global $current_section;
11
+
12
+ //wp_register_style('woocommerce_admin_marketplace_styles', WC()->plugin_url() . '/assets/css/marketplace-suggestions.css', array(), WC_VERSION);
13
+
14
+ wp_register_style('wooccm-admin', plugins_url('assets/css/wooccm-admin.css', WOOCCM_PLUGIN_FILE), array('media-views', /* 'woocommerce_admin_marketplace_styles' */), WOOCCM_PLUGIN_VERSION, 'all');
15
+
16
+ wp_register_script('wooccm-modal', plugins_url('assets/js/wooccm-modal.js', WOOCCM_PLUGIN_FILE), array('jquery', 'jquery-ui-datepicker', 'backbone'), WOOCCM_PLUGIN_VERSION, true);
17
+
18
+ wp_register_script('wooccm-admin', plugins_url('assets/js/wooccm-admin.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
19
+
20
+ wp_localize_script('wooccm-admin', 'wooccm_admin', array(
21
+ 'ajax_url' => admin_url('admin-ajax.php?section=' . $current_section),
22
+ 'nonce' => wp_create_nonce('wooccm_admin'),
23
+ 'field' => array(
24
+ 'args' => WOOCCM()->field->billing->get_args(),
25
+ ),
26
+ 'message' => array(
27
+ 'remove' => esc_html__('Are you sure you want to remove this field?', 'woocommerce-checkout-manager')
28
+ )
29
+ ));
30
+
31
+
32
+ if (isset($_GET['tab']) && $_GET['tab'] === WOOCCM_PREFIX) {
33
+ wp_enqueue_style('wooccm-admin');
34
+ wp_enqueue_script('wooccm-admin');
35
+ wp_enqueue_script('wooccm-modal');
36
+ }
37
+ }
38
+
39
+ function add_beta_badge() {
40
+ ?>
41
+ <style>
42
+ body #adminmenu #toplevel_page_woocommerce a[href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(WOOCCM_PREFIX) . '&section=billing'); ?>"]:before {
43
+ content: 'BETA';
44
+ color: #fff;
45
+ background-color: #21c2f8;
46
+ padding: 1px 7px;
47
+ font-size: 9px;
48
+ font-weight: 700;
49
+ border-radius: 10px;
50
+ position: absolute;
51
+ right: 15px;
52
+ line-height: 16px;
53
+ font-style: italic;
54
+ }
55
+ </style>
56
+ <?php
57
+ }
58
+
59
+ function add_tab($settings_tabs) {
60
+ $settings_tabs[WOOCCM_PREFIX] = esc_html__('Checkout', 'woocommerce-checkout-manager');
61
+ return $settings_tabs;
62
+ }
63
+
64
+ function add_section_general() {
65
+
66
+ global $current_section;
67
+
68
+ if ('' == $current_section) {
69
+ if ($options = get_option('wccs_settings', array())) {
70
+ include_once('pages/general.php');
71
+ }
72
+ }
73
+ }
74
+
75
+ function add_section_orders() {
76
+
77
+ global $current_section;
78
+
79
+ if ('shipping' == $current_section) {
80
+ if ($options = get_option('wccs_settings', array())) {
81
+ include_once('pages/orders.php');
82
+ }
83
+ }
84
+ }
85
+
86
+ function add_section_advanced() {
87
+ global $current_section;
88
+ if ('advanced' == $current_section) {
89
+ if ($options = get_option('wccs_settings', array())) {
90
+ require_once('pages/advanced.php');
91
+ }
92
+ }
93
+ }
94
+
95
+ function add_menu_page() {
96
+ //add_submenu_page('woocommerce', esc_html__('Checkout', 'woocommerce-checkout-manager'), esc_html__('Checkout', 'woocommerce-checkout-manager'), 'manage_options', admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(WOOCCM_PREFIX)));
97
+ add_submenu_page('woocommerce', esc_html__('Checkout', 'woocommerce-checkout-manager'), esc_html__('Checkout', 'woocommerce-checkout-manager'), 'manage_options', admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(WOOCCM_PREFIX) . '&section=billing'));
98
+ }
99
+
100
+ function init() {
101
+ add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
102
+ add_action('admin_head', array($this, 'add_beta_badge'));
103
+ add_action('admin_menu', array($this, 'add_menu_page'));
104
+ add_filter('woocommerce_settings_tabs_array', array($this, 'add_tab'), 50);
105
+ //add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section_general'), 99);
106
+ //add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section_orders'), 99);
107
+ //add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section_advanced'), 99);
108
+ //add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_section_billing'));
109
+ }
110
+
111
+ public static function instance() {
112
+ if (!isset(self::$instance)) {
113
+ self::$instance = new self();
114
+ self::$instance->init();
115
+ }
116
+ return self::$instance;
117
+ }
118
+
119
+ }
120
+
121
+ WOOCCM_Field_Admin::instance();
122
+ }
new/class-wooccm-install.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WOOCCM_Install {
4
+
5
+ public static function install() {
6
+
7
+ // Check if we are not already running this routine.
8
+ if ('yes' === get_transient('wooccm_installing')) {
9
+ return;
10
+ }
11
+
12
+ // If we made it till here nothing is running yet, lets set the transient now.
13
+ set_transient('wooccm_installing', 'yes', MINUTE_IN_SECONDS * 10);
14
+ set_transient('wooccm-first-rating', true, MONTH_IN_SECONDS);
15
+
16
+ wooccm_install();
17
+ }
18
+
19
+ }
new/class-wooccm-notices.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WOOCCM_Notices {
4
+
5
+ protected static $_instance;
6
+
7
+ public function __construct() {
8
+ $this->init();
9
+ }
10
+
11
+ public static function instance() {
12
+ if (is_null(self::$_instance)) {
13
+ self::$_instance = new self();
14
+ }
15
+ return self::$_instance;
16
+ }
17
+
18
+ private function init() {
19
+ add_action('wp_ajax_wooccm_dismiss_notice', array($this, 'ajax_dismiss_notice'));
20
+ add_action('admin_notices', array($this, 'add_notices'));
21
+ add_filter('plugin_action_links_' . plugin_basename(WOOCCM_PLUGIN_FILE), array($this, 'add_action_links'));
22
+ }
23
+
24
+ public function ajax_dismiss_notice() {
25
+ if (current_user_can('manage_options')) {
26
+
27
+ if (!empty($_REQUEST) && check_admin_referer('wooccm_dismiss_notice', 'nonce')) {
28
+
29
+ if ($notice_id = ( isset($_REQUEST['notice_id']) ) ? sanitize_key($_REQUEST['notice_id']) : '') {
30
+
31
+ update_user_meta(get_current_user_id(), $notice_id, true);
32
+
33
+ wp_send_json($notice_id);
34
+ }
35
+ }
36
+ }
37
+ wp_die();
38
+ }
39
+
40
+ public function add_notices() {
41
+ if (!get_transient('wooccm-first-rating') && !get_user_meta(get_current_user_id(), 'wooccm-user-rating', true)) {
42
+ ?>
43
+ <div id="wooccm-admin-rating" class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-user-rating">
44
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
45
+ <div class="notice-image">
46
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
47
+ </div>
48
+ <div class="notice-content" style="margin-left: 15px;">
49
+ <p>
50
+ <?php printf(esc_html__('Hello! We\'ve recently acquired this plugin!', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
51
+ <br/>
52
+ <?php esc_html_e('We will do our best to improve it and include new features gradually. Please be patient and let us know about the issues and improvements that you want to see in this plugin.', 'woocommerce-checkout-manager'); ?>
53
+ </p>
54
+ <a href="<?php echo esc_url(WOOCCM_GROUP_URL); ?>" class="button-primary" target="_blank">
55
+ <?php esc_html_e('Join Community!', 'woocommerce-checkout-manager'); ?>
56
+ </a>
57
+ <a href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
58
+ <?php esc_html_e('Report a bug', 'woocommerce-checkout-manager'); ?>
59
+ </a>
60
+ <a style="margin-left: 10px;" href="https://quadlayers.com/?utm_source=wooccm_admin" target="_blank">
61
+ <?php esc_html_e('About us', 'woocommerce-checkout-manager'); ?>
62
+ </a>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <?php } ?>
67
+ <script>
68
+ (function ($) {
69
+ $('.wooccm-notice').on('click', '.notice-dismiss', function (e) {
70
+ e.preventDefault();
71
+ var notice_id = $(e.delegateTarget).data('notice_id');
72
+ $.ajax({
73
+ type: 'POST',
74
+ url: ajaxurl,
75
+ data: {
76
+ notice_id: notice_id,
77
+ action: 'wooccm_dismiss_notice',
78
+ nonce: '<?php echo wp_create_nonce('wooccm_dismiss_notice'); ?>'
79
+ },
80
+ success: function (response) {
81
+ console.log(response);
82
+ },
83
+ });
84
+ });
85
+ })(jQuery);
86
+ </script>
87
+ <?php
88
+ }
89
+
90
+ public function add_action_links($links) {
91
+
92
+ $links[] = '<a target="_blank" href="' . WOOCCM_SUPPORT_URL . '">' . esc_html__('Support', 'woocommerce-checkout-manager') . '</a>';
93
+ $links[] = '<a href="' . admin_url('admin.php?page=woocommerce-checkout-manager">') . esc_html__('Settings', 'woocommerce-checkout-manager') . '</a>';
94
+
95
+ return $links;
96
+ }
97
+
98
+ }
99
+
100
+ WOOCCM_Notices::instance();
new/class-wooccm.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class WOOCCM {
4
+
5
+ protected static $_instance;
6
+
7
+ public function __construct() {
8
+ $this->includes_old();
9
+ $this->includes();
10
+ $this->init();
11
+ }
12
+
13
+ public static function instance() {
14
+ if (is_null(self::$_instance)) {
15
+ self::$_instance = new self();
16
+ }
17
+ return self::$_instance;
18
+ }
19
+
20
+ function init() {
21
+
22
+ register_activation_hook(WOOCCM_PLUGIN_FILE, array('WOOCCM_Install', 'install'));
23
+
24
+ load_plugin_textdomain('woocommerce-checkout-manager', false, dirname(plugin_basename(__FILE__)) . '/languages/');
25
+
26
+
27
+ $this->field = new WOOCCM_Field_Controller();
28
+ }
29
+
30
+ function includes() {
31
+
32
+ // New
33
+ // -----------------------------------------------------------------------
34
+ include_once( WOOCCM_PLUGIN_DIR . 'new/class-wooccm-install.php' );
35
+ include_once( WOOCCM_PLUGIN_DIR . 'new/class-wooccm-notices.php' );
36
+ include_once( WOOCCM_PLUGIN_DIR . 'new/class-wooccm-admin.php' );
37
+ include_once( WOOCCM_PLUGIN_DIR . 'new/controller/class-field-controller.php' );
38
+ include_once( WOOCCM_PLUGIN_DIR . 'new/controller/upload.php' );
39
+ include_once( WOOCCM_PLUGIN_DIR . 'new/controller/order.php' );
40
+ include_once( WOOCCM_PLUGIN_DIR . 'new/controller/checkout.php' );
41
+ }
42
+
43
+ function includes_old() {
44
+ // Old
45
+ // -----------------------------------------------------------------------
46
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/install.php' );
47
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/functions.php' );
48
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/checkout.php' );
49
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/email.php' );
50
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/formatting.php' );
51
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/admin.php' );
52
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/template.php' );
53
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/export.php' );
54
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/classes/main.php' );
55
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/required/add_required.php' );
56
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/required/billing_required.php' );
57
+ include_once( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/required/shipping_required.php' );
58
+ }
59
+
60
+ public function register_scripts() {
61
+
62
+ // Frontend
63
+ // -----------------------------------------------------------------------
64
+
65
+ wp_register_style('wooccm', plugins_url('assets/css/wooccm.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION, 'all');
66
+
67
+ // Common
68
+ // -----------------------------------------------------------------------
69
+
70
+ wp_register_script('wooccm-order-upload', plugins_url('assets/js/wooccm-order-upload.js', WOOCCM_PLUGIN_FILE), array(), WOOCCM_PLUGIN_VERSION, true);
71
+
72
+ wp_localize_script('wooccm-order-upload', 'wooccm_upload', array(
73
+ 'ajaxurl' => admin_url('admin-ajax.php'),
74
+ 'nonce' => wp_create_nonce('wooccm_upload'),
75
+ 'message' => array(
76
+ 'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
77
+ 'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
78
+ 'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
79
+ 'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
80
+ ),
81
+ 'icons' => array(
82
+ 'interactive' => site_url('wp-includes/images/media/interactive.png'),
83
+ 'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
84
+ 'archive' => site_url('wp-includes/images/media/archive.png'),
85
+ 'audio' => site_url('wp-includes/images/media/audio.png'),
86
+ 'text' => site_url('wp-includes/images/media/text.png'),
87
+ 'video' => site_url('wp-includes/images/media/video.png')
88
+ )
89
+ ));
90
+ }
91
+
92
+ }
new/controller/checkout.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Checkout_Controller')) {
4
+
5
+ class WOOCCM_Checkout_Controller extends WOOCCM_Upload {
6
+
7
+ protected static $instance;
8
+
9
+ function ajax_checkout_attachment_upload() {
10
+
11
+ if (check_admin_referer('wooccm_upload', 'nonce') && isset($_FILES['wooccm_checkout_attachment_upload'])) {
12
+
13
+ $files = $_FILES['wooccm_checkout_attachment_upload'];
14
+
15
+ if (empty($files)) {
16
+ wc_add_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
17
+ wp_send_json_error();
18
+ }
19
+
20
+ if (count($attachment_ids = $this->process_uploads($files, 'wooccm_checkout_attachment_upload'))) {
21
+ wp_send_json_success($attachment_ids);
22
+ }
23
+ wc_add_notice(esc_html__('Unknow error.', 'woocommerce-checkout-manager'), 'error');
24
+ wp_send_json_error();
25
+ }
26
+ }
27
+
28
+ function checkout_billing_attachment_update_ids($order_id = 0) {
29
+
30
+ $fields = WOOCCM()->field->billing->get_fields('old');
31
+
32
+ $this->checkout_attachment_update_ids($order_id, 'billing_', $fields);
33
+ }
34
+
35
+ function checkout_shipping_attachment_update_ids($order_id = 0) {
36
+
37
+ $fields = WOOCCM()->field->shipping->get_fields('old');
38
+
39
+ $this->checkout_attachment_update_ids($order_id, 'shipping_', $fields);
40
+ }
41
+
42
+ function checkout_additional_attachment_update_ids($order_id = 0) {
43
+
44
+ $fields = WOOCCM()->field->additional->get_fields('old');
45
+
46
+ $this->checkout_attachment_update_ids($order_id, '', $fields);
47
+ }
48
+
49
+ function checkout_attachment_update_ids($order_id = 0, $prefix = '', $fields = array()) {
50
+
51
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
52
+
53
+ if (count($fields)) {
54
+
55
+ foreach ($fields as $id => $field) {
56
+
57
+ if ($field['type'] == 'wooccmupload') {
58
+
59
+ if ($prefix) {
60
+ $key = sprintf("_%s%s", $prefix, $field['cow']);
61
+ } else {
62
+ $key = $field['cow'];
63
+ }
64
+
65
+ if ($attachments = get_post_meta($order_id, $key, true)) {
66
+
67
+ if ($attachments = (array) explode(',', $attachments)) {
68
+
69
+ foreach ($attachments as $image_id) {
70
+
71
+ wp_update_post(array('ID' => $image_id, 'post_parent' => $order_id));
72
+
73
+ wp_update_attachment_metadata($image_id, wp_generate_attachment_metadata($image_id, get_attached_file($image_id)));
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+
82
+ function includes() {
83
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/checkout.php' );
84
+ }
85
+
86
+ function init() {
87
+ add_action('wp_ajax_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
88
+ add_action('wp_ajax_nopriv_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
89
+ add_action('woocommerce_checkout_update_order_meta', array($this, 'checkout_billing_attachment_update_ids'));
90
+ add_action('woocommerce_checkout_update_order_meta', array($this, 'checkout_shipping_attachment_update_ids'));
91
+ add_action('woocommerce_checkout_update_order_meta', array($this, 'checkout_additional_attachment_update_ids'));
92
+ }
93
+
94
+ public static function instance() {
95
+ if (!isset(self::$instance)) {
96
+ self::$instance = new self();
97
+ self::$instance->includes();
98
+ self::$instance->init();
99
+ }
100
+ return self::$instance;
101
+ }
102
+
103
+ }
104
+
105
+ WOOCCM_Checkout_Controller::instance();
106
+ }
107
+
new/controller/class-field-controller.php ADDED
@@ -0,0 +1,383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WOOCCM_Field_Controller {
4
+
5
+ public $billing;
6
+ public $shipping;
7
+ public $additional;
8
+
9
+ public function get_product_categories() {
10
+
11
+ $args = array(
12
+ 'taxonomy' => 'product_cat',
13
+ 'orderby' => 'id',
14
+ 'order' => 'ASC',
15
+ 'hide_empty' => true,
16
+ 'fields' => 'all');
17
+
18
+ return get_terms($args);
19
+ }
20
+
21
+ // Ajax
22
+ // ---------------------------------------------------------------------------
23
+
24
+ public function ajax_select_search_products() {
25
+
26
+ if (current_user_can('manage_woocommerce') && check_ajax_referer('search-products', 'security') && isset($_REQUEST['term'])) {
27
+
28
+ if (empty($term) && isset($_GET['term'])) {
29
+ $term = (string) wc_clean(wp_unslash($_GET['term']));
30
+ }
31
+
32
+ if (empty($term)) {
33
+ wp_die();
34
+ }
35
+
36
+ if (!empty($_GET['limit'])) {
37
+ $limit = absint($_GET['limit']);
38
+ } else {
39
+ $limit = absint(apply_filters('woocommerce_json_search_limit', 30));
40
+ }
41
+
42
+ $include_ids = !empty($_GET['include']) ? array_map('absint', (array) wp_unslash($_GET['include'])) : array();
43
+ $exclude_ids = !empty($_GET['exclude']) ? array_map('absint', (array) wp_unslash($_GET['exclude'])) : array();
44
+ $selected_ids = !empty($_GET['selected']) ? array_map('absint', (array) wp_unslash($_GET['selected'])) : array();
45
+
46
+ $include_variations = false;
47
+
48
+ $data_store = WC_Data_Store::load('product');
49
+ $ids = $data_store->search_products($term, '', (bool) $include_variations, false, $limit, $include_ids, $exclude_ids + $selected_ids);
50
+
51
+ $product_objects = array_filter(array_map('wc_get_product', $ids), 'wc_products_array_filter_readable');
52
+ $products = array();
53
+
54
+ foreach ($product_objects as $product_object) {
55
+ $formatted_name = $product_object->get_formatted_name();
56
+ $managing_stock = $product_object->managing_stock();
57
+
58
+ if ($managing_stock && !empty($_GET['display_stock'])) {
59
+ $stock_amount = $product_object->get_stock_quantity();
60
+ /* Translators: %d stock amount */
61
+ $formatted_name .= ' &ndash; ' . sprintf(__('Stock: %d', 'woocommerce'), wc_format_stock_quantity_for_display($stock_amount, $product_object));
62
+ }
63
+
64
+ $products[$product_object->get_id()] = rawurldecode($formatted_name);
65
+ }
66
+
67
+ wp_send_json(apply_filters('woocommerce_json_search_found_products', $products));
68
+ }
69
+ }
70
+
71
+ public function ajax_toggle_field_attribute() {
72
+
73
+ if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_admin', 'nonce') && isset($_REQUEST['field_id']) && isset($_REQUEST['field_attr'])) {
74
+
75
+ $field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
76
+ $attr = wc_clean(wp_unslash($_REQUEST['field_attr']));
77
+
78
+ $status = $this->toggle_field_attribute($field_id, $attr);
79
+
80
+ wp_send_json_success($status);
81
+ }
82
+
83
+ wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
84
+ }
85
+
86
+ public function ajax_change_field_attribute() {
87
+
88
+ if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_admin', 'nonce') && isset($_REQUEST['field_id']) && isset($_REQUEST['field_attr']) && isset($_REQUEST['field_value'])) {
89
+
90
+ $field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
91
+ $attr = wc_clean(wp_unslash($_REQUEST['field_attr']));
92
+ $value = wc_clean(wp_unslash($_REQUEST['field_value']));
93
+
94
+ $field_data = array($attr => $value);
95
+
96
+ $field = $this->save_modal_field($field_id, $field_data);
97
+
98
+ wp_send_json_success($field);
99
+ }
100
+
101
+ wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
102
+ }
103
+
104
+ public function ajax_save_field() {
105
+
106
+ if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_admin', 'nonce') && isset($_REQUEST['field_data'])) {
107
+
108
+ $field_data = $_REQUEST['field_data'];
109
+
110
+ if (array_key_exists('field_id', $_REQUEST)) {
111
+
112
+ $field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
113
+
114
+ if ($field = $this->save_modal_field($field_id, $field_data)) {
115
+
116
+ wp_send_json_success($field);
117
+ }
118
+ } else {
119
+
120
+ if ($field = $this->add_modal_field($field_data)) {
121
+
122
+ wp_send_json_success($field);
123
+ }
124
+ }
125
+ }
126
+
127
+ wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
128
+ }
129
+
130
+ public function ajax_delete_field() {
131
+
132
+ if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_admin', 'nonce') && isset($_REQUEST['field_id'])) {
133
+
134
+ $field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
135
+
136
+ if ($this->delete_field($field_id)) {
137
+
138
+ wp_send_json_success($field_id);
139
+ }
140
+ }
141
+
142
+ wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
143
+ }
144
+
145
+ public function ajax_load_field() {
146
+
147
+ if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_admin', 'nonce') && isset($_REQUEST['field_id'])) {
148
+
149
+ $field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
150
+
151
+ if ($field = self::get_modal_field($field_id)) {
152
+ wp_send_json_success($field);
153
+ }
154
+
155
+ wp_send_json_error(esc_html__('Undefined field id', 'woocommerce-checkout-manager'));
156
+ }
157
+
158
+ wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
159
+ }
160
+
161
+ // Modal
162
+ // ---------------------------------------------------------------------------
163
+
164
+ public function get_modal_field($field_id) {
165
+
166
+ if (array_key_exists('section', $_REQUEST)) {
167
+
168
+ $section = wc_clean(wp_unslash($_REQUEST['section']));
169
+
170
+ if (isset(WOOCCM()->field->$section)) {
171
+
172
+ if ($field = WOOCCM()->field->$section->get_field($field_id)) {
173
+
174
+ if (!empty($field['show_product'])) {
175
+ $field['show_product_selected'] = array_filter(array_combine((array) $field['show_product'], array_map('get_the_title', (array) $field['show_product'])));
176
+ }
177
+ if (!empty($field['hide_product'])) {
178
+ $field['hide_product_selected'] = array_filter(array_combine((array) $field['hide_product'], array_map('get_the_title', (array) $field['hide_product'])));
179
+ }
180
+ //don't remove empty attr because previus data remain
181
+ //$field = array_filter($field);
182
+
183
+ return $field;
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ // Save
190
+ // ---------------------------------------------------------------------------
191
+
192
+ public function toggle_field_attribute($field_id, $attr) {
193
+
194
+ if (array_key_exists('section', $_REQUEST)) {
195
+
196
+ $section = wc_clean(wp_unslash($_REQUEST['section']));
197
+
198
+ if (isset(WOOCCM()->field->$section)) {
199
+
200
+ if ($field = WOOCCM()->field->$section->get_field($field_id)) {
201
+
202
+ $field_data = array($attr => !@$field[$attr]);
203
+
204
+ $field = WOOCCM()->field->$section->update_field($field_id, $field_data);
205
+
206
+ return $field_data[$attr];
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ public function save_modal_field($field_id, $field_data) {
213
+
214
+ if (array_key_exists('section', $_REQUEST)) {
215
+
216
+ $section = wc_clean(wp_unslash($_REQUEST['section']));
217
+
218
+ if (isset(WOOCCM()->field->$section)) {
219
+ return WOOCCM()->field->$section->update_field($field_id, $field_data);
220
+ }
221
+ }
222
+ }
223
+
224
+ public function add_modal_field($field_data) {
225
+
226
+ if (array_key_exists('section', $_REQUEST)) {
227
+
228
+ $section = wc_clean(wp_unslash($_REQUEST['section']));
229
+
230
+ if (isset(WOOCCM()->field->$section)) {
231
+
232
+ return WOOCCM()->field->$section->add_field($field_data);
233
+ }
234
+ }
235
+ }
236
+
237
+ public function delete_field($field_id) {
238
+
239
+ if (array_key_exists('section', $_REQUEST)) {
240
+
241
+ $section = wc_clean(wp_unslash($_REQUEST['section']));
242
+
243
+ if (isset(WOOCCM()->field->$section)) {
244
+
245
+ return WOOCCM()->field->$section->delete_field($field_id);
246
+ }
247
+ }
248
+ }
249
+
250
+ function save_section_billing() {
251
+
252
+ global $current_section;
253
+
254
+ if ($current_section) {
255
+
256
+ $section = wc_clean(wp_unslash($current_section));
257
+
258
+ //error_log($current_section);
259
+
260
+ if (array_key_exists('field_order', $_POST)) {
261
+
262
+ $field_order = wc_clean(wp_unslash($_POST['field_order']));
263
+
264
+ if (is_array($field_order) && count($field_order) > 0) {
265
+
266
+ if (isset(WOOCCM()->field->$section)) {
267
+
268
+ $fields = WOOCCM()->field->$section->get_fields();
269
+
270
+ $loop = 1;
271
+
272
+ foreach ($field_order as $gateway_id) {
273
+
274
+ if (isset($fields[$gateway_id])) {
275
+
276
+ $fields[$gateway_id]['order'] = $loop;
277
+
278
+ $loop++;
279
+ }
280
+ }
281
+
282
+ WOOCCM()->field->$section->update_fields($fields);
283
+ }
284
+ }
285
+ }
286
+ }
287
+ }
288
+
289
+ // Admin
290
+ // ---------------------------------------------------------------------------
291
+
292
+ public function add_section_billing() {
293
+
294
+ global $current_section, $wp_roles, $wp_locale;
295
+
296
+ if ('billing' == $current_section) {
297
+
298
+ $fields = WOOCCM()->field->billing->get_fields();
299
+ $defaults = WOOCCM()->field->billing->get_defaults();
300
+ $types = WOOCCM()->field->billing->get_types();
301
+ $conditionals = WOOCCM()->field->billing->get_conditional_types();
302
+ $multiple = WOOCCM()->field->billing->get_multiple_types();
303
+ $product_categories = $this->get_product_categories();
304
+
305
+ include_once(WOOCCM_PLUGIN_DIR . 'new/view/backend/pages/billing.php');
306
+ }
307
+ }
308
+
309
+ public function add_section_shipping() {
310
+
311
+ global $current_section, $wp_roles, $wp_locale;
312
+
313
+ if ('shipping' == $current_section) {
314
+
315
+ $fields = WOOCCM()->field->shipping->get_fields();
316
+ $defaults = WOOCCM()->field->shipping->get_defaults();
317
+ $types = WOOCCM()->field->shipping->get_types();
318
+ $conditionals = WOOCCM()->field->shipping->get_conditional_types();
319
+ $multiple = WOOCCM()->field->shipping->get_multiple_types();
320
+ $product_categories = $this->get_product_categories();
321
+
322
+ include_once(WOOCCM_PLUGIN_DIR . 'new/view/backend/pages/shipping.php');
323
+ }
324
+ }
325
+
326
+ public function add_section_additional() {
327
+
328
+ global $current_section, $wp_roles, $wp_locale;
329
+
330
+ if ('additional' == $current_section) {
331
+
332
+ $fields = WOOCCM()->field->additional->get_fields();
333
+ $defaults = WOOCCM()->field->additional->get_defaults();
334
+ $types = WOOCCM()->field->additional->get_types();
335
+ $conditionals = WOOCCM()->field->additional->get_conditional_types();
336
+ $multiple = WOOCCM()->field->additional->get_multiple_types();
337
+ $product_categories = $this->get_product_categories();
338
+
339
+ include_once(WOOCCM_PLUGIN_DIR . 'new/view/backend/pages/additional.php');
340
+ }
341
+ }
342
+
343
+ function includes() {
344
+
345
+ include_once( WOOCCM_PLUGIN_DIR . 'new/model/class-wooccm-field.php' );
346
+ include_once( WOOCCM_PLUGIN_DIR . 'new/model/class-wooccm-field-old.php' );
347
+ include_once( WOOCCM_PLUGIN_DIR . 'new/model/class-wooccm-field-billing.php' );
348
+ include_once( WOOCCM_PLUGIN_DIR . 'new/model/class-wooccm-field-shipping.php' );
349
+ include_once( WOOCCM_PLUGIN_DIR . 'new/model/class-wooccm-field-additional.php' );
350
+
351
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/fields/register.php' );
352
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/fields/additional.php' );
353
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/fields/display.php' );
354
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/fields/conditional.php' );
355
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/fields/handler.php' );
356
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/fields/filters.php' );
357
+
358
+ //$this->field = new WOOCCM_Field();
359
+ $this->billing = new WOOCCM_Field_Billing();
360
+ $this->shipping = new WOOCCM_Field_Shipping();
361
+ $this->additional = new WOOCCM_Field_Additional();
362
+ }
363
+
364
+ function init() {
365
+ add_action('wp_ajax_wooccm_select_search_products', array($this, 'ajax_select_search_products'));
366
+ add_action('wp_ajax_wooccm_load_field', array($this, 'ajax_load_field'));
367
+ add_action('wp_ajax_wooccm_save_field', array($this, 'ajax_save_field'));
368
+ add_action('wp_ajax_wooccm_delete_field', array($this, 'ajax_delete_field'));
369
+ add_action('wp_ajax_wooccm_change_field_attribute', array($this, 'ajax_change_field_attribute'));
370
+ add_action('wp_ajax_wooccm_toggle_field_attribute', array($this, 'ajax_toggle_field_attribute'));
371
+
372
+ add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section_billing'), 99);
373
+ add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section_shipping'), 99);
374
+ add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section_additional'), 99);
375
+ add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_section_billing'));
376
+ }
377
+
378
+ public function __construct() {
379
+ $this->includes();
380
+ $this->init();
381
+ }
382
+
383
+ }
new/{orders.php → controller/order.php} RENAMED
@@ -1,210 +1,123 @@
1
- <?php
2
-
3
- if (!class_exists('WOOCCM_Orders')) {
4
-
5
- class WOOCCM_Orders extends WOOCCM_Checkout {
6
-
7
- protected static $instance;
8
-
9
- static function is_frontend_ajax() {
10
- $script_filename = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
11
-
12
- //Try to figure out if frontend AJAX request... If we are DOING_AJAX; let's look closer
13
- if ((defined('DOING_AJAX') && DOING_AJAX)) {
14
- //From wp-includes/functions.php, wp_get_referer() function.
15
- //Required to fix: https://core.trac.wordpress.org/ticket/25294
16
- $ref = '';
17
- if (!empty($_REQUEST['_wp_http_referer']))
18
- $ref = wp_unslash($_REQUEST['_wp_http_referer']);
19
- elseif (!empty($_SERVER['HTTP_REFERER']))
20
- $ref = wp_unslash($_SERVER['HTTP_REFERER']);
21
-
22
- //If referer does not contain admin URL and we are using the admin-ajax.php endpoint, this is likely a frontend AJAX request
23
- if (((strpos($ref, admin_url()) === false) && (basename($script_filename) === 'admin-ajax.php')))
24
- return true;
25
- }
26
-
27
- //If no checks triggered, we end up here - not an AJAX request.
28
- return false;
29
- }
30
-
31
- function ajax_order_attachment_upload() {
32
-
33
- if (!empty($_REQUEST) && check_admin_referer('wooccm_admin', 'nonce')) {
34
-
35
- $files = ( isset($_FILES['wooccm_order_attachment_upload']) ? $_FILES['wooccm_order_attachment_upload'] : false );
36
-
37
- if (empty($files)) {
38
- //wc_add_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
39
- wp_send_json_error(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
40
- }
41
-
42
- $order_id = ( isset($_REQUEST['order_id']) ? absint($_REQUEST['order_id']) : false );
43
-
44
- if (empty($order_id)) {
45
- wp_send_json_error(esc_html__('Empty order id.', 'woocommerce-checkout-manager'));
46
- }
47
-
48
- if (!$post = get_post($order_id)) {
49
- wp_send_json_error(esc_html__('Invalid order id.', 'woocommerce-checkout-manager'));
50
- }
51
-
52
- if (count($attachment_ids = $this->process_uploads($files, 'wooccm_order_attachment_upload', $order_id))) {
53
-
54
- ob_start();
55
-
56
- if (!self::is_frontend_ajax()) {
57
- $this->order_uploads_metabox_content($post);
58
- } else {
59
- $this->order_uploads($post->ID);
60
- }
61
-
62
- wp_send_json_success(ob_get_clean());
63
- /* send email
64
- $email_recipients = $options['checkness']['wooccm_notification_email'];
65
- if (empty($email_recipients))
66
- $email_recipients = get_option('admin_email');
67
- $email_heading = __('Files Uploaded by Customer', 'woocommerce-checkout-manager');
68
- $subject = sprintf(__('WooCommerce Checkout Manager - %s [%s]', 'woocommerce-checkout-manager'), $email_heading, $order->billing_first_name . ' ' . $order->billing_last_name);
69
-
70
- $mailer = WC()->mailer();
71
-
72
- // Buffer
73
- ob_start();
74
- ?>
75
- <p>This is an automatic message from WooCommerce Checkout Manager, reporting that files have been uploaded by <?php echo $order->billing_first_name; ?> <?php echo $order->billing_last_name; ?>.</p>
76
- <h3>Customer Details</h3>
77
- <ul>
78
- <li>Name: <?php echo $order->billing_first_name; ?> <?php $order->billing_last_name; ?></li>
79
- <li>E-mail: <?php echo $order->billing_email; ?></li>
80
- <li>Order Number: <?php echo $order_id; ?></li>
81
- </ul>
82
- <p>You can view the files and order details via back-end by following this <a href="<?php echo admin_url('/post.php?post=' . $order_id . '&action=edit'); ?>" target="_blank">link</a>.</p>
83
- <?php
84
- // Get contents
85
- $message = ob_get_clean();
86
-
87
- $message = $mailer->wrap_message($email_heading, $message);
88
-
89
- // add_filter( 'wp_mail_content_type', 'wooccm_set_html_content_type' );
90
- // wc_mail( $email_recipients, $subject, $message );
91
- $mailer->send($email_recipients, strip_tags($subject), $message);
92
- // remove_filter( 'wp_mail_content_type', 'wooccm_set_html_content_type' ); */
93
- }
94
- wp_send_json_error(esc_html__('Unknow error.', 'woocommerce-checkout-manager'));
95
- }
96
- }
97
-
98
- function ajax_order_attachment_update() {
99
-
100
- if (!empty($_REQUEST) && check_admin_referer('wooccm_admin', 'nonce')) {
101
-
102
- $array1 = explode(',', sanitize_text_field(isset($_POST['all_attachments_ids']) ? $_POST['all_attachments_ids'] : '' ));
103
- $array2 = explode(',', sanitize_text_field(isset($_POST['delete_attachments_ids']) ? $_POST['delete_attachments_ids'] : '' ));
104
-
105
- if (empty($array1) || empty($array2)) {
106
- wp_send_json_error(esc_html__('No attachment selected.', 'woocommerce-checkout-manager'));
107
- }
108
-
109
- $attachment_ids = array_diff($array1, $array2);
110
-
111
- if (!empty($attachment_ids)) {
112
-
113
- foreach ($attachment_ids as $key => $attachtoremove) {
114
-
115
- // Check the Attachment exists...
116
- if (get_post_status($attachtoremove) == false)
117
- continue;
118
-
119
- // Check the Attachment is associated with an Order
120
- $post_parent = get_post_field('post_parent', $attachtoremove);
121
-
122
- if (empty($post_parent)) {
123
- continue;
124
- } else {
125
- if (get_post_type($post_parent) <> 'shop_order')
126
- continue;
127
- }
128
- wp_delete_attachment($attachtoremove);
129
- }
130
- }
131
-
132
- wp_send_json_success(esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'));
133
- }
134
- }
135
-
136
- function order_uploads_metabox_content($post) {
137
-
138
- if ($order = wc_get_order($post->ID)) {
139
-
140
- $attachments = get_posts(array(
141
- 'fields' => 'ids',
142
- 'post_type' => 'attachment',
143
- 'numberposts' => -1,
144
- 'post_status' => null,
145
- 'post_parent' => $order->get_id()
146
- ));
147
- ?>
148
-
149
- <?php wp_enqueue_style('wccm_upload_file_style', plugins_url('assets/old/edit-order-uploads-file_editing_table.css', WOOCCM_PLUGIN_FILE)); ?>
150
-
151
- <?php include WOOCCM_PLUGIN_DIR . 'new/admin/meta-boxes/html-order-uploads.php'; ?>
152
-
153
- <?php
154
-
155
- }
156
- }
157
-
158
- function order_uploads($order_id) {
159
- if ($order = wc_get_order($order_id)) {
160
-
161
- $options = get_option('wccs_settings');
162
-
163
- if (empty($options['checkness']['upload_os']) || ( $order->get_status() == "wc-{$options['checkness']['upload_os']}" )) {
164
-
165
-
166
- $attachments = get_posts(array(
167
- 'fields' => 'ids',
168
- 'post_type' => 'attachment',
169
- 'numberposts' => -1,
170
- 'post_status' => null,
171
- 'post_parent' => $order->get_id())
172
- );
173
-
174
- wc_get_template('templates/order/order-uploads.php', array('order' => $order, 'attachments' => $attachments), '', WOOCCM_PLUGIN_DIR);
175
- }
176
- }
177
- }
178
-
179
- function order_uploads_metabox() {
180
- add_meta_box('woocommerce-order-files', esc_html__('Order Uploaded Files', 'woocommerce-checkout-manager'), array($this, 'order_uploads_metabox_content'), 'shop_order', 'normal', 'default');
181
- }
182
-
183
- function init() {
184
-
185
- add_action('wp_ajax_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
186
- add_action('wp_ajax_nopriv_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
187
- add_action('wp_ajax_wooccm_order_attachment_update', array($this, 'ajax_order_attachment_update'));
188
- add_action('wp_ajax_nopriv_wooccm_order_attachment_update', array($this, 'ajax_order_attachment_update'));
189
-
190
- if ($options = get_option('wccs_settings')) {
191
- if (!empty($options['checkness']['enable_file_upload'])) {
192
- add_action('woocommerce_view_order', array($this, 'order_uploads'));
193
- }
194
- }
195
-
196
- add_action('add_meta_boxes', array($this, 'order_uploads_metabox'));
197
- }
198
-
199
- public static function instance() {
200
- if (!isset(self::$instance)) {
201
- self::$instance = new self();
202
- self::$instance->init();
203
- }
204
- return self::$instance;
205
- }
206
-
207
- }
208
-
209
- WOOCCM_Orders::instance();
210
- }
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Order_Controller')) {
4
+
5
+ class WOOCCM_Order_Controller extends WOOCCM_Upload {
6
+
7
+ protected static $instance;
8
+
9
+ static function is_frontend_ajax() {
10
+ $script_filename = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
11
+
12
+ //Try to figure out if frontend AJAX request... If we are DOING_AJAX; let's look closer
13
+ if ((defined('DOING_AJAX') && DOING_AJAX)) {
14
+ //From wp-includes/functions.php, wp_get_referer() function.
15
+ //Required to fix: https://core.trac.wordpress.org/ticket/25294
16
+ $ref = '';
17
+ if (!empty($_REQUEST['_wp_http_referer']))
18
+ $ref = wp_unslash($_REQUEST['_wp_http_referer']);
19
+ elseif (!empty($_SERVER['HTTP_REFERER']))
20
+ $ref = wp_unslash($_SERVER['HTTP_REFERER']);
21
+
22
+ //If referer does not contain admin URL and we are using the admin-ajax.php endpoint, this is likely a frontend AJAX request
23
+ if (((strpos($ref, admin_url()) === false) && (basename($script_filename) === 'admin-ajax.php')))
24
+ return true;
25
+ }
26
+
27
+ //If no checks triggered, we end up here - not an AJAX request.
28
+ return false;
29
+ }
30
+
31
+ function ajax_order_attachment_upload() {
32
+
33
+ //include_once( WOOCCM_PLUGIN_DIR . 'new/view/backend/order.php' );
34
+ //include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/order.php' );
35
+
36
+ if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
37
+
38
+ $files = ( isset($_FILES['wooccm_order_attachment_upload']) ? $_FILES['wooccm_order_attachment_upload'] : false );
39
+
40
+ if (empty($files)) {
41
+ //wc_add_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
42
+ wp_send_json_error(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
43
+ }
44
+
45
+ $order_id = ( isset($_REQUEST['order_id']) ? absint($_REQUEST['order_id']) : false );
46
+
47
+ if (empty($order_id)) {
48
+ wp_send_json_error(esc_html__('Empty order id.', 'woocommerce-checkout-manager'));
49
+ }
50
+
51
+ if (!$post = get_post($order_id)) {
52
+ wp_send_json_error(esc_html__('Invalid order id.', 'woocommerce-checkout-manager'));
53
+ }
54
+
55
+ if (count($attachment_ids = $this->process_uploads($files, 'wooccm_order_attachment_upload', $order_id))) {
56
+
57
+ ob_start();
58
+
59
+ if (!self::is_frontend_ajax()) {
60
+ WOOCCM_Order_Admin::instance()->order_uploads_metabox_content($post);
61
+ } else {
62
+ WOOCCM_Order::instance()->add_order_uploads($post->ID);
63
+ }
64
+
65
+ wp_send_json_success(ob_get_clean());
66
+ /* send email
67
+ $email_recipients = $options['checkness']['wooccm_notification_email'];
68
+ if (empty($email_recipients))
69
+ $email_recipients = get_option('admin_email');
70
+ $email_heading = __('Files Uploaded by Customer', 'woocommerce-checkout-manager');
71
+ $subject = sprintf(__('WooCommerce Checkout Manager - %s [%s]', 'woocommerce-checkout-manager'), $email_heading, $order->billing_first_name . ' ' . $order->billing_last_name);
72
+
73
+ $mailer = WC()->mailer();
74
+
75
+ // Buffer
76
+ ob_start();
77
+ ?>
78
+ <p>This is an automatic message from WooCommerce Checkout Manager, reporting that files have been uploaded by <?php echo $order->billing_first_name; ?> <?php echo $order->billing_last_name; ?>.</p>
79
+ <h3>Customer Details</h3>
80
+ <ul>
81
+ <li>Name: <?php echo $order->billing_first_name; ?> <?php $order->billing_last_name; ?></li>
82
+ <li>E-mail: <?php echo $order->billing_email; ?></li>
83
+ <li>Order Number: <?php echo $order_id; ?></li>
84
+ </ul>
85
+ <p>You can view the files and order details via back-end by following this <a href="<?php echo admin_url('/post.php?post=' . $order_id . '&action=edit'); ?>" target="_blank">link</a>.</p>
86
+ <?php
87
+ // Get contents
88
+ $message = ob_get_clean();
89
+
90
+ $message = $mailer->wrap_message($email_heading, $message);
91
+
92
+ // add_filter( 'wp_mail_content_type', 'wooccm_set_html_content_type' );
93
+ // wc_mail( $email_recipients, $subject, $message );
94
+ $mailer->send($email_recipients, strip_tags($subject), $message);
95
+ // remove_filter( 'wp_mail_content_type', 'wooccm_set_html_content_type' ); */
96
+ }
97
+ wp_send_json_error(esc_html__('Unknow error.', 'woocommerce-checkout-manager'));
98
+ }
99
+ }
100
+
101
+ function includes() {
102
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/backend/order.php' );
103
+ include_once( WOOCCM_PLUGIN_DIR . 'new/view/frontend/order.php' );
104
+ }
105
+
106
+ function init() {
107
+ add_action('wp_ajax_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
108
+ add_action('wp_ajax_nopriv_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
109
+ }
110
+
111
+ public static function instance() {
112
+ if (!isset(self::$instance)) {
113
+ self::$instance = new self();
114
+ self::$instance->includes();
115
+ self::$instance->init();
116
+ }
117
+ return self::$instance;
118
+ }
119
+
120
+ }
121
+
122
+ WOOCCM_Order_Controller::instance();
123
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/{checkout.php → controller/upload.php} RENAMED
@@ -1,7 +1,8 @@
1
  <?php
2
- if (!class_exists('WOOCCM_Checkout')) {
3
 
4
- class WOOCCM_Checkout {
 
 
5
 
6
  protected static $instance;
7
 
@@ -47,7 +48,7 @@ if (!class_exists('WOOCCM_Checkout')) {
47
 
48
  function ajax_checkout_attachment_upload() {
49
 
50
- if (!empty($_REQUEST) && check_admin_referer('wooccm_checkout_attachment_upload', 'nonce')) {
51
 
52
  $files = ( isset($_FILES['wooccm_checkout_attachment_upload']) ? $_FILES['wooccm_checkout_attachment_upload'] : false );
53
 
@@ -64,12 +65,12 @@ if (!class_exists('WOOCCM_Checkout')) {
64
  }
65
  }
66
 
67
- function ajax_checkout_attachment_update() {
68
 
69
- if (!empty($_REQUEST) && check_admin_referer('wooccm_checkout_attachment_upload', 'nonce')) {
70
 
71
- $array1 = explode(',', sanitize_text_field(isset($_POST['all_attachments_ids']) ? $_POST['all_attachments_ids'] : '' ));
72
- $array2 = explode(',', sanitize_text_field(isset($_POST['delete_attachments_ids']) ? $_POST['delete_attachments_ids'] : '' ));
73
 
74
  if (empty($array1) || empty($array2)) {
75
  wp_send_json_error(esc_html__('No attachment selected.', 'woocommerce-checkout-manager'));
@@ -102,65 +103,9 @@ if (!class_exists('WOOCCM_Checkout')) {
102
  }
103
  }
104
 
105
- function checkout_billing_attachment_update_ids($order_id = 0) {
106
- $this->checkout_attachment_update_ids($order_id, 'wccs_settings3', 'billing_buttons', 'billing_');
107
- }
108
-
109
- function checkout_shipping_attachment_update_ids($order_id = 0) {
110
- $this->checkout_attachment_update_ids($order_id, 'wccs_settings2', 'shipping_buttons', 'shipping_');
111
- }
112
-
113
- function checkout_additional_attachment_update_ids($order_id = 0) {
114
- $this->checkout_attachment_update_ids($order_id, 'wccs_settings', 'buttons');
115
- }
116
-
117
- function checkout_attachment_update_ids($order_id = 0, $name, $key, $prefix = '') {
118
-
119
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
120
-
121
- if ($options = get_option($name)) {
122
-
123
- if (array_key_exists($key, $options)) {
124
-
125
- if ($custom_fields = $options[$key]) {
126
-
127
- foreach ($custom_fields as $id => $custom_field) {
128
-
129
- if ($custom_field['type'] == 'wooccmupload') {
130
-
131
- if ($prefix) {
132
- $key = sprintf("_%s%s", $prefix, $custom_field['cow']);
133
- } else {
134
- $key = $custom_field['cow'];
135
- }
136
-
137
- if ($attachments = get_post_meta($order_id, $key, true)) {
138
-
139
- if ($attachments = (array) explode(',', $attachments)) {
140
-
141
- foreach ($attachments as $image_id) {
142
-
143
- wp_update_post(array('ID' => $image_id, 'post_parent' => $order_id));
144
-
145
- wp_update_attachment_metadata($image_id, wp_generate_attachment_metadata($image_id, get_attached_file($image_id)));
146
- }
147
- }
148
- }
149
- }
150
- }
151
- }
152
- }
153
- }
154
- }
155
-
156
  function init() {
157
- add_action('wp_ajax_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
158
- add_action('wp_ajax_nopriv_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
159
- add_action('wp_ajax_wooccm_checkout_attachment_update', array($this, 'ajax_checkout_attachment_update'));
160
- add_action('wp_ajax_nopriv_wooccm_checkout_attachment_update', array($this, 'ajax_checkout_attachment_update'));
161
- add_action('woocommerce_checkout_update_order_meta', array($this, 'checkout_billing_attachment_update_ids'));
162
- add_action('woocommerce_checkout_update_order_meta', array($this, 'checkout_shipping_attachment_update_ids'));
163
- add_action('woocommerce_checkout_update_order_meta', array($this, 'checkout_additional_attachment_update_ids'));
164
  }
165
 
166
  public static function instance() {
@@ -173,6 +118,6 @@ if (!class_exists('WOOCCM_Checkout')) {
173
 
174
  }
175
 
176
- WOOCCM_Checkout::instance();
177
  }
178
 
1
  <?php
 
2
 
3
+ if (!class_exists('WOOCCM_Upload')) {
4
+
5
+ class WOOCCM_Upload {
6
 
7
  protected static $instance;
8
 
48
 
49
  function ajax_checkout_attachment_upload() {
50
 
51
+ if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
52
 
53
  $files = ( isset($_FILES['wooccm_checkout_attachment_upload']) ? $_FILES['wooccm_checkout_attachment_upload'] : false );
54
 
65
  }
66
  }
67
 
68
+ function ajax_delete_attachment() {
69
 
70
+ if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
71
 
72
+ $array1 = explode(',', sanitize_text_field(isset($_REQUEST['all_attachments_ids']) ? $_REQUEST['all_attachments_ids'] : '' ));
73
+ $array2 = explode(',', sanitize_text_field(isset($_REQUEST['delete_attachments_ids']) ? $_REQUEST['delete_attachments_ids'] : '' ));
74
 
75
  if (empty($array1) || empty($array2)) {
76
  wp_send_json_error(esc_html__('No attachment selected.', 'woocommerce-checkout-manager'));
103
  }
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  function init() {
107
+ add_action('wp_ajax_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
108
+ add_action('wp_ajax_nopriv_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
 
 
 
 
 
109
  }
110
 
111
  public static function instance() {
118
 
119
  }
120
 
121
+ WOOCCM_Upload::instance();
122
  }
123
 
new/fields_init.php DELETED
@@ -1,354 +0,0 @@
1
- <?php
2
-
3
- if (!class_exists('WOOCCM_Fields')) {
4
-
5
- class WOOCCM_Fields {
6
-
7
- protected static $instance;
8
-
9
- public static function get_default_address_fields() {
10
-
11
- $defaults = array(
12
- 'country',
13
- 'first_name',
14
- 'last_name',
15
- 'company',
16
- 'address_1',
17
- 'address_2',
18
- 'city',
19
- 'state',
20
- 'postcode',
21
- 'email',
22
- 'phone'
23
- );
24
-
25
- return array_merge(array_keys(WC()->countries->get_default_address_fields()), $defaults);
26
- }
27
-
28
- public static function get_fields_conditional_types() {
29
-
30
- $fields = self::get_fields_types();
31
-
32
- unset($fields['heading']);
33
- unset($fields['button']);
34
-
35
- return array_keys($fields);
36
- }
37
-
38
- public static function get_fields_option_types() {
39
-
40
- return array(
41
- 'multicheckbox',
42
- 'multiselect',
43
- 'wooccmselect',
44
- 'select'
45
- );
46
- }
47
-
48
- public static function get_fields_types() {
49
-
50
- return apply_filters('wooccm_fields_fields_types', array(
51
- 'text' => __('Text', 'woocommerce-checkout-manager'),
52
- 'textarea' => __('Text Area', 'woocommerce-checkout-manager'),
53
- 'password' => __('Text Area', 'woocommerce-checkout-manager'),
54
- 'select' => __('Select', 'woocommerce-checkout-manager'),
55
- 'multiselect' => __('Multiselect', 'woocommerce-checkout-manager'),
56
- 'radio' => __('Radio', 'woocommerce-checkout-manager'),
57
- 'checkbox' => __('Checkbox', 'woocommerce-checkout-manager'),
58
- 'multicheckbox' => __('Multi-checkbox', 'woocommerce-checkout-manager'),
59
- 'datepicker' => __('Datepicker', 'woocommerce-checkout-manager'),
60
- 'timepicker' => __('Timepicker', 'woocommerce-checkout-manager'),
61
- 'colorpicker' => __('Colorpicker', 'woocommerce-checkout-manager'),
62
- 'country' => __('Countru', 'woocommerce-checkout-manager'),
63
- 'state' => __('State', 'woocommerce-checkout-manager'),
64
- 'heading' => __('Heading', 'woocommerce-checkout-manager'),
65
- //'button' => __('Button', 'woocommerce-checkout-manager'),
66
- 'file' => __('File', 'woocommerce-checkout-manager'),
67
- ));
68
- }
69
-
70
- static function get_field_args() {
71
-
72
- $args = array(
73
- 'id' => null,
74
- 'cow' => null,
75
- // Defaults
76
- // -------------------------------------------------------------------
77
- 'disabled' => false,
78
- 'order' => null,
79
- 'priority' => null,
80
- 'slug' => null,
81
- 'type' => null,
82
- 'label' => null,
83
- 'placeholder' => null,
84
- //'force_title2' => null,
85
- 'default' => null,
86
- //'color' => null,
87
- //'colorpickerd' => null,
88
- 'position' => null,
89
- //'clear_row' => null,
90
- 'clear' => null,
91
- //'options_array' => null,
92
- 'options' => null,
93
- 'required' => null,
94
- //'checkbox' => null,
95
- //'wooccm_required' => null,
96
- 'class' => null,
97
- 'extra_class' => null,
98
- // Display
99
- // -------------------------------------------------------------------
100
- //'user_role' => null,
101
- 'role_options' => array(),
102
- 'role_options2' => array(),
103
- 'more_content' => null,
104
- 'single_p' => array(),
105
- 'single_p_cat' => array(),
106
- 'single_px' => array(),
107
- 'single_px_cat' => array(),
108
- // Timing
109
- // -------------------------------------------------------------------
110
- 'start_hour' => null,
111
- 'end_hour' => null,
112
- 'interval_min' => null,
113
- 'manual_min' => null,
114
- 'min_before' => null,
115
- 'max_after' => null,
116
- 'format_date' => null,
117
- 'date_limit' => null,
118
- 'single_dd' => null,
119
- 'single_max_dd' => null,
120
- 'single_max_mm' => null,
121
- 'single_max_yy' => null,
122
- 'single_mm' => null,
123
- 'single_yy' => null,
124
- // Amount
125
- // -------------------------------------------------------------------
126
- 'add_amount' => null,
127
- //'fee_name' => null,
128
- 'add_admoun_name' => null,
129
- 'add_amount_type' => null,
130
- 'add_amount_tax' => null,
131
- //'tax_remove' => null,
132
- // Conditional
133
- // -------------------------------------------------------------------
134
- 'conditional' => null,
135
- //'conditional_parent_use' => null,
136
- //'conditional_tie' => null,
137
- 'conditional_parent_slug' => null,
138
- 'conditional_parent_value' => null,
139
- //'conditional_parent' => null,
140
- //'chosen_valt' => null,
141
- // Display
142
- // -------------------------------------------------------------------
143
- 'listable' => null,
144
- 'sortable' => null,
145
- 'filterable' => null,
146
- 'single_min_date' => null,
147
- 'single_max_date' => null,
148
- //
149
- // Email
150
- // -------------------------------------------------------------------
151
- //deny_receipt
152
- //'colorpickertype' => null,
153
- //'fancy' => null,
154
- );
155
-
156
- return $args;
157
- }
158
-
159
- public static function get_billing_fields($new = false) {
160
- return self::get_fields('wccs_settings3', 'billing', self::get_default_address_fields(), $new);
161
- }
162
-
163
- public static function get_shipping_fields($new = false) {
164
- return self::get_fields('wccs_settings2', 'shipping', self::get_default_address_fields(), $new);
165
- }
166
-
167
- public static function get_additional_fields($new = false) {
168
- return self::get_fields('wccs_settings', '', self::get_default_address_fields(), $new);
169
- }
170
-
171
- protected static function get_fields($name, $prefix = 'additional', $defaults = array(), $new) {
172
-
173
- if ($fields = get_option($name, $prefix, $defaults)) {
174
-
175
- // Compatibility with 4.x
176
- // ---------------------------------------------------------------------
177
- if (array_key_exists("{$prefix}_buttons", $fields)) {
178
- $fields = $fields["{$prefix}_buttons"];
179
- }
180
-
181
- // Additional compatibility with 4.x
182
- // ---------------------------------------------------------------------
183
- if ($name == 'wccs_settings') {
184
- $fields = (array) @$fields['buttons'];
185
- }
186
-
187
- foreach ($fields as $id => $field) {
188
-
189
- $key = sprintf("%s_%s", $prefix, $field['cow']);
190
-
191
- if ($new === 'new') {
192
- $fields[$id] = self::new_panel_compatibility($field, $key, $id);
193
- } else {
194
- $fields[$id] = self::old_panel_compatibility($field, $key, $id);
195
- }
196
- }
197
-
198
- // Resort the fields by order
199
- // ---------------------------------------------------------------------
200
- //$fields[] = uasort($fields, 'wooccm_sort_fields');
201
- //if ($fields[0]) {
202
- // unset($fields[0]);
203
- //}
204
- }
205
-
206
- return $fields;
207
- }
208
-
209
- protected static function new_panel_compatibility($field, $key, $id) {
210
-
211
- $field = wp_parse_args($field, self::get_field_args());
212
-
213
- $field['id'] = $id;
214
- $field['key'] = $key;
215
- $field['name'] = @$field['cow'];
216
-
217
- // General
218
- $field['placeholder'] = @$field['placeholder'];
219
- $field['clear'] = @$field['clear_row'];
220
- $field['required'] = @$field['checkbox'];
221
- $field['conditional'] = @$field['conditional_parent_use'];
222
- $field['conditional_tie'] = @$field['conditional_parent_slug'];
223
- $field['conditional_value'] = @$field['chosen_valt'];
224
- $field['add_amount_name'] = @$field['fee_name'];
225
- $field['add_amount_tax'] = !@$field['tax_remove'];
226
-
227
- if ($field['type'] == 'wooccmtext') {
228
- $field['type'] = 'text';
229
- }
230
- if ($field['type'] == 'wooccmstate') {
231
- $field['type'] = 'state';
232
- }
233
- if ($field['type'] == 'wooccmcountry') {
234
- $field['type'] = 'country';
235
- }
236
- if ($field['type'] == 'wooccmselect') {
237
- $field['type'] = 'select';
238
- }
239
- if ($field['type'] == 'wooccmtextarea') {
240
- $field['type'] = 'textarea';
241
- }
242
- if ($field['type'] == 'checkbox_wccm') {
243
- $field['type'] = 'checkbox';
244
- }
245
- if ($field['type'] == 'time') {
246
- $field['type'] = 'timepicker';
247
- }
248
- if ($field['type'] == 'colorpicker') {
249
- $field['default'] = @$field['colorpickerd'];
250
- } else {
251
- $field['default'] = @$field['force_title2'];
252
- }
253
-
254
- // Roles
255
- if (!empty($field['role_options']) && !is_array($field['role_options'])) {
256
- if (strpos($field['role_options'], '||') !== false) {
257
- $field['role_options'] = explode('||', $field['role_options']);
258
- } else {
259
- $field['role_options'] = (array) $field['role_options'];
260
- }
261
- }
262
-
263
- if (!empty($field['role_options2']) && !is_array($field['role_options2'])) {
264
- if (strpos($field['role_options2'], '||') !== false) {
265
- $field['role_options2'] = explode('||', $field['role_options2']);
266
- } else {
267
- $field['role_options2'] = (array) $field['role_options2'];
268
- }
269
- }
270
-
271
- // Days
272
- if (!empty($field['days_disabler'])) {
273
-
274
- $field['days_disabler'] = array();
275
-
276
- for ($day_index = 0; $day_index <= 6; $day_index++) {
277
-
278
- if (!empty($field['days_disabler' . $day_index])) {
279
- $field['days_disabler'][strval($day_index)] = strval($day_index);
280
- }
281
- }
282
- }
283
-
284
- // Dates
285
- if (!empty($field['single_yy']) && !empty($field['single_mm']) && !empty($field['single_dd'])) {
286
- $field['single_min_date'] = $field['single_yy'] . '-' . $field['single_mm'] . '-' . $field['single_dd'];
287
- } else {
288
- $field['single_min_date'] = '';
289
- }
290
- if (!empty($field['single_max_yy']) && !empty($field['single_max_mm']) && !empty($field['single_max_dd'])) {
291
- $field['single_max_date'] = $field['single_max_yy'] . '-' . $field['single_max_mm'] . '-' . $field['single_max_dd'];
292
- } else {
293
- $field['single_max_date'] = '';
294
- }
295
-
296
- return $field;
297
- }
298
-
299
- protected static function old_panel_compatibility($field) {
300
-
301
- // Display
302
- foreach ($field as $i => $key) {
303
- if (is_array($field[$i]) && in_array('key', array('single_p', 'single_p_cat', 'single_px', 'single_px_cat'))) {
304
- $field[$i] = implode('||', $field[$i]);
305
- }
306
- }
307
-
308
- // Days
309
- if (is_array(@$field['days_disabler'])) {
310
- foreach ($field['days_disabler'] as $day_index => $day) {
311
- $field['days_disabler' . strval($day_index)] = 1;
312
- }
313
- $field['days_disabler'] = 1;
314
- }
315
-
316
- // Dates
317
- if (!empty($field['single_min_date'])) {
318
-
319
- $min = explode('-', $field['single_min_date']);
320
-
321
- $field['single_yy'] = $min[0];
322
- $field['single_mm'] = $min[1];
323
- $field['single_dd'] = $min[2];
324
- }
325
-
326
- if (!empty($field['single_max_date'])) {
327
-
328
- $max = explode('-', $field['single_max_date']);
329
-
330
- $field['single_max_yy'] = $max[0];
331
- $field['single_max_mm'] = $max[1];
332
- $field['single_max_dd'] = $max[2];
333
- }
334
-
335
-
336
- return $field;
337
- }
338
-
339
- function init() {
340
-
341
- }
342
-
343
- public static function instance() {
344
- if (!isset(self::$instance)) {
345
- self::$instance = new self();
346
- //self::$instance->init();
347
- }
348
- return self::$instance;
349
- }
350
-
351
- }
352
-
353
- WOOCCM_Fields::instance();
354
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/install.php CHANGED
@@ -9,7 +9,6 @@ if (!class_exists('WOOCCM_Install')) {
9
  static function add_field_defaults($field, $key) {
10
 
11
  $defaults = array(
12
- 'enabled' => true,
13
  'order' => '',
14
  'cow' => '',
15
  'type' => '',
@@ -127,7 +126,6 @@ if (!class_exists('WOOCCM_Install')) {
127
 
128
  function woocommerce() {
129
  self::field_defaults();
130
- //var_dump(apply_filters('woocommerce_billing_fields', WC()->countries->get_default_address_fields()));
131
  }
132
 
133
  function init() {
9
  static function add_field_defaults($field, $key) {
10
 
11
  $defaults = array(
 
12
  'order' => '',
13
  'cow' => '',
14
  'type' => '',
126
 
127
  function woocommerce() {
128
  self::field_defaults();
 
129
  }
130
 
131
  function init() {
new/model/class-wooccm-field-additional.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Field_Additional')) {
4
+
5
+ class WOOCCM_Field_Additional extends WOOCCM_Field_Compatibility {
6
+
7
+ const PREFIX = 'additional';
8
+ const OPTION_NAME = 'wccs_settings';
9
+
10
+ public $default = array();
11
+
12
+ public function get_defaults() {
13
+ return $this->default;
14
+ }
15
+
16
+ }
17
+ }
new/model/class-wooccm-field-billing.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Field_Billing')) {
4
+
5
+ class WOOCCM_Field_Billing extends WOOCCM_Field_Compatibility {
6
+
7
+ const PREFIX = 'billing';
8
+ const OPTION_NAME = 'wccs_settings3';
9
+
10
+ public $default = array(
11
+ 'country',
12
+ 'first_name',
13
+ 'last_name',
14
+ 'company',
15
+ 'address_1',
16
+ 'address_2',
17
+ 'city',
18
+ 'state',
19
+ 'postcode',
20
+ 'email',
21
+ 'phone'
22
+ );
23
+
24
+ public function get_defaults() {
25
+ return $this->default;
26
+ }
27
+
28
+ }
29
+ }
new/model/class-wooccm-field-old.php ADDED
@@ -0,0 +1,540 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WOOCCM_Field_Compatibility extends WOOCCM_Field {
4
+
5
+ const PREFIX = '';
6
+ const OPTION_NAME = '';
7
+
8
+ private $old_to_old_types = array(
9
+ 'heading' => 'heading',
10
+ 'text' => 'wooccmtext',
11
+ 'textarea' => 'wooccmtextarea',
12
+ 'password' => 'wooccmpassword',
13
+ 'select' => 'wooccmselect',
14
+ 'radio' => 'wooccmradio',
15
+ 'checkbox' => 'checkbox_wccm',
16
+ //'button' => __('Button', 'woocommerce-checkout-manager'),
17
+ 'country' => 'wooccmcountry',
18
+ 'state' => 'wooccmstate',
19
+ 'multiselect' => 'multiselect',
20
+ 'multicheckbox' => 'multicheckbox',
21
+ 'datepicker' => 'datepicker',
22
+ 'timepicker' => 'time',
23
+ 'colorpicker' => 'colorpicker',
24
+ 'file' => 'wooccmupload',
25
+ );
26
+ private $old_to_old_args = array(
27
+ 'disabled' => null,
28
+ 'order' => null,
29
+ 'priority' => null,
30
+ 'name' => 'cow',
31
+ 'type' => null,
32
+ 'label' => null,
33
+ 'placeholder' => null,
34
+ 'default' => 'force_title2',
35
+ 'position' => null,
36
+ 'clear' => 'clear_row',
37
+ 'options' => 'option_array',
38
+ 'required' => 'checkbox',
39
+ // Display
40
+ // -------------------------------------------------------------------
41
+ 'show_role' => 'role_option',
42
+ 'hide_role' => 'role_option2',
43
+ 'more_product' => 'more_content',
44
+ 'show_product' => 'single_px',
45
+ 'hide_product' => 'single_p',
46
+ 'show_product_cat' => 'single_px_cat',
47
+ 'hide_product_cat' => 'single_p_cat',
48
+ // Timing
49
+ // -------------------------------------------------------------------
50
+ 'time_limit_start' => 'start_hour',
51
+ 'time_limit_end' => 'end_hour',
52
+ 'time_limit_interval' => 'interval_min',
53
+ 'manual_min' => null,
54
+ 'date_limit' => 'date_limit',
55
+ 'date_limit_variable_min' => 'min_before',
56
+ 'date_limit_variable_max' => 'max_after',
57
+ 'date_limit_fixed_min' => null,
58
+ 'date_limit_fixed_max' => null,
59
+ 'date_limit_days' => null,
60
+ 'single_dd' => null,
61
+ 'single_mm' => null,
62
+ 'single_yy' => null,
63
+ 'single_max_dd' => null,
64
+ 'single_max_mm' => null,
65
+ 'single_max_yy' => null,
66
+ // Amount
67
+ // -------------------------------------------------------------------
68
+ 'add_amount' => null,
69
+ 'add_amount_name' => 'fee_name',
70
+ 'add_amount_total' => 'add_amount_field',
71
+ 'add_amount_type' => null,
72
+ 'add_amount_tax' => 'tax_remove',
73
+ 'extra_class' => null,
74
+ // Conditional
75
+ // -------------------------------------------------------------------
76
+ 'conditional' => 'conditional_parent_use',
77
+ 'conditional_parent_name' => 'conditional_tie',
78
+ 'conditional_parent_value' => 'chosen_valt',
79
+ // Color
80
+ // -------------------------------------------------------------------
81
+ 'pickertype' => 'colorpickertype',
82
+ // Display
83
+ // -------------------------------------------------------------------
84
+ 'listable' => null,
85
+ 'sortable' => null,
86
+ 'filterable' => null,
87
+ //
88
+ // Email
89
+ // -------------------------------------------------------------------
90
+ //deny_receipt
91
+ //'pickertype' => null,
92
+ //'fancy' => null,
93
+ );
94
+ private $old_args = array(
95
+ 'disabled',
96
+ 'order',
97
+ 'priority',
98
+ 'cow',
99
+ 'type',
100
+ 'label',
101
+ 'placeholder',
102
+ 'force_title2',
103
+ 'position',
104
+ 'clear_row',
105
+ 'option_array',
106
+ 'checkbox',
107
+ 'role_option',
108
+ 'role_option2',
109
+ 'more_content',
110
+ 'single_p',
111
+ 'single_px',
112
+ 'single_p_cat',
113
+ 'single_px_cat',
114
+ 'start_hour',
115
+ 'end_hour',
116
+ 'interval_min',
117
+ 'manual_min',
118
+ 'min_before',
119
+ 'max_after',
120
+ 'single_dd',
121
+ 'single_mm',
122
+ 'single_yy',
123
+ 'single_max_dd',
124
+ 'single_max_mm',
125
+ 'single_max_yy',
126
+ 'days_disabler',
127
+ 'days_disabler0',
128
+ 'days_disabler1',
129
+ 'days_disabler2',
130
+ 'days_disabler3',
131
+ 'days_disabler4',
132
+ 'days_disabler5',
133
+ 'days_disabler6',
134
+ 'add_amount',
135
+ 'fee_name',
136
+ 'add_amount_field',
137
+ 'tax_remove',
138
+ 'conditional_parent_use',
139
+ 'conditional_tie',
140
+ 'chosen_valt',
141
+ 'extra_class',
142
+ 'colorpickertype',
143
+ 'colorpickerd',
144
+ 'role_options',
145
+ 'role_options2',
146
+ 'changenamep',
147
+ 'changename',
148
+ );
149
+
150
+ public function get_default_fields() {
151
+
152
+ $fields = array();
153
+
154
+ if (static::PREFIX) {
155
+
156
+ foreach (WC()->countries->get_address_fields('', static::PREFIX) as $key => $field) {
157
+
158
+ $field['name'] = str_replace(static::PREFIX, '', $key);
159
+
160
+ $fields[] = $field;
161
+ }
162
+ }
163
+
164
+ return $fields;
165
+ }
166
+
167
+ function replace_keys($array = array(), $replace = array()) {
168
+
169
+ foreach ($array as $key => $value) {
170
+
171
+ if (array_key_exists($key, $replace)) {
172
+
173
+ $array[$replace[$key]] = $value;
174
+
175
+ unset($array[$key]);
176
+ }
177
+ }
178
+
179
+ return $array;
180
+ }
181
+
182
+ function replace_value($value = '', $replace = array()) {
183
+ if (array_key_exists($value, $replace)) {
184
+ return $replace[$value];
185
+ }
186
+
187
+ return $value;
188
+ }
189
+
190
+ function string_to_array($value) {
191
+
192
+ if (!empty($value) && !is_array($value)) {
193
+ if (strpos($value, '||') !== false) {
194
+ $value = explode('||', $value);
195
+ } else {
196
+ $value = (array) $value;
197
+ }
198
+ }
199
+
200
+ return $value;
201
+ }
202
+
203
+ function array_to_string($value) {
204
+
205
+ if (!empty($value) && is_array($value)) {
206
+ if (count($value)) {
207
+ $value = implode('||', $value);
208
+ } else {
209
+ $value = $value[0];
210
+ }
211
+ }
212
+
213
+ return $value;
214
+ }
215
+
216
+ function get_new_args($field = array()) {
217
+
218
+ $replace = array_flip(array_filter($this->old_to_old_args));
219
+
220
+ $field = $this->replace_keys($field, $replace);
221
+
222
+ $field = wp_parse_args($field, $this->get_args());
223
+
224
+ return $field;
225
+ }
226
+
227
+ function get_old_args($field = array()) {
228
+
229
+ $replace = array_filter($this->old_to_old_args);
230
+
231
+ $field = $this->replace_keys($field, $replace);
232
+
233
+ return $field;
234
+ }
235
+
236
+ function get_new_type($type = '') {
237
+
238
+ $replace = array_flip(array_filter($this->old_to_old_types));
239
+
240
+ $type = $this->replace_value($type, $replace);
241
+
242
+ return $type;
243
+ }
244
+
245
+ function get_old_type($type = '') {
246
+
247
+ $replace = array_filter($this->old_to_old_types);
248
+
249
+ $type = $this->replace_value($type, $replace);
250
+
251
+ return $type;
252
+ }
253
+
254
+ function new_panel_compatibility($field_id, $field = array(), $fields = array()) {
255
+
256
+ $field = $this->get_new_args($field);
257
+
258
+ $field = wp_parse_args($field, $this->get_args());
259
+
260
+ $field['id'] = $field_id;
261
+
262
+ if (empty($field['name'])) {
263
+
264
+ $field['name'] = $this->get_name($field_id);
265
+
266
+ if ($this->duplicated_name($field['name'], $fields)) {
267
+ $field['name'] .= 'b';
268
+ }
269
+ }
270
+
271
+ if (!isset($field['order'])) {
272
+ $field['order'] = $field_id + 1;
273
+ }
274
+
275
+ if (!isset($field['key'])) {
276
+ $field['key'] = $this->get_key(static::PREFIX, $field['name']);
277
+ }
278
+
279
+ if ($field['type'] == 'colorpicker' && !empty($field['colorpickerd'])) {
280
+ $field['default'] = $field['colorpickerd'];
281
+ }
282
+
283
+ $field['type'] = $this->get_new_type($field['type']);
284
+
285
+ $field['show_role'] = $this->string_to_array($field['show_role']);
286
+ $field['hide_role'] = $this->string_to_array($field['hide_role']);
287
+ //$field['options'] = $this->string_to_array($field['options']);
288
+ $field['show_product'] = $this->string_to_array($field['show_product']);
289
+ $field['hide_product'] = $this->string_to_array($field['hide_product']);
290
+ $field['show_product_cat'] = $this->string_to_array($field['show_product_cat']);
291
+ $field['hide_product_cat'] = $this->string_to_array($field['hide_product_cat']);
292
+ $field['add_amount_tax'] = !$field['add_amount_tax'];
293
+
294
+ // Days
295
+ if (!empty($field['days_disabler'])) {
296
+
297
+ $field['date_limit_days'] = array();
298
+
299
+ for ($day_index = 0; $day_index <= 6; $day_index++) {
300
+
301
+ if (!empty($field['days_disabler' . $day_index])) {
302
+ $field['date_limit_days'][strval($day_index)] = strval($day_index);
303
+ unset($field['days_disabler' . $day_index]);
304
+ }
305
+ }
306
+ }
307
+
308
+ // Dates
309
+ if (!empty($field['single_yy']) && !empty($field['single_mm']) && !empty($field['single_dd'])) {
310
+ $field['date_limit_fixed_min'] = $field['single_yy'] . '-' . $field['single_mm'] . '-' . $field['single_dd'];
311
+ unset($field['single_yy']);
312
+ unset($field['single_mm']);
313
+ unset($field['single_dd']);
314
+ } else {
315
+ $field['date_limit_fixed_min'] = '';
316
+ }
317
+ if (!empty($field['single_max_yy']) && !empty($field['single_max_mm']) && !empty($field['single_max_dd'])) {
318
+ $field['date_limit_fixed_max'] = $field['single_max_yy'] . '-' . $field['single_max_mm'] . '-' . $field['single_max_dd'];
319
+ unset($field['single_max_yy']);
320
+ unset($field['single_max_mm']);
321
+ unset($field['single_max_dd']);
322
+ } else {
323
+ $field['date_limit_fixed_max'] = '';
324
+ }
325
+
326
+ //return $field;
327
+ return array_intersect_key($field, array_flip(array_keys($this->get_args())));
328
+ }
329
+
330
+ function old_panel_compatibility($field_id, $field = array()) {
331
+
332
+ $field = $this->get_old_args($field);
333
+
334
+ $field = wp_parse_args($field, array_fill_keys($this->old_args, null));
335
+
336
+ $field['type'] = $this->get_old_type($field['type']);
337
+
338
+ $field['role_option'] = $this->array_to_string($field['role_option']);
339
+ $field['role_option2'] = $this->array_to_string($field['role_option2']);
340
+ //$field['option_array'] = $this->array_to_string($field['option_array']);
341
+ $field['single_p'] = $this->array_to_string($field['single_p']);
342
+ $field['single_px'] = $this->array_to_string($field['single_px']);
343
+ $field['single_p_cat'] = $this->array_to_string($field['single_p_cat']);
344
+ $field['single_px_cat'] = $this->array_to_string($field['single_px_cat']);
345
+ $field['tax_remove'] = !$field['tax_remove'];
346
+
347
+ // Days
348
+ if (is_array($field['days_disabler'])) {
349
+ foreach ($field['days_disabler'] as $day_index => $day) {
350
+ $field['days_disabler' . strval($day_index)] = 1;
351
+ }
352
+ $field['days_disabler'] = 1;
353
+ unset($field['date_limit_days']);
354
+ }
355
+
356
+ // Dates
357
+ if (!empty($field['date_limit_fixed_min'])) {
358
+
359
+ $min = explode('-', $field['date_limit_fixed_min']);
360
+
361
+ $field['single_yy'] = $min[0];
362
+ $field['single_mm'] = $min[1];
363
+ $field['single_dd'] = $min[2];
364
+ }
365
+
366
+ if (!empty($field['date_limit_fixed_max'])) {
367
+
368
+ $max = explode('-', $field['date_limit_fixed_max']);
369
+
370
+ $field['single_max_yy'] = $max[0];
371
+ $field['single_max_mm'] = $max[1];
372
+ $field['single_max_dd'] = $max[2];
373
+ }
374
+
375
+ return array_intersect_key($field, array_flip($this->old_args));
376
+ }
377
+
378
+ // Get
379
+ // ---------------------------------------------------------------------------
380
+
381
+ public function get_fields($old = false) {
382
+
383
+ if ($old) {
384
+ return $this->get_fields_old();
385
+ } else {
386
+ return $this->get_fields_new();
387
+ }
388
+ }
389
+
390
+ protected function get_fields_old() {
391
+
392
+ if ($fields = $this->get_option()) {
393
+
394
+ foreach ($fields as $field_id => $field) {
395
+
396
+ $fields[$field_id] = $this->old_panel_compatibility($field_id, $field);
397
+ }
398
+ }
399
+
400
+ return $fields;
401
+ }
402
+
403
+ protected function get_fields_new() {
404
+
405
+ $defaults = $this->get_default_fields();
406
+
407
+ if ($fields = $this->get_option($defaults)) {
408
+
409
+ foreach ($fields as $field_id => $field) {
410
+ $fields[$field_id] = $this->new_panel_compatibility($field_id, $field, $fields);
411
+ }
412
+ }
413
+
414
+ return $fields;
415
+ }
416
+
417
+ public function get_field($field_id) {
418
+
419
+ if ($fields = $this->get_option()) {
420
+
421
+ if (array_key_exists($field_id, $fields)) {
422
+
423
+ $field = $fields[$field_id];
424
+
425
+ return $this->new_panel_compatibility($field_id, $field, $fields);
426
+ }
427
+ }
428
+ }
429
+
430
+ // Save
431
+ // ---------------------------------------------------------------------------
432
+
433
+ public function update_fields($fields) {
434
+
435
+ if (is_array($fields) && array_key_exists('name', $fields[0])) {
436
+
437
+ // save in old format
438
+ foreach ($fields as $field_id => $field) {
439
+ $fields[$field_id] = $this->old_panel_compatibility($field_id, $field);
440
+ }
441
+
442
+ if ($this->update_option($fields)) {
443
+ return $fields;
444
+ }
445
+ }
446
+
447
+ return false;
448
+ }
449
+
450
+ public function update_field($field_id, $field_data) {
451
+
452
+ $fields = $this->get_fields_new();
453
+
454
+ if (array_key_exists($field_id, $fields)) {
455
+
456
+ $fields[$field_id] = array_replace($fields[$field_id], $field_data);
457
+
458
+ if ($this->update_fields($fields)) {
459
+ return $fields[$field_id];
460
+ }
461
+ }
462
+
463
+ return false;
464
+ }
465
+
466
+ public function add_field($field_data) {
467
+
468
+ $fields = $this->get_fields_new();
469
+
470
+ //$field_id = count($fields);
471
+ $field_id = absint(key(array_slice($fields, -1, 1, true))) + 1;
472
+
473
+ $field_data = $this->new_panel_compatibility($field_id, $field_data, $fields);
474
+
475
+ $fields[] = $field_data;
476
+
477
+ if ($this->update_fields($fields)) {
478
+ return $field_data;
479
+ }
480
+
481
+ return false;
482
+ }
483
+
484
+ public function delete_field($field_id) {
485
+
486
+ $fields = $this->get_fields_new();
487
+
488
+ unset($fields[$field_id]);
489
+
490
+ if ($this->update_fields($fields)) {
491
+ return true;
492
+ }
493
+
494
+ return false;
495
+ }
496
+
497
+ // Core
498
+ // -------------------------------------------------------------------------
499
+
500
+ protected function get_option($defaults = array()) {
501
+
502
+ if ($fields = get_option($this->option_name, $defaults)) {
503
+
504
+ // Compatibility with 4.x
505
+ // ---------------------------------------------------------------------
506
+ if (array_key_exists("{$this->prefix}_buttons", $fields)) {
507
+ $fields = $fields["{$this->prefix}_buttons"];
508
+ }
509
+
510
+ // Additional compatibility with 4.x
511
+ // ---------------------------------------------------------------------
512
+ if ('wccs_settings' == $this->option_name) {
513
+ $fields = (array) @$fields['buttons'];
514
+ }
515
+ }
516
+
517
+ // Resort the fields by order
518
+ uasort($fields, array(__CLASS__, 'order_fields'));
519
+
520
+ return $fields;
521
+ }
522
+
523
+ protected function update_option($fields) {
524
+
525
+ $options = get_option(static::OPTION_NAME, array());
526
+
527
+ // Additional compatibility with 4.x
528
+ // ---------------------------------------------------------------------
529
+ if (static::OPTION_NAME == 'wccs_settings') {
530
+ $options['buttons'] = $fields;
531
+ } else {
532
+ $options[static::PREFIX . '_buttons'] = $fields;
533
+ }
534
+
535
+ update_option(static::OPTION_NAME, $options);
536
+
537
+ return true;
538
+ }
539
+
540
+ }
new/model/class-wooccm-field-shipping.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Field_Shipping')) {
4
+
5
+ class WOOCCM_Field_Shipping extends WOOCCM_Field_Compatibility {
6
+
7
+ const PREFIX = 'shipping';
8
+ const OPTION_NAME = 'wccs_settings2';
9
+
10
+ public $default = array(
11
+ 'country',
12
+ 'first_name',
13
+ 'last_name',
14
+ 'company',
15
+ 'address_1',
16
+ 'address_2',
17
+ 'city',
18
+ 'state',
19
+ 'postcode',
20
+ );
21
+
22
+ public function get_defaults() {
23
+ return $this->default;
24
+ }
25
+
26
+ }
27
+ }
new/model/class-wooccm-field.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WOOCCM_Field {
4
+
5
+ const PREFIX = '';
6
+ const OPTION_NAME = '';
7
+
8
+ function __construct() {
9
+ $this->prefix = static::PREFIX;
10
+ $this->option_name = static::OPTION_NAME;
11
+ }
12
+
13
+ protected function order_fields($a, $b) {
14
+
15
+ if (!isset($a['order']) || !isset($b['order']))
16
+ return 0;
17
+
18
+ if ($a['order'] == $b['order'])
19
+ return 0;
20
+
21
+ return ( $a['order'] < $b['order'] ) ? -1 : 1;
22
+ }
23
+
24
+ function duplicated_name($name, $fields) {
25
+
26
+ if (!empty($fields)) {
27
+ if (is_array($fields)) {
28
+ foreach ($fields as $item) {
29
+ if (isset($item['name']) && $item['name'] == $name) {
30
+ return true;
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+
37
+ public function get_name($field_id) {
38
+ return WOOCCM_PREFIX . $field_id;
39
+ }
40
+
41
+ public function get_key($prefix = '', $name) {
42
+ return sprintf("%s_%s", $prefix, $name);
43
+ }
44
+
45
+ public function get_conditional_types() {
46
+
47
+ $fields = self::get_types();
48
+
49
+ unset($fields['heading']);
50
+ unset($fields['button']);
51
+
52
+ return array_keys($fields);
53
+ }
54
+
55
+ public function get_multiple_types() {
56
+
57
+ return array(
58
+ 'multicheckbox',
59
+ 'multiselect',
60
+ 'wooccmselect',
61
+ 'select',
62
+ 'radio'
63
+ );
64
+ }
65
+
66
+ public function get_types() {
67
+
68
+ return apply_filters('wooccm_fields_fields_types', array(
69
+ 'heading' => __('Heading', 'woocommerce-checkout-manager'),
70
+ 'text' => __('Text', 'woocommerce-checkout-manager'),
71
+ 'textarea' => __('Textarea', 'woocommerce-checkout-manager'),
72
+ 'password' => __('Password', 'woocommerce-checkout-manager'),
73
+ 'select' => __('Select', 'woocommerce-checkout-manager'),
74
+ 'radio' => __('Radio', 'woocommerce-checkout-manager'),
75
+ 'checkbox' => __('Checkbox', 'woocommerce-checkout-manager'),
76
+ 'country' => __('Country', 'woocommerce-checkout-manager'),
77
+ 'state' => __('State', 'woocommerce-checkout-manager'),
78
+ 'multiselect' => __('Multiselect', 'woocommerce-checkout-manager'),
79
+ 'multicheckbox' => __('Multicheckbox', 'woocommerce-checkout-manager'),
80
+ 'colorpicker' => __('Colorpicker', 'woocommerce-checkout-manager'),
81
+ 'file' => __('File', 'woocommerce-checkout-manager'),
82
+ //'button' => __('Button', 'woocommerce-checkout-manager'),
83
+ //'datepicker' => __('Datepicker', 'woocommerce-checkout-manager'),
84
+ //'timepicker' => __('Timepicker', 'woocommerce-checkout-manager'),
85
+ ));
86
+ }
87
+
88
+ function get_args() {
89
+
90
+ return array(
91
+ 'id' => null,
92
+ 'key' => null,
93
+ 'name' => '',
94
+ 'type' => 'text',
95
+ 'disabled' => null,
96
+ 'order' => null,
97
+ 'priority' => null,
98
+ 'label' => null,
99
+ 'placeholder' => null,
100
+ 'default' => null,
101
+ 'position' => null,
102
+ 'clear' => null,
103
+ 'options' => null,
104
+ 'required' => null,
105
+ // Display
106
+ // -------------------------------------------------------------------
107
+ 'show_role' => null,
108
+ 'hide_role' => null,
109
+ 'more_product' => null,
110
+ 'show_product' => array(),
111
+ 'hide_product' => array(),
112
+ 'show_product_cat' => array(),
113
+ 'hide_product_cat' => array(),
114
+ // Timing
115
+ // -------------------------------------------------------------------
116
+ 'time_limit_start' => null,
117
+ 'time_limit_end' => null,
118
+ 'time_limit_interval' => null,
119
+ 'date_limit' => 'fixed',
120
+ 'date_limit_variable_min' => 1,
121
+ 'date_limit_variable_max' => 1,
122
+ 'date_limit_fixed_min' => date('Y-m-d'),
123
+ 'date_limit_fixed_max' => date('Y-m-d'),
124
+ // Amount
125
+ // -------------------------------------------------------------------
126
+ 'add_amount' => null,
127
+ 'add_amount_name' => null,
128
+ 'add_amount_total' => null,
129
+ 'add_amount_type' => null,
130
+ 'add_amount_tax' => null,
131
+ 'extra_class' => null,
132
+ // Conditional
133
+ // -------------------------------------------------------------------
134
+ 'conditional' => null,
135
+ 'conditional_parent_name' => null,
136
+ 'conditional_parent_value' => null,
137
+ // Listing
138
+ // -------------------------------------------------------------------
139
+ 'listable' => null,
140
+ 'sortable' => null,
141
+ 'filterable' => null,
142
+ );
143
+ }
144
+
145
+ }
new/view/backend/meta-boxes/html-order-uploads.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="wooccm_order_attachment_inner" class="wc-metaboxes-wrapper">
2
+ <table class="woocommerce_order_items back_end">
3
+ <thead>
4
+ <tr>
5
+ <!--<th><?php _e('ID', 'woocommerce-checkout-manager'); ?></th>-->
6
+ <th><?php _e('Image', 'woocommerce-checkout-manager'); ?></th>
7
+ <th><?php _e('Filename', 'woocommerce-checkout-manager'); ?></th>
8
+ <th><?php _e('Dimensions', 'woocommerce-checkout-manager'); ?></th>
9
+ <th><?php _e('Extension', ' woocommerce-checkout-manager'); ?></th>
10
+ <th class="column-actions"><?php _e('Actions', 'woocommerce-checkout-manager'); ?></th>
11
+ </tr>
12
+ </thead>
13
+ <tbody class="product_images">
14
+ <?php
15
+ if (!empty($attachments)) :
16
+ foreach ($attachments as $attachment_id) :
17
+ $image_attributes = wp_get_attachment_url($attachment_id);
18
+ $image_attributes2 = wp_get_attachment_image_src($attachment_id);
19
+ $filename = basename($image_attributes);
20
+ $wp_filetype = wp_check_filetype($filename);
21
+ ?>
22
+ <tr class="image wccm_filesli wccmv_<?php echo esc_attr($attachment_id); ?>">
23
+ <!--<td><?php echo esc_attr($attachment_id); ?></td>-->
24
+ <td><?php echo wp_get_attachment_link($attachment_id, '', false, false, wp_get_attachment_image($attachment_id, array(75, 75), false)); ?></td>
25
+ <td><?php echo wp_get_attachment_link($attachment_id, '', false, false, preg_replace('/\.[^.]+$/', '', $filename)); ?></td>
26
+ <td>
27
+ <?php
28
+ if ($image_attributes2[1] == '') {
29
+ echo '-';
30
+ } else {
31
+ echo $image_attributes2[1] . ' x ' . $image_attributes2[2];
32
+ }
33
+ ?>
34
+ </td>
35
+ <td><?php echo strtoupper($wp_filetype['ext']); ?></td>
36
+ <td class="column-actions" nowrap>
37
+ <!--<a href="<?php echo esc_url($image_attributes2[0]); ?>" target="_blank" class="button"><?php esc_html_e('Download', 'woocommerce-checkout-manager'); ?></a>-->
38
+ <a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr($attachment_id); ?>" data-tip="<?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></a>
39
+ </td>
40
+ </tr>
41
+ <?php endforeach; ?>
42
+ <?php else: ?>
43
+ <tr>
44
+ <td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
45
+ </tr>
46
+ <?php endif; ?>
47
+ </tbody>
48
+ </table>
49
+ <input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
50
+ <input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
51
+ <div class="clear"></div>
52
+ <div class="add_product_images hide-if-no-js">
53
+ <a class="button button-primary wccm_add_order_link fileinput-button">
54
+ <span><?php _e('Add Order Files', 'woocommerce-checkout-manager'); ?></span>
55
+ <input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
56
+ </a>
57
+ <input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php _e('Save Changes', 'woocommerce-checkout-manager'); ?>" disabled="disabled">
58
+ </div>
59
+ <div class="wccm_results"></div>
60
+ <div class="clear"></div>
61
+ </div>
new/view/backend/order.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Order_Admin')) {
4
+
5
+ class WOOCCM_Order_Admin {
6
+
7
+ protected static $instance;
8
+
9
+ function enqueue_scripts() {
10
+
11
+ if ($screen = get_current_screen()) {
12
+
13
+ if (in_array($screen->id, array(/* 'product', 'edit-product', */'shop_order', 'edit-shop_order'))) {
14
+
15
+ WOOCCM()->register_scripts();
16
+
17
+ // only for backend maybe orders
18
+ wp_enqueue_media();
19
+ wp_enqueue_script('wooccm-order-upload');
20
+ }
21
+ }
22
+ }
23
+
24
+ function order_uploads_metabox_content($post) {
25
+
26
+ if ($order = wc_get_order($post->ID)) {
27
+
28
+ $attachments = get_posts(array(
29
+ 'fields' => 'ids',
30
+ 'post_type' => 'attachment',
31
+ 'numberposts' => -1,
32
+ 'post_status' => null,
33
+ 'post_parent' => $order->get_id()
34
+ ));
35
+ ?>
36
+
37
+ <?php wp_enqueue_style('wccm_upload_file_style', plugins_url('assets/old/edit-order-uploads-file_editing_table.css', WOOCCM_PLUGIN_FILE)); ?>
38
+
39
+ <?php include WOOCCM_PLUGIN_DIR . 'new/view/backend/meta-boxes/html-order-uploads.php'; ?>
40
+
41
+ <?php
42
+
43
+ }
44
+ }
45
+
46
+ function order_uploads_metabox() {
47
+ add_meta_box('woocommerce-order-files', esc_html__('Order Uploaded Files', 'woocommerce-checkout-manager'), array($this, 'order_uploads_metabox_content'), 'shop_order', 'normal', 'default');
48
+ }
49
+
50
+ function init() {
51
+ add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
52
+ add_action('add_meta_boxes', array($this, 'order_uploads_metabox'));
53
+ }
54
+
55
+ public static function instance() {
56
+ if (!isset(self::$instance)) {
57
+ self::$instance = new self();
58
+ self::$instance->init();
59
+ }
60
+ return self::$instance;
61
+ }
62
+
63
+ }
64
+
65
+ WOOCCM_Order_Admin::instance();
66
+ }
new/view/backend/pages/additional.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php include_once('parts/header.php'); ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></h1>
3
+ <h2><?php esc_html_e('Additional fields', 'woocommerce-checkout-manager'); ?></h2>
4
+ <div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
5
+ <p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
+ </div>
7
+ <?php include_once('parts/actions.php'); ?>
8
+ <?php include_once('parts/loop.php'); ?>
9
+ <script type="text/html" id='tmpl-wooccm-modal-window'>
10
+ <?php include_once('modals/edit.php'); ?>
11
+ </script>
new/view/backend/pages/advanced.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="widefat general-semi advanced" border="1">
2
+
3
+ <div class="section">
4
+ <h3 class="heading"><?php _e('Advanced', 'woocommerce-checkout-manager'); ?></h3>
5
+ </div>
6
+ <!-- .section -->
7
+
8
+ <div class="section">
9
+
10
+ <div class="option">
11
+ <div class="info-of"><?php _e('Administrator Actions', 'woocommerce-checkout-manager'); ?></div>
12
+ <?php if (current_user_can('manage_options')) { ?>
13
+ <ul>
14
+ <li><a href="<?php echo add_query_arg(array('action' => 'wooccm_reset_update_notice', '_wpnonce' => wp_create_nonce('wooccm_reset_update_notice'))); ?>"><?php _e('Reset <em>Run the updater</em> prompt', 'woocommerce-checkout-manager'); ?></a></li>
15
+ <li><a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_options', '_wpnonce' => wp_create_nonce('wooccm_nuke_options'))); ?>" class="confirm-button" data-confirm="<?php _e('This will permanently delete all WordPress Options associated with WooCommerce Checkout Manager. Are you sure you want to proceed?', 'woocommerce-checkout-manager'); ?>"><?php _e('Delete WooCommerce Checkout Manager WordPress Options', 'woocommerce-checkout-manager'); ?></a></li>
16
+ <li><a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_order_meta', '_wpnonce' => wp_create_nonce('wooccm_nuke_order_meta'))); ?>" class="confirm-button" data-confirm="<?php _e('This will permanently delete all WordPress Post meta associated with WooCommerce Checkout Manager that is linked to Orders. Are you sure you want to proceed?', 'woocommerce-checkout-manager'); ?>"><?php _e('Delete WooCommerce Checkout Manager Orders Post meta', 'woocommerce-checkout-manager'); ?></a></li>
17
+ <li><a href="<?php echo add_query_arg(array('action' => 'wooccm_nuke_user_meta', '_wpnonce' => wp_create_nonce('wooccm_nuke_user_meta'))); ?>" class="confirm-button" data-confirm="<?php _e('This will permanently delete all WordPress Post meta associated with WooCommerce Checkout Manager that is linked to Users. Are you sure you want to proceed?', 'woocommerce-checkout-manager'); ?>"><?php _e('Delete WooCommerce Checkout Manager Users Post meta', 'woocommerce-checkout-manager'); ?></a></li>
18
+ </ul>
19
+ <?php } else { ?>
20
+ <p><?php _e('These actions are available only to WordPress Users with the <em>manage_options</em> User Capability.', 'woocommerce-checkout-manager'); ?></p>
21
+ <?php } ?>
22
+ </div>
23
+ <!-- .option -->
24
+
25
+ </div>
26
+ <!-- .section -->
27
+
28
+ </div>
29
+ <!--.advanced -->
new/view/backend/pages/billing.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php include_once('parts/header.php'); ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></h1>
3
+ <h2><?php esc_html_e('Billing fields', 'woocommerce-checkout-manager'); ?></h2>
4
+ <div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
5
+ <p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
+ </div>
7
+ <?php include_once('parts/actions.php'); ?>
8
+ <?php include_once('parts/loop.php'); ?>
9
+ <script type="text/html" id='tmpl-wooccm-modal-window'>
10
+ <?php include_once('modals/edit.php'); ?>
11
+ </script>
new/view/backend/pages/general.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h1 class="screen-reader-text"><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></h1>
2
+ <h2><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></h2>
3
+ <div id="wooccm_billing_settings-description">
4
+ <p>Email notifications sent from WooCommerce are listed below. Click on an email to configure it.</p>
5
+ </div>
6
+ <table class="form-table" cellspacing="0">
7
+ <tbody>
8
+ <tr valign="top" class="">
9
+ <th scope="row" class="titledesc">
10
+ <?php esc_html_e('Hide shipping fields', 'woocommerce-checkout-manager'); ?>
11
+ </th>
12
+ <td class="forminp forminp-checkbox">
13
+ <fieldset>
14
+ <legend class="screen-reader-text">
15
+ <span>
16
+ <?php printf(__('Hide %s heading', 'woocommerce-checkout-manager'), __('Ship to a different address?', 'woocommerce-checkout-manager')); ?>
17
+ </span>
18
+ </legend>
19
+ <label for="woocommerce_allow_bulk_remove_personal_data">
20
+ <input type="checkbox" name="wccs_settings[checkness][additional_info]" value="true"<?php checked(!empty($options['checkness']['additional_info']), true); ?> />
21
+ <?php printf(__('Hide %s heading', 'woocommerce-checkout-manager'), __('Ship to a different address?', 'woocommerce-checkout-manager')); ?>
22
+ </label>
23
+ <!--<p class="description"><?php printf(__('Hide %s heading', 'woocommerce-checkout-manager'), __('Ship to a different address?', 'woocommerce-checkout-manager')); ?></p>-->
24
+ </fieldset>
25
+ </td>
26
+ </tr>
27
+
28
+ <tr valign="top" class="">
29
+ <th scope="row" class="titledesc">
30
+ <?php esc_html_e('Show shipping checkout fields', 'woocommerce-checkout-manager'); ?>
31
+ </th>
32
+ <td class="forminp forminp-checkbox">
33
+ <fieldset>
34
+ <legend class="screen-reader-text">
35
+ <span>
36
+ <?php esc_html_e('Show shipping checkout fields', 'woocommerce-checkout-manager'); ?>
37
+ </span>
38
+ </legend>
39
+ <label for="show_shipping_fields">
40
+ <input type="checkbox" name="wccs_settings[checkness][show_shipping_fields]" value="true"<?php checked(!empty($options['checkness']['show_shipping_fields']), true); ?> />
41
+ <?php printf(__(' Force show Shipping Checkout fields', 'woocommerce-checkout-manager'), sprintf(__('Hide %s heading', 'woocommerce-checkout-manager'), __('Ship to a different address?', 'woocommerce-checkout-manager'))); ?>
42
+ </label>
43
+ <p class="description"><?php printf(__('To be used in conjunction with %s', 'woocommerce-checkout-manager'), __('Ship to a different address?', 'woocommerce-checkout-manager')); ?></p>
44
+ </fieldset>
45
+ </td>
46
+ </tr>
47
+ <tr valign="top" class="">
48
+ <th scope="row" class="titledesc">
49
+ <?php esc_html_e('Hide create an account', 'woocommerce-checkout-manager'); ?>
50
+ </th>
51
+ <td class="forminp forminp-checkbox">
52
+ <fieldset>
53
+ <legend class="screen-reader-text">
54
+ <span>
55
+ <?php esc_html_e('Hide create an account', 'woocommerce-checkout-manager'); ?>
56
+ </span>
57
+ </legend>
58
+ <label for="auto_create_wccm_account">
59
+ <input type="checkbox" name="wccs_settings[checkness][auto_create_wccm_account]" value="true"<?php checked(!empty($options['checkness']['auto_create_wccm_account']), true); ?> />
60
+ <?php printf(__('Hide %s checkbox on Checkout page for guests', 'woocommerce-checkout-manager'), __('Create an account?', 'woocommerce-checkout-manager')); ?>
61
+ </label>
62
+ <p class="description"><?php printf(__('Hide %s checkbox on Checkout page for guests', 'woocommerce-checkout-manager'), __('Create an account?', 'woocommerce-checkout-manager')); ?></p>
63
+ </fieldset>
64
+ </td>
65
+ </tr>
66
+ <tr valign="top" class="">
67
+ <th scope="row" class="titledesc">
68
+ <?php _e('Retain Fields Information', 'woocommerce-checkout-manager'); ?>
69
+ </th>
70
+ <td class="forminp forminp-checkbox">
71
+ <fieldset>
72
+ <legend class="screen-reader-text">
73
+ <span>
74
+ <?php _e('Retain Fields Information', 'woocommerce-checkout-manager'); ?>
75
+ </span>
76
+ </legend>
77
+ <label for="retainval">
78
+ <input type="checkbox" name="wccs_settings[checkness][retainval]" value="true"<?php checked(!empty($options['checkness']['retainval']), true); ?> />
79
+ <?php _e('Retain Fields Information', 'woocommerce-checkout-manager'); ?>
80
+ </label>
81
+ <p class="description"><?php _e('Retain Fields Information', 'woocommerce-checkout-manager'); ?></p>
82
+ </fieldset>
83
+ </td>
84
+ </tr>
85
+ <tr valign="top" class="">
86
+ <th scope="row" class="titledesc">
87
+ <?php _e('Editing Of Abbreviation Fields', 'woocommerce-checkout-manager'); ?>
88
+ </th>
89
+ <td class="forminp forminp-checkbox">
90
+ <fieldset>
91
+ <legend class="screen-reader-text">
92
+ <span>
93
+ <?php _e('Editing Of Abbreviation Fields', 'woocommerce-checkout-manager'); ?>
94
+ </span>
95
+ </legend>
96
+ <label for="abbreviation">
97
+ <input type="checkbox" name="wccs_settings[checkness][abbreviation]" value="true"<?php checked(!empty($options['checkness']['abbreviation']), true); ?> />
98
+ <?php _e('Editing Of Abbreviation Fields', 'woocommerce-checkout-manager'); ?>
99
+ </label>
100
+ <p class="description"><?php _e('Editing Of Abbreviation Fields', 'woocommerce-checkout-manager'); ?></p>
101
+ </fieldset>
102
+ </td>
103
+ </tr>
104
+ <tr valign="top">
105
+ <th scope="row" class="titledesc">
106
+ <label for="position">
107
+ <?php _e('Additional fields position', 'woocommerce-checkout-manager'); ?>
108
+ <span class="woocommerce-help-tip"></span>
109
+ </label>
110
+ </th>
111
+ <td class="forminp forminp-select">
112
+ <select name="position" id="position" style="min-width:300px;" class="wc-enhanced-select enhanced" tabindex="-1" aria-hidden="true">
113
+ <option value="before_billing_form" <?php selected($options['checkness']['position'], 'before_billing_form'); ?>><?php _e('Before Billing fields', 'woocommerce-checkout-manager'); ?></option>
114
+ <option value="after_billing_form" <?php selected($options['checkness']['position'], 'after_billing_form'); ?>><?php _e('After Billing fields', 'woocommerce-checkout-manager'); ?></option>
115
+ <option value="before_shipping_form" <?php selected($options['checkness']['position'], 'before_shipping_form'); ?>><?php _e('Before Shipping fields', 'woocommerce-checkout-manager'); ?></option>
116
+ <option value="after_shipping_form" <?php selected($options['checkness']['position'], 'after_shipping_form'); ?>><?php _e('After Shipping fields', 'woocommerce-checkout-manager'); ?></option>
117
+ <option value="after_order_notes" <?php selected($options['checkness']['position'], 'after_order_notes'); ?>><?php _e('After Order Notes', 'woocommerce-checkout-manager'); ?></option>
118
+ </select>
119
+ </td>
120
+ </tr>
121
+ </tbody>
122
+ </table>
123
+ <!--<div class="section">
124
+ <h3 class="heading checkbox">
125
+ <div class="option">
126
+ <label>
127
+ <input type="checkbox" name="wccs_settings[checkness][admin_translation]" value="true"<?php checked(!empty($options['checkness']['admin_translation']), true); ?> />
128
+ <div class="info-of"><?php _e('Translate WooCommerce Checkout Manager Options Panel', 'woocommerce-checkout-manager'); ?></div>
129
+ </label>
130
+ </div>
131
+ </h3>
132
+ </div>-->
133
+ <!-- section -->
new/view/backend/pages/modals/edit.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="media-modal-backdrop">&nbsp;</div>
2
+ <div tabindex="0" id="<?php echo esc_attr(WOOCCM_PREFIX . '_modal'); ?>" class="media-modal wp-core-ui upload-php" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
3
+ <div class="media-modal-content" role="document">
4
+ <form class="media-modal-form" method="POST">
5
+ <div class="edit-attachment-frame mode-select hide-menu hide-router">
6
+ <div class="edit-media-header">
7
+ <# if ( data.id != undefined ) { #>
8
+ <button type="button" class="media-modal-prev left dashicons <# if ( data.id <= 0 ) { #>disabled<# } #>"><span class="screen-reader-text"><?php esc_html_e('Edit previous media item'); ?></span></button>
9
+ <button type="button" class="media-modal-next right dashicons <# if ( data.id >= <?php echo esc_attr(count($fields)) - 1 ?>) { #>disabled<# } #>"><span class="screen-reader-text"><?php esc_html_e('Edit next media item'); ?></span></button>
10
+ <# } #>
11
+ <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e('Close dialog'); ?></span></span></button>
12
+ </div>
13
+ <div class="media-frame-title">
14
+ <h1><?php esc_html_e('Edit field', 'woocommerce-checkout-manager'); ?> #<# if ( data.id != undefined ) { #>{{data.id}}<# } else { #><?php echo esc_html_e('New', 'woocommerce-checkout-manager'); ?><# } #></h1>
15
+ </div>
16
+ <div class="media-frame-content" style="bottom:61px;">
17
+ <div class="attachment-details">
18
+ <div class="attachment-media-view landscape" style="overflow: hidden;">
19
+ <div id="woocommerce-product-data">
20
+ <div class="panel-wrap product_data" style="overflow:visible;">
21
+ <?php include_once('parts/edit-tabs.php'); ?>
22
+ <?php include_once('parts/panel-general.php'); ?>
23
+ <?php //include_once('parts/panel-conditional.php'); ?>
24
+ <?php //include_once('parts/panel-amount.php'); ?>
25
+ <?php include_once('parts/panel-display.php'); ?>
26
+ <?php //include_once('parts/panel-datepicker.php'); ?>
27
+ <?php //include_once('parts/panel-timepicker.php'); ?>
28
+ <?php //include_once('parts/panel-advanced.php'); ?>
29
+ <?php //include_once('parts/panel-suggestions.php'); ?>
30
+ <div class="clear"></div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div class="attachment-info">
35
+ <?php include_once('parts/edit-info.php'); ?>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <div class="media-frame-toolbar" style="left:0;">
40
+ <div class="media-toolbar">
41
+ <div class="media-toolbar-secondary"></div>
42
+ <div class="media-toolbar-primary search-form">
43
+ <button type="submit" class="media-modal-save button button-primary media-button button-large"><?php esc_html_e('Save'); ?></button>
44
+ <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
45
+ float: none;
46
+ position: inherit;
47
+ padding: inherit;
48
+ "><?php esc_html_e('Close'); ?></button>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </form>
54
+ </div>
55
+ </div>
new/view/backend/pages/modals/parts/edit-info.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <span class="settings-save-status">
2
+ <span class="spinner"></span>
3
+ <span class="saved"><?php esc_html_e('Saved.'); ?></span>
4
+ </span>
5
+
6
+ <div class="details">
7
+ <div class="filename"><strong><?php esc_html_e('Field id', 'woocommerce-checkout-manager'); ?>:</strong> {{data.id}}</div>
8
+ <div class="filename"><strong><?php esc_html_e('Field name', 'woocommerce-checkout-manager'); ?>:</strong> {{data.name}}</div>
9
+ <!--
10
+ <div class="filename"><strong><?php esc_html_e('Field type', 'woocommerce-checkout-manager'); ?>:</strong> {{data.type}}</div>
11
+ -->
12
+ <div class="filename"><strong><?php esc_html_e('Field key', 'woocommerce-checkout-manager'); ?>:</strong> #{{data.key}}</div>
13
+ </div>
14
+
15
+ <div class="settings">
16
+ <label class="setting" data-setting="label">
17
+ <span class="name"><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></span>
18
+ <input <# if ( data.conditional == 'true' ) { #>checked<# } #> type="checkbox" name="conditional" value="true">
19
+ </label>
20
+ <p class="description"><?php esc_html_e('Activate conditional field requirement.', 'woocommerce-checkout-manager'); ?></p>
21
+ <label class="setting" data-setting="label">
22
+ <span class="name"><?php esc_html_e('Conditional parent', 'woocommerce-checkout-manager'); ?></span>
23
+ <select class="select short" name="conditional_parent_name">
24
+ <?php foreach ($fields as $key => $field) : ?>
25
+ <?php if (in_array($field['type'], $conditionals)): ?>
26
+ <# if ( data.id != '<?php echo esc_attr($field['id']); ?>' ) { #>
27
+ <option <# if ( data.conditional_parent_name == '<?php echo esc_attr($field['name']); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($field['name']); ?>"><?php echo esc_html($field['label']); ?></option>
28
+ <# } #>
29
+ <?php endif; ?>
30
+ <?php endforeach; ?>
31
+ </select>
32
+ </label>
33
+ <p class="description"><?php esc_html_e('Select conditional parent field.', 'woocommerce-checkout-manager'); ?></p>
34
+ <label class="setting" data-setting="label">
35
+ <span class="name"><?php esc_html_e('Coditional value', 'woocommerce-checkout-manager'); ?></span>
36
+ <input type="text" name="conditional_parent_value" placeholder="<?php esc_html_e('Yes'); ?>" value="{{data.conditional_parent_value}}">
37
+ </label>
38
+ <p class="description"><?php esc_html_e('Show field if parent has this value.', 'woocommerce-checkout-manager'); ?></p>
39
+ </div>
40
+
41
+ <div class="actions">
42
+ <a target="_blank" class="view-attachment" href="<?php echo wc_get_page_permalink('checkout'); ?>"><?php esc_html_e('View checkout page', 'woocommerce-checkout-manager'); ?></a> |
43
+ <a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e('Get premium version', 'woocommerce-checkout-manager'); ?></a> |
44
+ <a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php esc_html_e('View documentation', 'woocommerce-checkout-manager'); ?></a>
45
+ </div>
new/view/backend/pages/modals/parts/edit-info_1.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <span class="settings-save-status">
2
+ <span class="spinner"></span>
3
+ <span class="saved"><?php esc_html_e('Saved.'); ?></span>
4
+ </span>
5
+
6
+ <div class="details">
7
+ <div class="filename"><strong><?php esc_html_e('Field id', 'woocommerce-checkout-manager'); ?>:</strong> {{data.id}}</div>
8
+
9
+ <div class="filename"><strong><?php esc_html_e('Field name', 'woocommerce-checkout-manager'); ?>:</strong> {{data.name}}</div>
10
+
11
+ <!--
12
+ <div class="filename"><strong><?php esc_html_e('Field type', 'woocommerce-checkout-manager'); ?>:</strong> {{data.type}}</div>
13
+ -->
14
+ <div class="filename"><strong><?php esc_html_e('Field key', 'woocommerce-checkout-manager'); ?>:</strong> #{{data.key}}</div>
15
+ </div>
16
+
17
+ <div class="settings">
18
+
19
+ <label class="setting" data-setting="label">
20
+ <span class="name"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></span>
21
+ <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
22
+ <input type="text" name="type" value="{{data.type}}" disabled="disabled">
23
+ <# } else { #>
24
+ <select class="media-modal-change" name="type">
25
+ <?php if ($types): ?>
26
+ <?php foreach ($types as $type => $name) : ?>
27
+ <option <# if ( data.type == '<?php echo esc_attr($type); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($name); ?></option>
28
+ <?php endforeach; ?>
29
+ <?php endif; ?>
30
+ </select>
31
+ <# } #>
32
+ </label>
33
+ <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
34
+ <p class="description"><?php esc_html_e('You can\'t change the type of default fields.', 'woocommerce-checkout-manager'); ?></p>
35
+ <# } else { #>
36
+ <p class="description"><?php esc_html_e('Type of the checkout field', 'woocommerce-checkout-manager'); ?></p>
37
+ <# } #>
38
+
39
+ <label class="setting" data-setting="label">
40
+ <span class="name"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></span>
41
+ <input type="text" name="label" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-manager'); ?>" value="{{data.label}}">
42
+ </label>
43
+ <p class="description"><?php esc_html_e('Label text for the checkout field.', 'woocommerce-checkout-manager'); ?></p>
44
+
45
+ <label class="setting" data-setting="placeholder">
46
+ <span class="name"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></span>
47
+ <input type="text" name="placeholder" placeholder="<?php esc_html_e('Example red', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
48
+ </label>
49
+ <p class="description"><?php esc_html_e('Placeholder text for the checkout field.', 'woocommerce-checkout-manager'); ?></p>
50
+
51
+ <label class="setting" data-setting="extra_class">
52
+ <span class="name"><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></span>
53
+ <input class="short" type="text" name="extra_class" value="{{data.extra_class}}">
54
+ </label>
55
+ </div>
56
+
57
+ <div class="settings">
58
+ <label class="setting" data-setting="default">
59
+ <span class="name"><?php esc_html_e('Default', 'woocommerce-checkout-manager'); ?></span>
60
+ <input type="text" name="default" placeholder="<?php esc_html_e('Enter a default value (optional)', 'woocommerce-checkout-manager'); ?>" value="{{data.default}}">
61
+ </label>
62
+ </div>
63
+
64
+ <# if ( _.contains(<?php echo json_encode($multiple); ?>, data.type)) { #>
65
+ <div class="settings">
66
+ <label class="setting" data-setting="options">
67
+ <span class="name"><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></span>
68
+ <input type="text" name="options" placeholder="Option 1||Option 2||Option 3" value="{{data.options}}">
69
+ </label>
70
+ </div>
71
+ <# } #>
72
+
73
+ <div class="actions">
74
+ <a target="_blank" class="view-attachment" href="<?php echo wc_get_page_permalink('checkout'); ?>"><?php esc_html_e('View checkout page', 'woocommerce-checkout-manager'); ?></a> |
75
+ <a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e('Get premium version', 'woocommerce-checkout-manager'); ?></a> |
76
+ <a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php esc_html_e('View documentation', 'woocommerce-checkout-manager'); ?></a>
77
+ </div>
new/view/backend/pages/modals/parts/edit-tabs.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="product_data_tabs wc-tabs">
2
+ <li class="general_options active">
3
+ <a href="#tab_field_general"><span><?php esc_html_e('General', 'woocommerce-checkout-manager'); ?></span></a>
4
+ </li>
5
+ <!--<li class="conditional_options">
6
+ <a href="#tab_field_conditional"><span><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></span></a>
7
+ </li>
8
+ <li class="amount_options">
9
+ <a href="#tab_field_amount"><span><?php esc_html_e('Amount', 'woocommerce-checkout-manager'); ?></span></a>
10
+ </li>-->
11
+ <li class="display_options">
12
+ <a href="#tab_field_display"><span><?php esc_html_e('Display', 'woocommerce-checkout-manager'); ?></span></a>
13
+ </li>
14
+ <!--<# if (data.type == 'datepicker') { #>
15
+ <li class="datepicker_options">
16
+ <a href="#tab_field_datepicker"><span><?php esc_html_e('Datepicker', 'woocommerce-checkout-manager'); ?></span></a>
17
+ </li>
18
+ <# } #>
19
+ <# if (data.type == 'timepicker') { #>
20
+ <li class="timepicker_options">
21
+ <a href="#tab_field_timepicker"><span><?php esc_html_e('Timepicker', 'woocommerce-checkout-manager'); ?></span></a>
22
+ </li>
23
+ <# } #>
24
+ <li class="advanced_advanced">
25
+ <a href="#tab_field_advanced"><span><?php esc_html_e('Advanced', 'woocommerce-checkout-manager'); ?></span></a>
26
+ </li>
27
+ <li class="suggestions_options">
28
+ <a href="#tab_field_suggestions"><span><?php esc_html_e('Suggestions', 'woocommerce-checkout-manager'); ?></span></a>
29
+ </li>-->
30
+ </ul>
new/view/backend/pages/modals/parts/panel-advanced.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_advanced" class="panel woocommerce_options_panel hidden" style="display: none;">
2
+ <div class="options_group">
3
+ <p class="form-field">
4
+ <label><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></label>
5
+ <input <# if ( data.clear == 'true' ) { #>checked<# } #> type="checkbox" name="listable" value="listable">
6
+ <span class="description"><?php esc_html_e('Display in View Orders screen ', 'woocommerce-checkout-manager'); ?></span>
7
+ </p>
8
+ <p class="form-field">
9
+ <label><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></label>
10
+ <input <# if ( data.clear == 'true' ) { #>checked<# } #> type="checkbox" name="sortable" value="sortable">
11
+ <span class="description"><?php esc_html_e('Allow Sorting on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
12
+ </p>
13
+ <p class="form-field">
14
+ <label><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></label>
15
+ <input <# if ( data.clear == 'true' ) { #>checked<# } #> type="checkbox" name="filterable" value="filterable">
16
+ <span class="description"><?php esc_html_e('Allow Filtering on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
17
+ </p>
18
+ </div>
19
+ </div>
new/view/backend/pages/modals/parts/panel-amount.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_amount" class="panel woocommerce_options_panel hidden" style="display: none;">
2
+
3
+ <div class="options_group">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Add Amount', 'woocommerce-checkout-manager'); ?></label>
6
+ <input <# if ( data.add_amount == 'true' ) { #>checked<# } #> type="checkbox" name="add_amount" value="true">
7
+ </p>
8
+ <p class="form-field">
9
+ <label><?php esc_html_e('Amount Name', 'woocommerce-checkout-manager'); ?></label>
10
+ <input class="short" name="add_amount_name" type="text" value="{{data.add_amount_name}}" placeholder="<?php esc_html_e('My Custom Charge', 'woocommerce-checkout-manager'); ?>">
11
+ </p>
12
+ <p class="form-field">
13
+ <label><?php esc_html_e('Amount Total', 'woocommerce-checkout-manager'); ?></label>
14
+ <input class="short" name="add_amount_total" type="text" value="{{data.add_amount_total}}" placeholder="50">
15
+ <select style="margin:0 0 0 10px;line-height: 30px; height: 30px;" class="select" name="add_amount_type">
16
+ <option value="fixed" selected="selected">$</option>
17
+ <option value="percent">%</option>
18
+ </select>
19
+ </p>
20
+ </div>
21
+
22
+ <div class="options_group">
23
+ <p class="form-field">
24
+ <label><?php esc_html_e('Amount Tax', 'woocommerce-checkout-manager'); ?></label>
25
+ <input <# if ( data.add_amount_tax == 'true' ) { #>checked<# } #> type="checkbox" name="add_amount_tax" value="true">
26
+ </p>
27
+ <p class="form-field">
28
+ <label><?php esc_html_e('Deny Checkout', 'woocommerce-checkout-manager'); ?></label>
29
+ <input <# if ( data.deny_checkout == 'true' ) { #>checked<# } #> type="checkbox" name="deny_checkout" value="true">
30
+ </p>
31
+ <p class="form-field">
32
+ <label><?php esc_html_e('Deny Receipt', 'woocommerce-checkout-manager'); ?></label>
33
+ <input <# if ( data.deny_receipt == 'true' ) { #>checked<# } #> type="checkbox" name="deny_receipt" value="true">
34
+ </p>
35
+
36
+ </div>
37
+
38
+ </div>
new/view/backend/pages/modals/parts/panel-conditional.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_conditional" class="panel woocommerce_options_panel hidden" style="display: none;">
2
+ <div class="options_group">
3
+ <p class="form-field">
4
+ <label><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></label>
5
+ <input <# if ( data.conditional == 'true' ) { #>checked<# } #> type="checkbox" name="conditional" value="true">
6
+ </p>
7
+ <p class="form-field">
8
+ <label><?php esc_html_e('Parent', 'woocommerce-checkout-manager'); ?></label>
9
+ <select class="select short" name="conditional_parent_name">
10
+ <?php foreach ($fields as $key => $field) : ?>
11
+ <?php if (in_array($field['type'], $conditionals)): ?>
12
+ <# if ( data.id != '<?php echo esc_attr($field['id']); ?>' ) { #>
13
+ <option <# if ( data.conditional_parent_name == '<?php echo esc_attr($field['name']); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($field['name']); ?>"><?php echo esc_html($field['label']); ?></option>
14
+ <# } #>
15
+ <?php endif; ?>
16
+ <?php endforeach; ?>
17
+ </select>
18
+ </p>
19
+ <p class="form-field">
20
+ <label><?php esc_html_e('Value', 'woocommerce-checkout-manager'); ?></label>
21
+ <input class="short" type="text" name="conditional_parent_value" placeholder="<?php esc_html_e('Yes'); ?>" value="{{data.conditional_parent_value}}">
22
+ </p>
23
+ </div>
24
+ </div>
new/view/backend/pages/modals/parts/panel-datepicker.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_datepicker" class="panel woocommerce_options_panel hidden" style="display: none;">
2
+ <div class="options_group">
3
+ <p class="form-field">
4
+ <label><?php esc_html_e('Date format', 'woocommerce-checkout-manager'); ?></label>
5
+ <input class="short" type="text" placeholder="dd-mm-yy" name="format_date" value="{{data.format_date}}">
6
+ <span class="description"><a href="https://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.</span>
7
+ </p>
8
+ <p class="form-field">
9
+ <label><?php esc_html_e('Date limit', 'woocommerce-checkout-manager'); ?></label>
10
+ <select class="select short media-modal-change" name="date_limit">
11
+ <option <# if ( data.date_limit == 'variable' ) { #>selected="selected"<# } #> value="variable"><?php esc_html_e('Since current date', 'woocommerce-checkout-manager'); ?></option>
12
+ <option <# if ( data.date_limit == 'fixed' ) { #>selected="selected"<# } #> value="fixed"><?php esc_html_e('Between fixed dates', 'woocommerce-checkout-manager'); ?></option>
13
+ </select>
14
+ </p>
15
+ </div>
16
+ <# if ( data.date_limit == 'variable' ) { #>
17
+ <div class="options_group">
18
+ <p class="form-field">
19
+ <label><?php esc_html_e('Days before', 'woocommerce-checkout-manager'); ?></label>
20
+ <input class="short" type="number" placeholder="3" min="0" max="365" name="date_limit_variable_min" value="{{data.date_limit_variable_min}}">
21
+ </p>
22
+ <p class="form-field">
23
+ <label><?php esc_html_e('Days after', 'woocommerce-checkout-manager'); ?></label>
24
+ <input class="short" type="number" placeholder="3" min="0" max="365" name="date_limit_variable_max" value="{{data.date_limit_variable_max}}">
25
+ </p>
26
+ </div>
27
+ <# } #>
28
+ <# if ( data.date_limit == 'fixed' ) { #>
29
+ <div class="options_group wooccm-enhanced-between-dates">
30
+ <p class="form-field dimensions_field">
31
+ <label for="product_length"><?php esc_html_e('Between dates', 'woocommerce-checkout-manager'); ?></label>
32
+ <span class="wrap">
33
+ <input style="width:48.1%" type="text" class="short " name="date_limit_fixed_min" value="{{data.date_limit_fixed_min}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
34
+ <input style="width:48.1%;margin: 0;" type="text" class="short" name="date_limit_fixed_max" value="{{data.date_limit_fixed_max}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
35
+ </span>
36
+ <span class="woocommerce-help-tip"></span>
37
+ </p>
38
+ </div>
39
+ <# } #>
40
+ <div class="options_group">
41
+ <p class="form-field">
42
+ <label><?php esc_html_e('Days disable', 'woocommerce-checkout-manager'); ?></label>
43
+ <select class="wooccm-enhanced-select" name="date_limit_days" data-placeholder="<?php esc_attr_e('Disable week days', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
44
+ <?php for ($day_index = 0; $day_index <= 6; $day_index++) : ?>
45
+ <option <# if ( _.contains(data.date_limit_days, '<?php echo esc_attr($day_index); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($day_index); ?>"><?php echo $wp_locale->get_weekday($day_index); ?></option>
46
+ <?php endfor; ?>
47
+ </select>
48
+ </p>
49
+ </div>
50
+ </div>
new/view/backend/pages/modals/parts/panel-display.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_display" class="panel woocommerce_options_panel hidden" style="display: none;">
2
+ <div class="options_group">
3
+ <!--<p class="form-field">
4
+ <label><?php esc_html_e('User Role', 'woocommerce-checkout-manager'); ?></label>
5
+ <input <# if ( data.user_role == 'user_role' ) { #>checked<# } #> type="checkbox" name="user_role" value="user_role">
6
+ </p>-->
7
+ <p class="form-field">
8
+ <label><?php esc_html_e('Show for roles', 'woocommerce-checkout-manager'); ?></label>
9
+ <select class="wooccm-enhanced-select" name="show_role" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
10
+ <?php foreach ($wp_roles->roles as $key => $value): ?>
11
+ <option <# if ( _.contains(data.show_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
12
+ <?php endforeach; ?>
13
+ </select>
14
+ </p>
15
+ <p class="form-field">
16
+ <label><?php esc_html_e('Hide for roles', 'woocommerce-checkout-manager'); ?></label>
17
+ <select class="wooccm-enhanced-select" name="hide_role" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
18
+ <?php foreach ($wp_roles->roles as $key => $value): ?>
19
+ <option <# if ( _.contains(data.hide_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
20
+ <?php endforeach; ?>
21
+ </select>
22
+ </p>
23
+ </div>
24
+
25
+ <div class="options_group">
26
+ <p class="form-field">
27
+ <label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
28
+ <input <# if ( data.more_product == 'true' ) { #>checked<# } #> type="checkbox" name="more_product" value="true">
29
+ <span class="description"><?php esc_html_e('Apply conditions event it there is more than one product', 'woocommerce-checkout-manager'); ?></span>
30
+ </p>
31
+ </div>
32
+
33
+ <div class="options_group">
34
+ <p class="form-field">
35
+ <label><?php esc_html_e('Hide for products', 'woocommerce-checkout-manager'); ?></label>
36
+ <select class="wooccm-product-search" name="show_product" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product}}" data-allow_clear="true" multiple="multiple">
37
+ <# _.each(data.show_product_selected, function(title, id){ #>
38
+ <option value="{{id}}" selected="selected">{{title}}</option>
39
+ <# }); #>
40
+ </select>
41
+ </p>
42
+ <p class="form-field">
43
+ <label><?php esc_html_e('Show for products', 'woocommerce-checkout-manager'); ?></label>
44
+ <select class="wooccm-product-search" name="hide_product" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product}}" data-allow_clear="true" multiple="multiple">
45
+ <# _.each(data.hide_product_selected, function(title, id){ #>
46
+ <option value="{{id}}" selected="selected">{{title}}</option>
47
+ <# }); #>
48
+ </select>
49
+ </p>
50
+ </div>
51
+
52
+ <div class="options_group">
53
+ <p class="form-field">
54
+ <label><?php esc_html_e('Hide for category', 'woocommerce-checkout-manager'); ?></label>
55
+ <select class="wooccm-enhanced-select" name="show_product_cat" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product_cat}}" data-allow_clear="true" multiple="multiple">
56
+ <?php if ($product_categories) : ?>
57
+ <?php foreach ($product_categories as $category): ?>
58
+ <option <# if ( _.contains(data.show_product_cat, '<?php echo esc_attr($category->slug); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->slug); ?>"><?php echo esc_html($category->name); ?></option>
59
+ <?php endforeach; ?>
60
+ <?php endif; ?>
61
+ </select>
62
+ </p>
63
+ <p class="form-field">
64
+ <label><?php esc_html_e('Show for category', 'woocommerce-checkout-manager'); ?></label>
65
+ <select class="wooccm-enhanced-select" name="hide_product_cat" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product_cat}}" data-allow_clear="true" multiple="multiple">
66
+ <?php if ($product_categories) : ?>
67
+ <?php foreach ($product_categories as $category): ?>
68
+ <option <# if ( _.contains(data.hide_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
69
+ <?php endforeach; ?>
70
+ <?php endif; ?>
71
+ </select>
72
+ </p>
73
+ </div>
74
+ </div>
new/view/backend/pages/modals/parts/panel-general.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_general" class="panel woocommerce_options_panel" style="display: none;">
2
+ <div class="options_group">
3
+ <p class="form-field">
4
+ <label><?php esc_html_e('Name', 'woocommerce-checkout-manager'); ?></label>
5
+ <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
6
+ <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('You can\'t change the slug of default fields.', 'woocommerce-checkout-manager'); ?>"></span>
7
+ <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly">
8
+ <# } else { #>
9
+ <span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Currently is not possible to change the name of the fields.', 'woocommerce-checkout-manager'); ?><?php //esc_html_e('To edit Abbreviations open General > Switches > Editing Of Abbreviation Fields.', 'woocommerce-checkout-manager'); ?>"></span>
10
+ <input class="short" type="text" name="name" placeholder="<?php esc_html_e('myfield', 'woocommerce-checkout-manager'); ?>" value="{{data.name}}" readonly="readonly" <?php /* if (empty($options['checkness']['abbreviation'])) { ?>readonly="readonly"<?php } */ ?>>
11
+ <# } #>
12
+ </p>
13
+ </div>
14
+
15
+ <div class="options_group">
16
+ <p class="form-field">
17
+ <label><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></label>
18
+ <# if ( _.contains(<?php echo json_encode($defaults); ?>, data.name)) { #>
19
+ <input class="short" type="text" name="type" value="{{data.type}}" disabled="disabled">
20
+ <# } else { #>
21
+ <select class="media-modal-change wooccm-enhanced-select" name="type">
22
+ <?php if ($types): ?>
23
+ <?php foreach ($types as $type => $name) : ?>
24
+ <option <# if ( data.type == '<?php echo esc_attr($type); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($type); ?>"><?php echo esc_html($name); ?></option>
25
+ <?php endforeach; ?>
26
+ <?php endif; ?>
27
+ </select>
28
+ <# } #>
29
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Type of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
30
+ </p>
31
+ <# if (data.type == 'colorpicker') { #>
32
+ <p class="form-field">
33
+ <label><?php esc_html_e('Picker Type', 'woocommerce-checkout-manager'); ?></label>
34
+ <select class="select short" name="pickertype">
35
+ <option <# if ( data.pickertype == 'farbtastic' ) { #>selected="selected"<# } #> value="farbtastic"><?php esc_html_e('Farbtastic', 'woocommerce-checkout-manager'); ?></option>
36
+ <option <# if ( data.pickertype == 'iris' ) { #>selected="selected"<# } #> value="iris"><?php esc_html_e('Iris', 'woocommerce-checkout-manager'); ?></option>
37
+ </select>
38
+ </p>
39
+ <# } #>
40
+ </div>
41
+ <div class="options_group">
42
+ <p class="form-field">
43
+ <label><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></label>
44
+ <input class="short" type="text" name="label" placeholder="<?php esc_html_e('My Field Name', 'woocommerce-checkout-manager'); ?>" value="{{data.label}}">
45
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Label text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
46
+ </p>
47
+ <p class="form-field">
48
+ <label><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></label>
49
+ <input class="short" type="text" name="placeholder" placeholder="<?php esc_html_e('Example red', 'woocommerce-checkout-manager'); ?>" value="{{data.placeholder}}">
50
+ <span span class="woocommerce-help-tip" data-tip="<?php esc_html_e('Placeholder text of the checkout field.', 'woocommerce-checkout-manager'); ?>"></span>
51
+ </p>
52
+ </div>
53
+ <div class="options_group">
54
+ <p class="form-field">
55
+ <label><?php esc_html_e('Default', 'woocommerce-checkout-manager'); ?></label>
56
+ <input class="short" type="text" name="default" placeholder="<?php esc_html_e('Enter a default value (optional)', 'woocommerce-checkout-manager'); ?>" value="{{data.default}}">
57
+ </p>
58
+ <# if ( _.contains(<?php echo json_encode($multiple); ?>, data.type)) { #>
59
+ <p class="form-field">
60
+ <label><?php esc_html_e('Options', 'woocommerce-checkout-manager'); ?></label>
61
+ <input class="short" type="text" name="options" placeholder="Option 1||Option 2||Option 3" value="{{data.options}}">
62
+ </p>
63
+ <# } #>
64
+ </div>
65
+ <div class="options_group">
66
+ <p class="form-field">
67
+ <label><?php esc_html_e('Extra class', 'woocommerce-checkout-manager'); ?></label>
68
+ <input class="short" type="text" name="extra_class" value="{{data.extra_class}}">
69
+ </p>
70
+ </div>
71
+ </div>
new/view/backend/pages/modals/parts/panel-suggestions.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_suggestions" class="panel woocommerce_options_panel hidden" style="display: none;">
2
+ <div class="marketplace-suggestions-container showing-suggestion" data-marketplace-suggestions-context="product-edit-meta-tab-header">
3
+ <div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-meta-tab-header">
4
+ <div class="marketplace-suggestion-container-content">
5
+ <h4>Recommended extensions</h4></div>
6
+ <div class="marketplace-suggestion-container-cta"></div>
7
+ </div>
8
+ </div>
9
+ <div class="marketplace-suggestions-container showing-suggestion" data-marketplace-suggestions-context="product-edit-meta-tab-body">
10
+ <div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-name-your-price"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/name-your-price.svg" class="marketplace-suggestion-icon">
11
+ <div class="marketplace-suggestion-container-content">
12
+ <h4>Name Your Price</h4>
13
+ <p>Let customers pay what they want - useful for donations, tips and more</p>
14
+ </div>
15
+ <div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/name-your-price/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&amp;wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&amp;wccom-woo-version=3.7.0&amp;utm_source=editproduct&amp;utm_campaign=marketplacesuggestions&amp;utm_medium=product" target="blank" class="button">Learn More</a>
16
+ <a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
17
+ </div>
18
+ </div>
19
+ <div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-variation-images"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/additional-variation-images.svg" class="marketplace-suggestion-icon">
20
+ <div class="marketplace-suggestion-container-content">
21
+ <h4>Additional Variation Images</h4>
22
+ <p>Showcase your products in the best light with a image for each variation</p>
23
+ </div>
24
+ <div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/woocommerce-additional-variation-images/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&amp;wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&amp;wccom-woo-version=3.7.0&amp;utm_source=editproduct&amp;utm_campaign=marketplacesuggestions&amp;utm_medium=product" target="blank" class="button">Learn More</a>
25
+ <a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
26
+ </div>
27
+ </div>
28
+ <div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-woocommerce-one-page-checkout"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/one-page-checkout.svg" class="marketplace-suggestion-icon">
29
+ <div class="marketplace-suggestion-container-content">
30
+ <h4>One Page Checkout</h4>
31
+ <p>Don't make customers click around - let them choose products, checkout &amp; pay all on one page</p>
32
+ </div>
33
+ <div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/woocommerce-one-page-checkout/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&amp;wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&amp;wccom-woo-version=3.7.0&amp;utm_source=editproduct&amp;utm_campaign=marketplacesuggestions&amp;utm_medium=product" target="blank" class="button">Learn More</a>
34
+ <a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
35
+ </div>
36
+ </div>
37
+ <div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-min-max-quantities"><img src="https://woocommerce.com/wp-content/plugins/wccom-plugins//marketplace-suggestions/icons/min-max-quantities.svg" class="marketplace-suggestion-icon">
38
+ <div class="marketplace-suggestion-container-content">
39
+ <h4>Min/Max Quantities</h4>
40
+ <p>Specify minimum and maximum allowed product quantities for orders to be completed</p>
41
+ </div>
42
+ <div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/products/min-max-quantities/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&amp;wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&amp;wccom-woo-version=3.7.0&amp;utm_source=editproduct&amp;utm_campaign=marketplacesuggestions&amp;utm_medium=product" target="blank" class="button">Learn More</a>
43
+ <a class="suggestion-dismiss" title="Dismiss this suggestion" href="#"></a>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ <div class="marketplace-suggestions-container showing-suggestion" data-marketplace-suggestions-context="product-edit-meta-tab-footer">
48
+ <div class="marketplace-suggestion-container" data-suggestion-slug="product-edit-meta-tab-footer-browse-all">
49
+ <div class="marketplace-suggestion-container-content has-manage-link"><a class="marketplace-suggestion-manage-link linkout" href="http://localhost/woocommerce-checkout/wp-admin/admin.php?page=wc-settings&amp;tab=advanced&amp;section=woocommerce_com">Manage suggestions</a></div>
50
+ <div class="marketplace-suggestion-container-cta"><a href="https://woocommerce.com/product-category/woocommerce-extensions/?wccom-site=http%3A%2F%2Flocalhost%2Fwoocommerce-checkout&amp;wccom-back=%2Fwoocommerce-checkout%2Fwp-admin%2Fpost.php%3Fpost%3D6%26%23038%3Baction%3Dedit&amp;wccom-woo-version=3.7.0&amp;utm_source=editproduct&amp;utm_campaign=marketplacesuggestions&amp;utm_medium=product" target="blank" class="linkout">Browse all extensions<span class="dashicons dashicons-external"></span></a></div>
51
+ </div>
52
+ </div>
53
+ <div class="marketplace-suggestions-metabox-nosuggestions-placeholder hidden">
54
+ <img src="https://woocommerce.com/wp-content/plugins/wccom-plugins/marketplace-suggestions/icons/get_more_options.svg" class="marketplace-suggestion-icon">
55
+ <div class="marketplace-suggestion-placeholder-content">
56
+ <h4>Enhance your products</h4>
57
+ <p>Extensions can add new functionality to your product pages that make your store stand out</p>
58
+ </div>
59
+ <a href="https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=editproduct&amp;utm_campaign=marketplacesuggestions&amp;utm_medium=product" target="blank" class="button">Browse the Marketplace</a>
60
+ <br>
61
+ <a class="marketplace-suggestion-manage-link" href="http://localhost/woocommerce-checkout/wp-admin/admin.php?page=wc-settings&amp;tab=advanced&amp;section=woocommerce_com">Manage suggestions</a>
62
+ </div>
63
+ </div>
new/view/backend/pages/modals/parts/panel-timepicker.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_field_timepicker" class="panel woocommerce_options_panel hidden" style="display: none;">
2
+ <div class="options_group">
3
+ <p class="form-field">
4
+ <label><?php esc_html_e('Hour start', 'woocommerce-checkout-manager'); ?></label>
5
+ <input class="short" type="number" min="0" max="24" placeholder="6" name="time_limit_start" value="{{data.time_limit_start}}">
6
+ </p>
7
+ <p class="form-field">
8
+ <label><?php esc_html_e('Hour end', 'woocommerce-checkout-manager'); ?></label>
9
+ <input class="short" type="number" min="0" max="24" placeholder="9" name="time_limit_end" value="{{data.time_limit_end}}">
10
+ </p>
11
+ <p class="form-field">
12
+ <label><?php esc_html_e('Minutes interval', 'woocommerce-checkout-manager'); ?></label>
13
+ <input class="short" type="number" min="0" max="60" <!--step="5"--> placeholder="15" name="time_limit_interval" value="{{data.time_limit_interval}}">
14
+ </p>
15
+ <!--<p class="form-field">
16
+ <label><?php esc_html_e('Manual minutes', 'woocommerce-checkout-manager'); ?></label>
17
+ <input class="short" type="text" placeholder="0, 10, 20, 30, 40" name="manual_min" value="{{data.manual_min}}">
18
+ </p>-->
19
+ </div>
20
+ </div>
new/view/backend/pages/orders.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * To change this license header, choose License Headers in Project Properties.
5
+ * To change this template file, choose Tools | Templates
6
+ * and open the template in the editor.
7
+ */
8
+
new/view/backend/pages/parts/actions.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <div id="<?php printf('wooccm_%s_settings-actions', $current_section); ?>">
2
+ <p>
3
+ <a href="javascript:;" id="<?php printf('wooccm_%s_settings_add', $current_section); ?>" class="button button-primary"><?php esc_html_e('+ Add New Field', 'woocommerce-checkout-manager') ?></a>
4
+ <!--<a href="javascript:;" id="<?php printf('wooccm_%s_settings_import', $current_section); ?>" class="button button-secondary"><?php esc_html_e('Import', 'woocommerce-checkout-manager') ?></a>
5
+ <a href="javascript:;" id="<?php printf('wooccm_%s_settings_reset', $current_section); ?>" class="button button-secondary"><?php esc_html_e('Reset', 'woocommerce-checkout-manager') ?></a>-->
6
+ </p>
7
+ </div>
new/view/backend/pages/parts/header.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $sections = array();
4
+
5
+ //$sections[''] = esc_html__('General', 'woocommerce-checkout-manager');
6
+ //$sections['orders'] = esc_html__('Orders', 'woocommerce-checkout-manager');
7
+ $sections['billing'] = esc_html__('Billing', 'woocommerce-checkout-manager');
8
+ $sections['shipping'] = esc_html__('Shipping', 'woocommerce-checkout-manager');
9
+ $sections['additional'] = esc_html__('Additional', 'woocommerce-checkout-manager');
10
+ //$sections['advanced'] = esc_html__('Advanced', 'woocommerce-checkout-manager');
11
+
12
+ echo '<ul class="subsubsub">';
13
+
14
+ $array_keys = array_keys($sections);
15
+
16
+ foreach ($sections as $id => $label) {
17
+ echo '<li><a href="' . admin_url('admin.php?page=wc-settings&tab=wooccm&section=' . sanitize_title($id)) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> | </li>';
18
+ }
19
+
20
+ echo '<li><a target="_blank" href="' . WOOCCM_SUPPORT_URL . '">' . esc_html__('Report a bug', 'woocommerce-checkout-manager') . '</a> ' . ( end($array_keys) == $id ? '' : '|' ) . ' </li>';
21
+
22
+ echo '</ul><br class="clear" />';
23
+
new/view/backend/pages/parts/loop.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table class="form-table">
2
+ <tbody>
3
+ <tr valign="top">
4
+ <td class="<?php printf('wooccm_%s_wrapper', $current_section); ?> wc_payment_gateways_wrapper" colspan="2">
5
+ <table id="<?php printf('wooccm_%s_fields', $current_section); ?>" class="wc_gateways widefat" cellspacing="0" aria-describedby="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
6
+ <thead>
7
+ <tr>
8
+ <th class="sort" style="width:1%"></th>
9
+ <!--<th class="order"><?php esc_html_e('Order', 'woocommerce-checkout-manager'); ?></th>-->
10
+ <th class="required" style="width:1%"><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></th>
11
+ <th class="position" style="width:1%;min-width: 100px;"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></th>
12
+ <th class="clear" style="width:1%"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></th>
13
+ <th class="type" style="width:1%"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
14
+ <th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
15
+ <th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
16
+ <!--<th class="listable"><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></th>
17
+ <th class="sortable"><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></th>
18
+ <th class="filterable"><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></th>-->
19
+ <th class="status" style="width:1%"><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></th>
20
+ <th class="edit" style="width:1%"><?php //esc_html_e('Edit', 'woocommerce-checkout-manager'); ?></th>
21
+ <th class="delete" style="width:1%"><?php //esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></th>
22
+ </tr>
23
+ </thead>
24
+ <tbody class="ui-sortable">
25
+ <?php if (count($fields)): ?>
26
+ <?php foreach ($fields as $id => $field) : ?>
27
+ <tr data-field_id="<?php echo esc_attr($id); ?>">
28
+ <td class="sort ui-sortable-handle">
29
+ <div class="wc-item-reorder-nav">
30
+ <button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move up', 'woocommerce-checkout-manager'); ?></button>
31
+ <button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move down', 'woocommerce-checkout-manager'); ?></button>
32
+ <input type="hidden" name="field_order[]" value="<?php echo esc_attr($id); ?>">
33
+ </div>
34
+ </td>
35
+ <!--<td class="order"><strong><?php echo esc_html($field['order']); ?></strong></td>-->
36
+ <td class="required">
37
+ <a data-field_attr="required" class="wooccm-field-toggle-attribute" href="#">
38
+ <?php
39
+ if (!empty($field['required'])) {
40
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('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(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
43
+ }
44
+ ?>
45
+ </a>
46
+ </td>
47
+ <td class="position">
48
+ <select data-field_attr="position" class="wooccm-field-change-attribute" style="width: auto; border-radius: 3px; height: 28px; line-height: 28px;" name="position">
49
+ <option <?php selected($field['position'], 'form-row-wide'); ?> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-manager'); ?></option>
50
+ <option <?php selected($field['position'], 'form-row-first'); ?> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-manager'); ?></option>
51
+ <option <?php selected($field['position'], 'form-row-last'); ?> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-manager'); ?></option>
52
+ </select>
53
+ </td>
54
+ <td class="clear">
55
+ <a data-field_attr="clear" class="wooccm-field-toggle-attribute" href="#">
56
+ <?php
57
+ if (!empty($field['clear'])) {
58
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
59
+ } else {
60
+
61
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
62
+ }
63
+ ?>
64
+ </a>
65
+ </td>
66
+ <td class="type">
67
+ <?php echo esc_html($field['type']); ?>
68
+ </td>
69
+ <td class="label">
70
+ <strong><?php echo esc_html($field['label']); ?></strong>
71
+ </td>
72
+ <td class="placeholder">
73
+ <?php echo esc_html($field['placeholder']); ?>
74
+ </td>
75
+ <!--<td class="listable">
76
+ <?php
77
+ if (!empty($field['listable'])) {
78
+ ?>
79
+ <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
80
+ <?php } else { ?>
81
+ <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
82
+ <?php } ?>
83
+ </td>
84
+ <td class="sortable">
85
+ <?php
86
+ if (!empty($field['sortable'])) {
87
+ ?>
88
+ <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
89
+ <?php } else { ?>
90
+ <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
91
+ <?php } ?>
92
+ </td>
93
+ <td class="filterable">
94
+ <?php
95
+ if (!empty($field['filterable'])) {
96
+ ?>
97
+ <span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
98
+ <?php } else { ?>
99
+ <span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
100
+ <?php } ?>
101
+ </td>-->
102
+ <td class="status">
103
+ <a data-field_attr="disabled" class="wooccm-field-toggle-attribute" href="#">
104
+ <?php
105
+ if (!empty($field['disabled'])) {
106
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
107
+ } else {
108
+
109
+ echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
110
+ }
111
+ ?>
112
+ </a>
113
+ </td>
114
+ <td class="edit">
115
+ <a class="<?php printf('wooccm_%s_settings_edit', $current_section); ?> button" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
116
+ </td>
117
+ <td class="delete">
118
+ <?php if (is_array($defaults) && !in_array($field['name'], $defaults)): ?>
119
+ <a class="<?php printf('wooccm_%s_settings_delete', $current_section); ?>" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
120
+ <?php endif; ?>
121
+ </td>
122
+ </tr>
123
+ <?php endforeach; ?>
124
+ <?php endif; ?>
125
+ </tbody>
126
+ </table>
127
+ </td>
128
+ </tr>
129
+ </tbody>
130
+ </table>
new/view/backend/pages/shipping.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php include_once('parts/header.php'); ?>
2
+ <h1 class="screen-reader-text"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></h1>
3
+ <h2><?php esc_html_e('Shipping fields', 'woocommerce-checkout-manager'); ?></h2>
4
+ <div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
5
+ <p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
6
+ </div>
7
+ <?php include_once('parts/actions.php'); ?>
8
+ <?php include_once('parts/loop.php'); ?>
9
+ <script type="text/html" id='tmpl-wooccm-modal-window'>
10
+ <?php include_once('modals/edit.php'); ?>
11
+ </script>
new/view/frontend/checkout.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Checkout')) {
4
+
5
+ class WOOCCM_Checkout {
6
+
7
+ protected static $instance;
8
+
9
+ function enqueue_scripts() {
10
+
11
+ if (is_checkout()) {
12
+
13
+ WOOCCM()->register_scripts();
14
+
15
+ $i18n = substr(get_user_locale(), 0, 2);
16
+
17
+ wp_enqueue_style('wooccm');
18
+
19
+ wp_enqueue_script('wooccm-checkout', plugins_url('assets/js/wooccm-checkout.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
20
+
21
+ wp_localize_script('wooccm-checkout', 'wooccm_upload', array(
22
+ 'ajaxurl' => admin_url('admin-ajax.php'),
23
+ 'nonce' => wp_create_nonce('wooccm_upload'),
24
+ 'limit' => array(
25
+ 'max_file_size' => wp_max_upload_size(),
26
+ 'max_files' => 4,
27
+ //'mime_types' => $this->get_mime_types(),
28
+ ),
29
+ 'icons' => array(
30
+ 'interactive' => site_url('wp-includes/images/media/interactive.png'),
31
+ 'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
32
+ 'archive' => site_url('wp-includes/images/media/archive.png'),
33
+ 'audio' => site_url('wp-includes/images/media/audio.png'),
34
+ 'text' => site_url('wp-includes/images/media/text.png'),
35
+ 'video' => site_url('wp-includes/images/media/video.png')
36
+ ),
37
+ 'message' => array(
38
+ 'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
39
+ 'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
40
+ 'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
41
+ 'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
42
+ )
43
+ ));
44
+
45
+ // UI
46
+ // ---------------------------------------------------------------------
47
+ wp_enqueue_style('jquery-ui-style', WC()->plugin_url() . '/assets/css/jquery-ui/jquery-ui.min.css', array(), WC_VERSION);
48
+
49
+ // Datepicker
50
+ // ---------------------------------------------------------------------
51
+ wp_enqueue_script('jquery-ui-datepicker');
52
+
53
+ // Timepicker
54
+ // ---------------------------------------------------------------------
55
+ wp_enqueue_style('jquery-ui-timepicker', plugins_url('assets/timepicker/jquery.ui.timepicker.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION);
56
+ wp_enqueue_script('jquery-ui-timepicker', plugins_url('assets/timepicker/jquery.ui.timepicker.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION);
57
+
58
+ if (is_file(WOOCCM_PLUGIN_DIR . 'assets/timepicker/i18n/jquery.ui.timepicker-' . $i18n . '.js')) {
59
+ wp_enqueue_script('jquery-ui-timepicker-' . $i18n, plugins_url('assets/timepicker/i18n/jquery.ui.timepicker-' . $i18n . '.js', WOOCCM_PLUGIN_FILE), array('jquery-ui-timepicker'), WOOCCM_PLUGIN_VERSION);
60
+ }
61
+
62
+ // Colorpicker
63
+ // ---------------------------------------------------------------------
64
+ wp_enqueue_style('wp-color-picker');
65
+
66
+ wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false);
67
+ wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), false);
68
+
69
+ wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
70
+ 'clear' => __('Clear'),
71
+ 'defaultString' => __('Default'),
72
+ 'pick' => __('Select Color'),
73
+ 'current' => __('Current Color'),
74
+ ));
75
+
76
+ // Farbtastic
77
+ // ---------------------------------------------------------------------
78
+ wp_enqueue_style('farbtastic');
79
+ wp_enqueue_script('farbtastic', admin_url('js/farbtastic.js'), array('jquery'), false);
80
+
81
+ // Dashicons
82
+ // ---------------------------------------------------------------------
83
+ wp_enqueue_style('dashicons');
84
+
85
+ wp_enqueue_script('wooccm-checkout');
86
+ }
87
+ }
88
+
89
+ function init() {
90
+ add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
91
+ }
92
+
93
+ public static function instance() {
94
+ if (!isset(self::$instance)) {
95
+ self::$instance = new self();
96
+ self::$instance->init();
97
+ }
98
+ return self::$instance;
99
+ }
100
+
101
+ }
102
+
103
+ WOOCCM_Checkout::instance();
104
+ }
105
+
new/{fields_additional.php → view/frontend/fields/additional.php} RENAMED
@@ -62,7 +62,7 @@ if (!class_exists('WOOCCM_Fields_Additional')) {
62
  if ($buttons = $options['buttons']) {
63
 
64
  foreach ($buttons as $key => $custom_field) {
65
- woocommerce_form_field($custom_field['cow'], $this->add_checkout_field_filter($key, $custom_field, $custom_field), $checkout->get_value($custom_field['cow']));
66
  }
67
  }
68
  }
62
  if ($buttons = $options['buttons']) {
63
 
64
  foreach ($buttons as $key => $custom_field) {
65
+ woocommerce_form_field($custom_field['cow'], $this->add_checkout_field_filter($key, $custom_field, $custom_field, 'additional_'), $checkout->get_value($custom_field['cow']));
66
  }
67
  }
68
  }
new/{fields_conditional.php → view/frontend/fields/conditional.php} RENAMED
File without changes
new/{fields_display.php → view/frontend/fields/display.php} RENAMED
File without changes
new/{fields_filters.php → view/frontend/fields/filters.php} RENAMED
File without changes
new/{fields_handler.php → view/frontend/fields/handler.php} RENAMED
File without changes
new/{fields_register.php → view/frontend/fields/register.php} RENAMED
@@ -6,12 +6,16 @@ if (!class_exists('WOOCCM_Fields_Register')) {
6
 
7
  protected static $instance;
8
 
9
- function add_checkout_field_filter($key, $fields, $custom_field) {
10
 
11
 
12
  $fields[$key] = wp_parse_args($custom_field, (array) @$fields[$key]);
13
 
14
- //$fields[$key]['key'] = $key;
 
 
 
 
15
  // Class
16
  // -----------------------------------------------------------------------
17
  if (!is_array(@$fields[$key]['class'])) {
@@ -155,7 +159,7 @@ if (!class_exists('WOOCCM_Fields_Register')) {
155
  //if (!empty($custom_field['disabled'])) {
156
  //unset($fields[$key]);
157
  //} else {
158
- $fields[$key] = $this->add_checkout_field_filter($key, $fields, $custom_field);
159
  //}
160
  }
161
  }
6
 
7
  protected static $instance;
8
 
9
+ function add_checkout_field_filter($key, $fields, $custom_field, $prefix = '') {
10
 
11
 
12
  $fields[$key] = wp_parse_args($custom_field, (array) @$fields[$key]);
13
 
14
+ // Conditonal
15
+ // -----------------------------------------------------------------------
16
+
17
+ $fields[$key]['conditional_tie'] = sprintf("%s%s_field", $prefix, @$fields[$key]['conditional_tie']);
18
+
19
  // Class
20
  // -----------------------------------------------------------------------
21
  if (!is_array(@$fields[$key]['class'])) {
159
  //if (!empty($custom_field['disabled'])) {
160
  //unset($fields[$key]);
161
  //} else {
162
+ $fields[$key] = $this->add_checkout_field_filter($key, $fields, $custom_field, $prefix);
163
  //}
164
  }
165
  }
new/view/frontend/order.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!class_exists('WOOCCM_Order')) {
4
+
5
+ class WOOCCM_Order {
6
+
7
+ protected static $instance;
8
+
9
+ function enqueue_scripts() {
10
+
11
+ if (is_account_page()) {
12
+
13
+ WOOCCM()->register_scripts();
14
+
15
+ wp_enqueue_style('wooccm');
16
+ wp_enqueue_style('dashicons');
17
+ wp_enqueue_script('wooccm-order-upload');
18
+ //wp_enqueue_style('wooccm-button-style', plugins_url('assets/old/edit-order-uploads-button_style.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION, 'all');
19
+ }
20
+ }
21
+
22
+ function add_order_uploads($order_id) {
23
+
24
+ if ($order = wc_get_order($order_id)) {
25
+
26
+ $options = get_option('wccs_settings');
27
+
28
+ if (empty($options['checkness']['upload_os']) || ( $order->get_status() == "wc-{$options['checkness']['upload_os']}" )) {
29
+
30
+
31
+ $attachments = get_posts(array(
32
+ 'fields' => 'ids',
33
+ 'post_type' => 'attachment',
34
+ 'numberposts' => -1,
35
+ 'post_status' => null,
36
+ 'post_parent' => $order->get_id())
37
+ );
38
+
39
+ wc_get_template('templates/order/order-uploads.php', array('order' => $order, 'attachments' => $attachments), '', WOOCCM_PLUGIN_DIR);
40
+ }
41
+ }
42
+ }
43
+
44
+ function init() {
45
+
46
+ add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
47
+
48
+ if ($options = get_option('wccs_settings')) {
49
+ if (!empty($options['checkness']['enable_file_upload'])) {
50
+ add_action('woocommerce_view_order', array($this, 'add_order_uploads'));
51
+ }
52
+ }
53
+ }
54
+
55
+ public static function instance() {
56
+ if (!isset(self::$instance)) {
57
+ self::$instance = new self();
58
+ self::$instance->init();
59
+ }
60
+ return self::$instance;
61
+ }
62
+
63
+ }
64
+
65
+ WOOCCM_Order::instance();
66
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.0
6
  Tested up to: 5.2.3
7
- Stable tag: 4.4.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -137,6 +137,12 @@ Example:
137
 
138
  == Changelog ==
139
 
 
 
 
 
 
 
140
  = 4.4.9 =
141
  * Improvement: unnecessary files removed
142
  * Improvement: woocommerce checkout address fields required
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.0
6
  Tested up to: 5.2.3
7
+ Stable tag: 4.5.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
137
 
138
  == Changelog ==
139
 
140
+ = 4.5.0 =
141
+ * Improvement: new woocommerce checkout billing fields admin panel
142
+ * Improvement: new woocommerce checkout shipping fields admin panel
143
+ * Improvement: new woocommerce checkout additional fields admin panel
144
+ * Fix: woocommerce checkout conditional fields
145
+
146
  = 4.4.9 =
147
  * Improvement: unnecessary files removed
148
  * Improvement: woocommerce checkout address fields required
templates/order/order-uploads.php CHANGED
@@ -41,7 +41,7 @@
41
  <?php endforeach; ?>
42
  <?php else: ?>
43
  <tr>
44
- <td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this Order.', 'woocommerce-checkout-manager'); ?></td>
45
  </tr>
46
  <?php endif; ?>
47
  </tbody>
41
  <?php endforeach; ?>
42
  <?php else: ?>
43
  <tr>
44
+ <td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
45
  </tr>
46
  <?php endif; ?>
47
  </tbody>
woocommerce-checkout-manager.php CHANGED
@@ -1,8 +1,9 @@
1
  <?php
 
2
  /**
3
  * Plugin Name: WooCommerce Checkout Manager
4
  * Description: Manages WooCommerce Checkout, the advanced way.
5
- * Version: 4.4.9
6
  * Author: QuadLayers
7
  * Author URI: https://www.quadlayers.com
8
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
@@ -16,7 +17,7 @@ if (!defined('WOOCCM_PLUGIN_NAME')) {
16
  define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
17
  }
18
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
19
- define('WOOCCM_PLUGIN_VERSION', '4.4.9');
20
  }
21
  if (!defined('WOOCCM_PLUGIN_FILE')) {
22
  define('WOOCCM_PLUGIN_FILE', __FILE__);
@@ -49,391 +50,17 @@ if (!defined('WOOCCM_GROUP_URL')) {
49
  define('WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
50
  }
51
 
52
- if (!class_exists('WOOCCM')) {
53
-
54
- class WOOCCM {
55
-
56
- protected static $instance;
57
-
58
- function ajax_dismiss_notice() {
59
- if (current_user_can('manage_options')) {
60
-
61
- if (!empty($_REQUEST) && check_admin_referer('wooccm_dismiss_notice', 'nonce')) {
62
-
63
- if ($notice_id = ( isset($_REQUEST['notice_id']) ) ? sanitize_key($_REQUEST['notice_id']) : '') {
64
-
65
- update_user_meta(get_current_user_id(), $notice_id, true);
66
-
67
- wp_send_json($notice_id);
68
- }
69
- }
70
- }
71
- wp_die();
72
- }
73
-
74
- function add_notices() {
75
- if (!get_transient('wooccm-first-rating') && !get_user_meta(get_current_user_id(), 'wooccm-user-rating', true)) {
76
- ?>
77
- <div id="wooccm-admin-rating" class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-user-rating">
78
- <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
79
- <div class="notice-image">
80
- <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
81
- </div>
82
- <div class="notice-content" style="margin-left: 15px;">
83
- <p>
84
- <?php printf(esc_html__('Hello! We\'ve recently acquired this plugin!', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
85
- <br/>
86
- <?php esc_html_e('We will do our best to improve it and include new features gradually. Please be patient and let us know about the issues and improvements that you want to see in this plugin.', 'woocommerce-checkout-manager'); ?>
87
- </p>
88
- <a href="<?php echo esc_url(WOOCCM_GROUP_URL); ?>" class="button-primary" target="_blank">
89
- <?php esc_html_e('Join Community!', 'woocommerce-checkout-manager'); ?>
90
- </a>
91
- <a href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
92
- <?php esc_html_e('Report a bug', 'woocommerce-checkout-manager'); ?>
93
- </a>
94
- <a style="margin-left: 10px;" href="https://quadlayers.com/?utm_source=wooccm_admin" target="_blank">
95
- <?php esc_html_e('About us', 'woocommerce-checkout-manager'); ?>
96
- </a>
97
- </div>
98
- </div>
99
- </div>
100
- <?php }
101
- ?>
102
- <?php /* if (!get_user_meta(get_current_user_id(), 'wooccm-user-beta', true)) {
103
- ?>
104
- <div id="wooccm-admin-rating" class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-user-beta">
105
- <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
106
- <div class="notice-image">
107
- <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
108
- </div>
109
- <div class="notice-content" style="margin-left: 15px;">
110
- <p>
111
- <?php printf(esc_html__('Hello! We\'ve launched a new beta version!', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
112
- <br/>
113
- <?php esc_html_e(' We urgently need developers, integrators and interested store owners to test this plugin release and provide feedback to help stabilise the 4.4+ version. We\'ve rebuilt the entire file picker field and the upload fields option inside user orders and admin backend. Can you help?', 'woocommerce-checkout-manager'); ?>
114
- </p>
115
- <a href="https://drive.google.com/uc?id=1THj7zm-2NOTURandd1IuiibZvP4XL-vw&export=download" class="button-primary" target="_blank">
116
- <?php esc_html_e('Download Now!', 'woocommerce-checkout-manager'); ?>
117
- </a>
118
- <a href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
119
- <?php esc_html_e('Report a bug', 'woocommerce-checkout-manager'); ?>
120
- </a>
121
- <a style="margin-left: 10px;" href="https://quadlayers.com/documentation/woocommerce-checkout-manager/changelog/" target="_blank">
122
- <?php esc_html_e('Changelog', 'woocommerce-checkout-manager'); ?>
123
- </a>
124
- </div>
125
- </div>
126
- </div>
127
- <?php } */ ?>
128
- <script>
129
- (function ($) {
130
- $('.wooccm-notice').on('click', '.notice-dismiss', function (e) {
131
- e.preventDefault();
132
- var notice_id = $(e.delegateTarget).data('notice_id');
133
- $.ajax({
134
- type: 'POST',
135
- url: ajaxurl,
136
- data: {
137
- notice_id: notice_id,
138
- action: 'wooccm_dismiss_notice',
139
- nonce: '<?php echo wp_create_nonce('wooccm_dismiss_notice'); ?>'
140
- },
141
- success: function (response) {
142
- console.log(response);
143
- },
144
- });
145
- });
146
- })(jQuery);
147
- </script>
148
- <?php
149
- }
150
-
151
- protected function get_mime_types() {
152
-
153
- $extensions = $types = array();
154
-
155
- $allowed_types = get_allowed_mime_types();
156
-
157
- // break the allowed extensions into their respective types
158
- foreach ($allowed_types as $allowed_extensions => $type) {
159
-
160
- $type = substr($type, 0, strpos($type, '/'));
161
-
162
- $extensions[$type][] = str_replace('|', ',', $allowed_extensions);
163
- }
164
-
165
- // format the extensions for plupload
166
- foreach ($extensions as $type => $exts) {
167
-
168
- $types[] = array(
169
- 'title' => $type,
170
- 'extensions' => implode(',', $exts),
171
- );
172
- }
173
-
174
- return apply_filters('wooccm_mime_types', $types);
175
- }
176
-
177
- function add_action_links($links) {
178
-
179
- $links[] = '<a target="_blank" href="' . WOOCCM_SUPPORT_URL . '">' . esc_html__('Support', 'woocommerce-checkout-manager') . '</a>';
180
- $links[] = '<a href="' . admin_url('admin.php?page=woocommerce-checkout-manager">') . esc_html__('Settings', 'woocommerce-checkout-manager') . '</a>';
181
-
182
- return $links;
183
- }
184
-
185
- function register_scripts() {
186
-
187
- wp_register_style('woocommerce_admin_marketplace_styles', WC()->plugin_url() . '/assets/css/marketplace-suggestions.css', array(), WC_VERSION);
188
-
189
- wp_register_style('wooccm-admin', plugins_url('assets/css/wooccm-admin.css', WOOCCM_PLUGIN_FILE), array('woocommerce_admin_marketplace_styles'), WOOCCM_PLUGIN_VERSION, 'all');
190
-
191
- wp_register_script('wc-admin-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes.js', array('jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'accounting', 'round', 'wc-enhanced-select', 'plupload-all', 'stupidtable', 'jquery-tiptip'), WC_VERSION);
192
-
193
- wp_register_script('wooccm-modal', plugins_url('assets/js/wooccm-modal.js', WOOCCM_PLUGIN_FILE), array('jquery', 'wc-admin-meta-boxes', 'backbone'), WOOCCM_PLUGIN_VERSION, true);
194
-
195
- wp_register_script('wooccm-admin', plugins_url('assets/js/wooccm-admin.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
196
-
197
- wp_localize_script('wooccm-admin', 'wooccm', array(
198
- 'ajaxurl' => admin_url('admin-ajax.php'),
199
- 'nonce' => wp_create_nonce('wooccm_admin'),
200
- 'message' => array(
201
- 'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
202
- 'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
203
- 'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
204
- 'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
205
- ),
206
- 'icons' => array(
207
- 'interactive' => site_url('wp-includes/images/media/interactive.png'),
208
- 'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
209
- 'archive' => site_url('wp-includes/images/media/archive.png'),
210
- 'audio' => site_url('wp-includes/images/media/audio.png'),
211
- 'text' => site_url('wp-includes/images/media/text.png'),
212
- 'video' => site_url('wp-includes/images/media/video.png')
213
- ),
214
- 'fields' => array(
215
- 'args' => WOOCCM_Fields::get_field_args(),
216
- 'option' => WOOCCM_Fields::get_fields_option_types(),
217
- )
218
- ));
219
-
220
- wp_register_script('wooccm-order-upload', plugins_url('assets/js/wooccm-order-upload.js', WOOCCM_PLUGIN_FILE), array('wooccm-admin'), WOOCCM_PLUGIN_VERSION, true);
221
-
222
- wp_register_script('wooccm-checkout', plugins_url('assets/js/wooccm-checkout.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION, true);
223
-
224
- wp_localize_script('wooccm-checkout', 'wooccm', array(
225
- 'ajaxurl' => admin_url('admin-ajax.php'),
226
- 'nonce' => wp_create_nonce('wooccm_checkout_attachment_upload'),
227
- 'limit' => array(
228
- 'max_file_size' => wp_max_upload_size(),
229
- 'max_files' => 4,
230
- //'mime_types' => $this->get_mime_types(),
231
- ),
232
- 'icons' => array(
233
- 'interactive' => site_url('wp-includes/images/media/interactive.png'),
234
- 'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
235
- 'archive' => site_url('wp-includes/images/media/archive.png'),
236
- 'audio' => site_url('wp-includes/images/media/audio.png'),
237
- 'text' => site_url('wp-includes/images/media/text.png'),
238
- 'video' => site_url('wp-includes/images/media/video.png')
239
- ),
240
- 'message' => array(
241
- 'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
242
- 'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
243
- 'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
244
- 'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
245
- )
246
- ));
247
- }
248
-
249
- function add_admin_scripts() {
250
-
251
- $this->register_scripts();
252
-
253
- //1326
254
- // only for panel
255
- wp_enqueue_media();
256
- wp_enqueue_style('wooccm-admin');
257
- // 1326
258
- // only for orders
259
- wp_enqueue_script('wooccm-admin');
260
- wp_enqueue_script('wooccm-modal');
261
- // only for backend maybe orders
262
- wp_enqueue_script('wooccm-order-upload');
263
- }
264
-
265
- function admin_head() {
266
- ?>
267
- <style>
268
- body #adminmenu #toplevel_page_woocommerce a[href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm'); ?>"]:before {
269
- content: 'BETA';
270
- color: #fff;
271
- background-color: #21c2f8;
272
- padding: 1px 7px;
273
- font-size: 9px;
274
- font-weight: 700;
275
- border-radius: 10px;
276
- position: absolute;
277
- right: 15px;
278
- line-height: 16px;
279
- font-style: italic;
280
- }
281
- </style>
282
- <?php
283
- }
284
-
285
- function add_frontend_scripts() {
286
-
287
- $this->register_scripts();
288
-
289
- $i18n = substr(get_user_locale(), 0, 2);
290
-
291
- wp_enqueue_style('wooccm', plugins_url('assets/css/wooccm.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION, 'all');
292
-
293
- if (is_account_page()) {
294
- wp_enqueue_script('wooccm-order-upload');
295
- wp_enqueue_style('dashicons');
296
- wp_enqueue_style('wooccm-button-style', plugins_url('assets/old/edit-order-uploads-button_style.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION, 'all');
297
- }
298
-
299
- if (is_checkout()) {
300
-
301
- // UI
302
- // ---------------------------------------------------------------------
303
- wp_enqueue_style('jquery-ui-style', WC()->plugin_url() . '/assets/css/jquery-ui/jquery-ui.min.css', array(), WC_VERSION);
304
-
305
- // Datepicker
306
- // ---------------------------------------------------------------------
307
- wp_enqueue_script('jquery-ui-datepicker');
308
-
309
- // Timepicker
310
- // ---------------------------------------------------------------------
311
- wp_enqueue_style('jquery-ui-timepicker', plugins_url('assets/timepicker/jquery.ui.timepicker.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION);
312
- wp_enqueue_script('jquery-ui-timepicker', plugins_url('assets/timepicker/jquery.ui.timepicker.js', WOOCCM_PLUGIN_FILE), array('jquery'), WOOCCM_PLUGIN_VERSION);
313
-
314
- if (is_file(WOOCCM_PLUGIN_DIR . 'assets/timepicker/i18n/jquery.ui.timepicker-' . $i18n . '.js')) {
315
- wp_enqueue_script('jquery-ui-timepicker-' . $i18n, plugins_url('assets/timepicker/i18n/jquery.ui.timepicker-' . $i18n . '.js', WOOCCM_PLUGIN_FILE), array('jquery-ui-timepicker'), WOOCCM_PLUGIN_VERSION);
316
- }
317
-
318
- // Colorpicker
319
- // ---------------------------------------------------------------------
320
- wp_enqueue_style('wp-color-picker');
321
-
322
- wp_enqueue_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), false);
323
- wp_enqueue_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), false);
324
-
325
- wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
326
- 'clear' => __('Clear'),
327
- 'defaultString' => __('Default'),
328
- 'pick' => __('Select Color'),
329
- 'current' => __('Current Color'),
330
- ));
331
-
332
- // Farbtastic
333
- // ---------------------------------------------------------------------
334
- wp_enqueue_style('farbtastic');
335
- wp_enqueue_script('farbtastic', admin_url('js/farbtastic.js'), array('jquery'), false);
336
-
337
- // Dashicons
338
- // ---------------------------------------------------------------------
339
- wp_enqueue_style('dashicons');
340
-
341
- wp_enqueue_script('wooccm-checkout');
342
- }
343
- }
344
-
345
- function languages() {
346
- load_plugin_textdomain('woocommerce-checkout-manager', false, dirname(plugin_basename(__FILE__)) . '/languages/');
347
- }
348
-
349
- function includes() {
350
- // Old
351
- // -----------------------------------------------------------------------
352
- include( WOOCCM_PLUGIN_DIR . 'includes/install.php' );
353
- include( WOOCCM_PLUGIN_DIR . 'includes/functions.php' );
354
- include( WOOCCM_PLUGIN_DIR . 'includes/checkout.php' );
355
- //1326
356
- //include( WOOCCM_PLUGIN_DIR . 'includes/checkout-billing.php' );
357
- //include( WOOCCM_PLUGIN_DIR . 'includes/checkout-shipping.php' );
358
- //include( WOOCCM_PLUGIN_DIR . 'includes/checkout-additional.php' );
359
- include( WOOCCM_PLUGIN_DIR . 'includes/email.php' );
360
- include( WOOCCM_PLUGIN_DIR . 'includes/formatting.php' );
361
- include( WOOCCM_PLUGIN_DIR . 'includes/admin.php' );
362
- include( WOOCCM_PLUGIN_DIR . 'includes/template.php' );
363
- include( WOOCCM_PLUGIN_DIR . 'includes/export.php' );
364
- include( WOOCCM_PLUGIN_DIR . 'includes/classes/main.php' );
365
- //1326
366
- //include( WOOCCM_PLUGIN_DIR . 'includes/classes/field_filters.php' );
367
- // @mod - We need to load the templates conditionally
368
- //include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/add_functions.php' );
369
- //include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/billing_functions.php' );
370
- //include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/shipping_functions.php' );
371
- //1326
372
- //include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/add_wooccmupload.php' );
373
- //include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/billing_wooccmupload.php' );
374
- //include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/shipping_wooccmupload.php' );
375
- include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/required/add_required.php' );
376
- include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/required/billing_required.php' );
377
- include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/required/shipping_required.php' );
378
- //include( WOOCCM_PLUGIN_DIR . 'includes/templates/functions/wooccm_editing_wrapper.php' );
379
- // New
380
- // -----------------------------------------------------------------------
381
- //include( WOOCCM_PLUGIN_DIR . 'new/install.php' );
382
- //include( WOOCCM_PLUGIN_DIR . 'new/admin/ajax.php' );
383
- //include( WOOCCM_PLUGIN_DIR . 'new/admin/admin.php' );
384
- include( WOOCCM_PLUGIN_DIR . 'new/checkout.php' );
385
- include( WOOCCM_PLUGIN_DIR . 'new/orders.php' );
386
- include( WOOCCM_PLUGIN_DIR . 'new/fields_init.php' );
387
- include( WOOCCM_PLUGIN_DIR . 'new/fields_register.php' );
388
- include( WOOCCM_PLUGIN_DIR . 'new/fields_additional.php' );
389
- include( WOOCCM_PLUGIN_DIR . 'new/fields_display.php' );
390
- include( WOOCCM_PLUGIN_DIR . 'new/fields_conditional.php' );
391
- include( WOOCCM_PLUGIN_DIR . 'new/fields_handler.php' );
392
- include( WOOCCM_PLUGIN_DIR . 'new/fields_filters.php' );
393
- //include( WOOCCM_PLUGIN_DIR . 'new/premium/fields_datepicker.php' );
394
- //include( WOOCCM_PLUGIN_DIR . 'new/premium/fields_timepicker.php' );
395
- //include( WOOCCM_PLUGIN_DIR . 'new/premium/fields_amount.php' );
396
- }
397
-
398
- function init() {
399
- add_action('wp_ajax_wooccm_dismiss_notice', array($this, 'ajax_dismiss_notice'));
400
- add_action('wp_enqueue_scripts', array($this, 'add_frontend_scripts'));
401
- add_action('admin_enqueue_scripts', array($this, 'add_admin_scripts'));
402
- add_action('admin_notices', array($this, 'add_notices'));
403
- add_action('admin_head', array($this, 'admin_head'));
404
- add_filter('plugin_action_links_' . plugin_basename(WOOCCM_PLUGIN_FILE), array($this, 'add_action_links'));
405
- }
406
-
407
- public static function do_activation() {
408
- set_transient('wooccm-first-rating', true, MONTH_IN_SECONDS);
409
-
410
- if (class_exists('WOOCCM_Install')) {
411
- WOOCCM_Install::do_activation();
412
- } else {
413
- wooccm_install();
414
- }
415
- }
416
-
417
- public static function instance() {
418
- if (!isset(self::$instance)) {
419
- self::$instance = new self();
420
- self::$instance->includes();
421
- self::$instance->init();
422
- self::$instance->languages();
423
- }
424
- return self::$instance;
425
- }
426
-
427
- }
428
-
429
- //add_action('plugins_loaded', array('WOOCCM', 'instance'));
430
-
431
- WOOCCM::instance();
432
-
433
 
434
- register_activation_hook(WOOCCM_PLUGIN_FILE, array('WOOCCM', 'do_activation'));
 
435
  }
436
 
 
 
 
437
  add_action('woocommerce_before_checkout_form', 'wooccm_autocreate_account');
438
  // E-mail - Order receipt
439
  add_action('woocommerce_email_after_order_table', 'wooccm_order_receipt_checkout_details', 10, 3);
@@ -448,14 +75,7 @@ add_action('woocommerce_checkout_before_customer_details', 'wooccm_checkout_text
448
  add_filter('woocommerce_checkout_fields', 'wooccm_remove_fields_filter_billing', 15);
449
  add_filter('woocommerce_checkout_fields', 'wooccm_remove_fields_filter_shipping', 1);
450
  add_action('wp_head', 'wooccm_display_front');
451
- //add_action('wp_head', 'wooccm_billing_hide_required');
452
- //add_action('wp_head', 'wooccm_shipping_hide_required');
453
- // @mod - wooccm_run_color_inner does not exist
454
- // add_action( 'wooccm_run_color_innerpicker', 'wooccm_run_color_inner' ); run color inside options page (proto)
455
- //add_action('woocommerce_before_checkout_form', 'wooccm_override_this');
456
- //add_filter('woocommerce_billing_fields', 'wooccm_checkout_billing_fields');
457
- //add_filter('woocommerce_default_address_fields', 'wooccm_checkout_default_address_fields');
458
- //add_filter('woocommerce_shipping_fields', 'wooccm_checkout_shipping_fields');
459
  add_filter('wcdn_order_info_fields', 'wooccm_woocommerce_delivery_notes_compat', 10, 2);
460
  add_filter('wc_customer_order_csv_export_order_row', 'wooccm_csv_export_modify_row_data', 10, 3);
461
  add_filter('wc_customer_order_csv_export_order_headers', 'wooccm_csv_export_modify_column_headers');
@@ -466,43 +86,10 @@ add_action('woocommerce_checkout_process', 'wooccm_custom_checkout_process');
466
  add_action('woocommerce_checkout_process', 'wooccm_billing_custom_checkout_process');
467
  add_action('woocommerce_checkout_process', 'wooccm_shipping_custom_checkout_process');
468
 
469
- //1326
470
- //add_action('woocommerce_before_checkout_form', 'wooccm_billing_scripts');
471
- //add_action('woocommerce_before_checkout_form', 'wooccm_billing_override_this');
472
- //add_action('woocommerce_before_checkout_form', 'wooccm_shipping_scripts');
473
- //add_action('woocommerce_before_checkout_form', 'wooccm_shipping_override_this');
474
- //add_action('woocommerce_before_checkout_form', 'wooccm_scripts');
475
- //add_action('woocommerce_before_checkout_form', 'wooccm_upload_scripts');
476
-
477
  add_action('woocommerce_checkout_fields', 'wooccm_order_notes');
478
  add_filter('parse_query', 'wooccm_query_list');
479
  add_action('restrict_manage_posts', 'woooccm_restrict_manage_posts');
480
 
481
- /*
482
- * 1326
483
- * switch (wooccm_checkout_additional_positioning()) {
484
-
485
- case 'before_shipping_form':
486
- add_action('woocommerce_before_checkout_shipping_form', 'wooccm_checkout_additional_fields');
487
- break;
488
-
489
- case 'after_shipping_form':
490
- add_action('woocommerce_after_checkout_shipping_form', 'wooccm_checkout_additional_fields');
491
- break;
492
-
493
- case 'before_billing_form':
494
- add_action('woocommerce_before_checkout_billing_form', 'wooccm_checkout_additional_fields');
495
- break;
496
-
497
- case 'after_billing_form':
498
- add_action('woocommerce_after_checkout_billing_form', 'wooccm_checkout_additional_fields');
499
- break;
500
-
501
- case 'after_order_notes':
502
- add_action('woocommerce_after_order_notes', 'wooccm_checkout_additional_fields');
503
- break;
504
- } */
505
-
506
  if (wooccm_validator_changename()) {
507
 
508
  add_action('woocommerce_before_cart', 'wooccm_before_checkout');
@@ -519,16 +106,4 @@ if (wooccm_validator_changename()) {
519
 
520
  if (wooccm_enable_auto_complete()) {
521
  add_action('woocommerce_before_checkout_form', 'wooccm_retain_field_values');
522
- }
523
-
524
- /* function wooccm_load_textdomain() {
525
-
526
- $options = get_option('wccs_settings');
527
- // @mod - We are loading translations unless they opt-out via the WordPress Filter
528
- $options['checkness']['admin_translation'] = apply_filters('wooccm_load_textdomain', true, ( isset($options['checkness']['admin_translation']) ? $options['checkness']['admin_translation'] : false));
529
- if (!empty($options['checkness']['admin_translation'])) {
530
- load_plugin_textdomain('woocommerce-checkout-manager', false, dirname(plugin_basename(__FILE__)) . '/languages/');
531
- }
532
- }
533
-
534
- add_action('plugins_loaded', 'wooccm_load_textdomain'); */
1
  <?php
2
+
3
  /**
4
  * Plugin Name: WooCommerce Checkout Manager
5
  * Description: Manages WooCommerce Checkout, the advanced way.
6
+ * Version: 4.5.0
7
  * Author: QuadLayers
8
  * Author URI: https://www.quadlayers.com
9
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
17
  define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
18
  }
19
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
20
+ define('WOOCCM_PLUGIN_VERSION', '4.5.0');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_FILE')) {
23
  define('WOOCCM_PLUGIN_FILE', __FILE__);
50
  define('WOOCCM_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
51
  }
52
 
53
+ if (!class_exists('WOOCCM', false)) {
54
+ include_once WOOCCM_PLUGIN_DIR . 'new/class-wooccm.php';
55
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
+ function WOOCCM() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
58
+ return WOOCCM::instance();
59
  }
60
 
61
+ // Global for backwards compatibility.
62
+ $GLOBALS['wooccm'] = WOOCCM();
63
+
64
  add_action('woocommerce_before_checkout_form', 'wooccm_autocreate_account');
65
  // E-mail - Order receipt
66
  add_action('woocommerce_email_after_order_table', 'wooccm_order_receipt_checkout_details', 10, 3);
75
  add_filter('woocommerce_checkout_fields', 'wooccm_remove_fields_filter_billing', 15);
76
  add_filter('woocommerce_checkout_fields', 'wooccm_remove_fields_filter_shipping', 1);
77
  add_action('wp_head', 'wooccm_display_front');
78
+
 
 
 
 
 
 
 
79
  add_filter('wcdn_order_info_fields', 'wooccm_woocommerce_delivery_notes_compat', 10, 2);
80
  add_filter('wc_customer_order_csv_export_order_row', 'wooccm_csv_export_modify_row_data', 10, 3);
81
  add_filter('wc_customer_order_csv_export_order_headers', 'wooccm_csv_export_modify_column_headers');
86
  add_action('woocommerce_checkout_process', 'wooccm_billing_custom_checkout_process');
87
  add_action('woocommerce_checkout_process', 'wooccm_shipping_custom_checkout_process');
88
 
 
 
 
 
 
 
 
 
89
  add_action('woocommerce_checkout_fields', 'wooccm_order_notes');
90
  add_filter('parse_query', 'wooccm_query_list');
91
  add_action('restrict_manage_posts', 'woooccm_restrict_manage_posts');
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  if (wooccm_validator_changename()) {
94
 
95
  add_action('woocommerce_before_cart', 'wooccm_before_checkout');
106
 
107
  if (wooccm_enable_auto_complete()) {
108
  add_action('woocommerce_before_checkout_form', 'wooccm_retain_field_values');
109
+ }