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