Version Description
- Fix: woocommerce checkout datepicker required
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 5.0.4 |
Comparing to | |
See all releases |
Code changes from version 5.0.3 to 5.0.4
- assets/backend/css/wooccm-admin.css +225 -225
- assets/backend/css/wooccm-admin.min.css +1 -1
- assets/backend/js/wooccm-admin-field.js +481 -481
- assets/backend/js/wooccm-admin.js +278 -278
- assets/frontend/css/wooccm.css +120 -120
- assets/frontend/css/wooccm.min.css +1 -1
- assets/frontend/js/wooccm-checkout.js +515 -515
- assets/frontend/js/wooccm-order-upload.js +134 -134
- includes/class-wooccm-compatibility.php +415 -415
- includes/class-wooccm-install.php +92 -92
- includes/class-wooccm-notices.php +166 -166
- includes/class-wooccm-suggestions-list-table.php +140 -140
- includes/class-wooccm-upload.php +159 -159
- includes/class-wooccm.php +140 -140
- includes/controller/class-wooccm-advanced.php +135 -135
- includes/controller/class-wooccm-checkout.php +393 -393
- includes/controller/class-wooccm-email.php +129 -129
- includes/controller/class-wooccm-field-additional.php +221 -221
- includes/controller/class-wooccm-field-billing.php +93 -93
- includes/controller/class-wooccm-field-shipping.php +93 -93
- includes/controller/class-wooccm-field.php +387 -387
- includes/controller/class-wooccm-order.php +310 -310
- includes/controller/class-wooccm-premium.php +57 -57
- includes/controller/class-wooccm-suggestions.php +62 -62
- includes/view/backend/meta-boxes/html-order-uploads.php +60 -60
- includes/view/backend/pages/additional.php +8 -8
- includes/view/backend/pages/billing.php +9 -9
- includes/view/backend/pages/modals/field.php +19 -19
- includes/view/backend/pages/modals/parts/info.php +76 -76
- includes/view/backend/pages/modals/parts/panel-admin.php +23 -23
- includes/view/backend/pages/modals/parts/panel-datepicker.php +63 -63
- includes/view/backend/pages/modals/parts/panel-display.php +33 -33
- includes/view/backend/pages/modals/parts/panel-filter.php +79 -79
- includes/view/backend/pages/modals/parts/panel-select2.php +39 -39
- includes/view/backend/pages/modals/parts/panel-timepicker.php +28 -28
- includes/view/backend/pages/parts/header.php +47 -47
- includes/view/backend/pages/parts/loop.php +129 -129
- includes/view/backend/pages/parts/tabs.php +4 -4
- includes/view/backend/pages/shipping.php +8 -8
- includes/view/frontend/class-wooccm-fields-handler.php +255 -255
- languages/woocommerce-checkout-manager.pot +1219 -1219
- readme.txt +4 -1
- templates/order/order-custom-fields.php +26 -26
- templates/order/order-upload-files.php +57 -57
- woocommerce-checkout-manager.php +2 -2
assets/backend/css/wooccm-admin.css
CHANGED
@@ -1,226 +1,226 @@
|
|
1 |
-
.select2-container {
|
2 |
-
z-index: 9999999;
|
3 |
-
}
|
4 |
-
.select2-container .select2-selection--single,
|
5 |
-
.select2-container .select2-selection--single .select2-selection__rendered,
|
6 |
-
.select2-container .select2-selection--single .select2-selection__arrow {
|
7 |
-
height: 30px!important;
|
8 |
-
line-height: 30px!important;
|
9 |
-
}
|
10 |
-
.wooccm-premium {
|
11 |
-
opacity: 0.5;
|
12 |
-
pointer-events: none;
|
13 |
-
/* .description {
|
14 |
-
&.premium {
|
15 |
-
//display: none;
|
16 |
-
}
|
17 |
-
|
18 |
-
&.hidden {
|
19 |
-
//display: none;
|
20 |
-
}
|
21 |
-
}*/
|
22 |
-
}
|
23 |
-
.button.fileinput-button {
|
24 |
-
position: relative;
|
25 |
-
overflow: hidden!important;
|
26 |
-
}
|
27 |
-
.button.fileinput-button input {
|
28 |
-
position: absolute;
|
29 |
-
top: 0;
|
30 |
-
right: 0;
|
31 |
-
margin: 0;
|
32 |
-
opacity: 0;
|
33 |
-
-ms-filter: 'alpha(opacity=0)';
|
34 |
-
font-size: 200px;
|
35 |
-
direction: ltr;
|
36 |
-
cursor: pointer;
|
37 |
-
}
|
38 |
-
table.wc_gateways > tbody > tr > td select {
|
39 |
-
line-height: 1!important;
|
40 |
-
}
|
41 |
-
table.wc_gateways > tbody > tr > td.label {
|
42 |
-
font-weight: 600;
|
43 |
-
}
|
44 |
-
table.wooccm-enhanced-options {
|
45 |
-
border: none;
|
46 |
-
box-shadow: none;
|
47 |
-
}
|
48 |
-
table.wooccm-enhanced-options > thead > th .woocommerce-help-tip {
|
49 |
-
margin: -1px 0 0 0.25em;
|
50 |
-
}
|
51 |
-
table.wooccm-enhanced-options > tbody > tr > td input.label {
|
52 |
-
width: 100%;
|
53 |
-
}
|
54 |
-
table.wooccm-enhanced-options > tbody > tr > td select.add-price-type {
|
55 |
-
margin: 0 0 0 10px;
|
56 |
-
}
|
57 |
-
table.wooccm-enhanced-options > tbody > tr > td input.check {
|
58 |
-
margin: 0 9px;
|
59 |
-
}
|
60 |
-
table.wooccm-enhanced-options > tbody > tr > td.sort .wc-item-reorder-nav {
|
61 |
-
width: auto;
|
62 |
-
}
|
63 |
-
#wooccm_modal.processing {
|
64 |
-
pointer-events: none;
|
65 |
-
}
|
66 |
-
#wooccm_modal.processing:before {
|
67 |
-
content: '';
|
68 |
-
position: absolute;
|
69 |
-
top: 0;
|
70 |
-
bottom: 0;
|
71 |
-
left: 0;
|
72 |
-
right: 0;
|
73 |
-
background-color: #ffffff;
|
74 |
-
z-index: 99999999;
|
75 |
-
opacity: 0.8;
|
76 |
-
}
|
77 |
-
#wooccm_modal select {
|
78 |
-
min-height: 30px;
|
79 |
-
}
|
80 |
-
#wooccm_modal .form-field .wrap {
|
81 |
-
padding: 0;
|
82 |
-
}
|
83 |
-
#wooccm_modal .attachment-info .details,
|
84 |
-
#wooccm_modal .attachment-info .settings {
|
85 |
-
width: 100%;
|
86 |
-
}
|
87 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel label,
|
88 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel legend {
|
89 |
-
width: 75px;
|
90 |
-
margin: 0 0 0 -90px;
|
91 |
-
font-weight: 600;
|
92 |
-
}
|
93 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,
|
94 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field {
|
95 |
-
padding: 0 20px 0 92px!important;
|
96 |
-
}
|
97 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],
|
98 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],
|
99 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],
|
100 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],
|
101 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel select,
|
102 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container {
|
103 |
-
width: 100%!important;
|
104 |
-
}
|
105 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel {
|
106 |
-
width: 100%;
|
107 |
-
/* input,
|
108 |
-
select,
|
109 |
-
textarea {
|
110 |
-
margin: 0;
|
111 |
-
}*/
|
112 |
-
}
|
113 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium {
|
114 |
-
display: block;
|
115 |
-
clear: both;
|
116 |
-
}
|
117 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip {
|
118 |
-
margin: 0 0 0 0.5em;
|
119 |
-
}
|
120 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
121 |
-
width: 50%!important;
|
122 |
-
line-height: 16px;
|
123 |
-
}
|
124 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection {
|
125 |
-
box-shadow: none;
|
126 |
-
border-radius: 3px;
|
127 |
-
padding: 0 24px 0 8px;
|
128 |
-
}
|
129 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple {
|
130 |
-
line-height: 16px;
|
131 |
-
min-height: 30px;
|
132 |
-
}
|
133 |
-
@media only screen and (max-width: 1280px) {
|
134 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
135 |
-
width: 80%!important;
|
136 |
-
}
|
137 |
-
}
|
138 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
139 |
-
margin: 3px 3px 0 0;
|
140 |
-
}
|
141 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple {
|
142 |
-
border-color: #5b9dd9!important;
|
143 |
-
box-shadow: 0 0 2px rgba(30, 140, 190, 0.8) !important;
|
144 |
-
outline: 2px solid transparent!important;
|
145 |
-
}
|
146 |
-
#wooccm-order-files .inside {
|
147 |
-
margin: 0;
|
148 |
-
padding: 0;
|
149 |
-
background: #fefefe;
|
150 |
-
display: block!important;
|
151 |
-
}
|
152 |
-
#wooccm-order-files .handlediv,
|
153 |
-
#wooccm-order-files .hndle {
|
154 |
-
display: none;
|
155 |
-
}
|
156 |
-
#wooccm-order-files .wooccm_upload_results {
|
157 |
-
display: inline-block;
|
158 |
-
margin: 0 10px;
|
159 |
-
}
|
160 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper {
|
161 |
-
margin: 0;
|
162 |
-
overflow-x: auto;
|
163 |
-
}
|
164 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments {
|
165 |
-
width: 100%;
|
166 |
-
background: #fff;
|
167 |
-
}
|
168 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child {
|
169 |
-
padding-left: 2em;
|
170 |
-
}
|
171 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable {
|
172 |
-
cursor: pointer;
|
173 |
-
}
|
174 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item {
|
175 |
-
min-width: 200px;
|
176 |
-
}
|
177 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th {
|
178 |
-
text-align: left;
|
179 |
-
padding: 1em;
|
180 |
-
font-weight: 400;
|
181 |
-
color: #999;
|
182 |
-
background: #f8f8f8;
|
183 |
-
user-select: none;
|
184 |
-
}
|
185 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td {
|
186 |
-
border-top: none;
|
187 |
-
}
|
188 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td {
|
189 |
-
border-bottom: 1px solid #dfdfdf;
|
190 |
-
}
|
191 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb {
|
192 |
-
text-align: left;
|
193 |
-
width: 38px;
|
194 |
-
padding-bottom: 1.5em;
|
195 |
-
}
|
196 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail {
|
197 |
-
width: 38px;
|
198 |
-
height: 38px;
|
199 |
-
border: 2px solid #e8e8e8;
|
200 |
-
background: #f8f8f8;
|
201 |
-
color: #ccc;
|
202 |
-
position: relative;
|
203 |
-
font-size: 21px;
|
204 |
-
display: block;
|
205 |
-
text-align: center;
|
206 |
-
}
|
207 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,
|
208 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child {
|
209 |
-
padding-left: 2em;
|
210 |
-
}
|
211 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,
|
212 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td {
|
213 |
-
padding: 1.5em 1em 1em;
|
214 |
-
text-align: left;
|
215 |
-
line-height: 1.5em;
|
216 |
-
vertical-align: top;
|
217 |
-
border-bottom: 1px solid #f8f8f8;
|
218 |
-
}
|
219 |
-
#wooccm-order-files .wc-order-data-row {
|
220 |
-
border-bottom: 1px solid #dfdfdf;
|
221 |
-
padding: 1.5em 2em;
|
222 |
-
background: #f8f8f8;
|
223 |
-
line-height: 2em;
|
224 |
-
text-align: left;
|
225 |
-
}
|
226 |
/*# sourceMappingURL=wooccm-admin.css.map */
|
1 |
+
.select2-container {
|
2 |
+
z-index: 9999999;
|
3 |
+
}
|
4 |
+
.select2-container .select2-selection--single,
|
5 |
+
.select2-container .select2-selection--single .select2-selection__rendered,
|
6 |
+
.select2-container .select2-selection--single .select2-selection__arrow {
|
7 |
+
height: 30px!important;
|
8 |
+
line-height: 30px!important;
|
9 |
+
}
|
10 |
+
.wooccm-premium {
|
11 |
+
opacity: 0.5;
|
12 |
+
pointer-events: none;
|
13 |
+
/* .description {
|
14 |
+
&.premium {
|
15 |
+
//display: none;
|
16 |
+
}
|
17 |
+
|
18 |
+
&.hidden {
|
19 |
+
//display: none;
|
20 |
+
}
|
21 |
+
}*/
|
22 |
+
}
|
23 |
+
.button.fileinput-button {
|
24 |
+
position: relative;
|
25 |
+
overflow: hidden!important;
|
26 |
+
}
|
27 |
+
.button.fileinput-button input {
|
28 |
+
position: absolute;
|
29 |
+
top: 0;
|
30 |
+
right: 0;
|
31 |
+
margin: 0;
|
32 |
+
opacity: 0;
|
33 |
+
-ms-filter: 'alpha(opacity=0)';
|
34 |
+
font-size: 200px;
|
35 |
+
direction: ltr;
|
36 |
+
cursor: pointer;
|
37 |
+
}
|
38 |
+
table.wc_gateways > tbody > tr > td select {
|
39 |
+
line-height: 1!important;
|
40 |
+
}
|
41 |
+
table.wc_gateways > tbody > tr > td.label {
|
42 |
+
font-weight: 600;
|
43 |
+
}
|
44 |
+
table.wooccm-enhanced-options {
|
45 |
+
border: none;
|
46 |
+
box-shadow: none;
|
47 |
+
}
|
48 |
+
table.wooccm-enhanced-options > thead > th .woocommerce-help-tip {
|
49 |
+
margin: -1px 0 0 0.25em;
|
50 |
+
}
|
51 |
+
table.wooccm-enhanced-options > tbody > tr > td input.label {
|
52 |
+
width: 100%;
|
53 |
+
}
|
54 |
+
table.wooccm-enhanced-options > tbody > tr > td select.add-price-type {
|
55 |
+
margin: 0 0 0 10px;
|
56 |
+
}
|
57 |
+
table.wooccm-enhanced-options > tbody > tr > td input.check {
|
58 |
+
margin: 0 9px;
|
59 |
+
}
|
60 |
+
table.wooccm-enhanced-options > tbody > tr > td.sort .wc-item-reorder-nav {
|
61 |
+
width: auto;
|
62 |
+
}
|
63 |
+
#wooccm_modal.processing {
|
64 |
+
pointer-events: none;
|
65 |
+
}
|
66 |
+
#wooccm_modal.processing:before {
|
67 |
+
content: '';
|
68 |
+
position: absolute;
|
69 |
+
top: 0;
|
70 |
+
bottom: 0;
|
71 |
+
left: 0;
|
72 |
+
right: 0;
|
73 |
+
background-color: #ffffff;
|
74 |
+
z-index: 99999999;
|
75 |
+
opacity: 0.8;
|
76 |
+
}
|
77 |
+
#wooccm_modal select {
|
78 |
+
min-height: 30px;
|
79 |
+
}
|
80 |
+
#wooccm_modal .form-field .wrap {
|
81 |
+
padding: 0;
|
82 |
+
}
|
83 |
+
#wooccm_modal .attachment-info .details,
|
84 |
+
#wooccm_modal .attachment-info .settings {
|
85 |
+
width: 100%;
|
86 |
+
}
|
87 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel label,
|
88 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel legend {
|
89 |
+
width: 75px;
|
90 |
+
margin: 0 0 0 -90px;
|
91 |
+
font-weight: 600;
|
92 |
+
}
|
93 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,
|
94 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field {
|
95 |
+
padding: 0 20px 0 92px!important;
|
96 |
+
}
|
97 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],
|
98 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],
|
99 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],
|
100 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],
|
101 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel select,
|
102 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container {
|
103 |
+
width: 100%!important;
|
104 |
+
}
|
105 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel {
|
106 |
+
width: 100%;
|
107 |
+
/* input,
|
108 |
+
select,
|
109 |
+
textarea {
|
110 |
+
margin: 0;
|
111 |
+
}*/
|
112 |
+
}
|
113 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium {
|
114 |
+
display: block;
|
115 |
+
clear: both;
|
116 |
+
}
|
117 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip {
|
118 |
+
margin: 0 0 0 0.5em;
|
119 |
+
}
|
120 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
121 |
+
width: 50%!important;
|
122 |
+
line-height: 16px;
|
123 |
+
}
|
124 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection {
|
125 |
+
box-shadow: none;
|
126 |
+
border-radius: 3px;
|
127 |
+
padding: 0 24px 0 8px;
|
128 |
+
}
|
129 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple {
|
130 |
+
line-height: 16px;
|
131 |
+
min-height: 30px;
|
132 |
+
}
|
133 |
+
@media only screen and (max-width: 1280px) {
|
134 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
135 |
+
width: 80%!important;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
139 |
+
margin: 3px 3px 0 0;
|
140 |
+
}
|
141 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple {
|
142 |
+
border-color: #5b9dd9!important;
|
143 |
+
box-shadow: 0 0 2px rgba(30, 140, 190, 0.8) !important;
|
144 |
+
outline: 2px solid transparent!important;
|
145 |
+
}
|
146 |
+
#wooccm-order-files .inside {
|
147 |
+
margin: 0;
|
148 |
+
padding: 0;
|
149 |
+
background: #fefefe;
|
150 |
+
display: block!important;
|
151 |
+
}
|
152 |
+
#wooccm-order-files .handlediv,
|
153 |
+
#wooccm-order-files .hndle {
|
154 |
+
display: none;
|
155 |
+
}
|
156 |
+
#wooccm-order-files .wooccm_upload_results {
|
157 |
+
display: inline-block;
|
158 |
+
margin: 0 10px;
|
159 |
+
}
|
160 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper {
|
161 |
+
margin: 0;
|
162 |
+
overflow-x: auto;
|
163 |
+
}
|
164 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments {
|
165 |
+
width: 100%;
|
166 |
+
background: #fff;
|
167 |
+
}
|
168 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child {
|
169 |
+
padding-left: 2em;
|
170 |
+
}
|
171 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable {
|
172 |
+
cursor: pointer;
|
173 |
+
}
|
174 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item {
|
175 |
+
min-width: 200px;
|
176 |
+
}
|
177 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th {
|
178 |
+
text-align: left;
|
179 |
+
padding: 1em;
|
180 |
+
font-weight: 400;
|
181 |
+
color: #999;
|
182 |
+
background: #f8f8f8;
|
183 |
+
user-select: none;
|
184 |
+
}
|
185 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td {
|
186 |
+
border-top: none;
|
187 |
+
}
|
188 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td {
|
189 |
+
border-bottom: 1px solid #dfdfdf;
|
190 |
+
}
|
191 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb {
|
192 |
+
text-align: left;
|
193 |
+
width: 38px;
|
194 |
+
padding-bottom: 1.5em;
|
195 |
+
}
|
196 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail {
|
197 |
+
width: 38px;
|
198 |
+
height: 38px;
|
199 |
+
border: 2px solid #e8e8e8;
|
200 |
+
background: #f8f8f8;
|
201 |
+
color: #ccc;
|
202 |
+
position: relative;
|
203 |
+
font-size: 21px;
|
204 |
+
display: block;
|
205 |
+
text-align: center;
|
206 |
+
}
|
207 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,
|
208 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child {
|
209 |
+
padding-left: 2em;
|
210 |
+
}
|
211 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,
|
212 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td {
|
213 |
+
padding: 1.5em 1em 1em;
|
214 |
+
text-align: left;
|
215 |
+
line-height: 1.5em;
|
216 |
+
vertical-align: top;
|
217 |
+
border-bottom: 1px solid #f8f8f8;
|
218 |
+
}
|
219 |
+
#wooccm-order-files .wc-order-data-row {
|
220 |
+
border-bottom: 1px solid #dfdfdf;
|
221 |
+
padding: 1.5em 2em;
|
222 |
+
background: #f8f8f8;
|
223 |
+
line-height: 2em;
|
224 |
+
text-align: left;
|
225 |
+
}
|
226 |
/*# sourceMappingURL=wooccm-admin.css.map */
|
assets/backend/css/wooccm-admin.min.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
|
2 |
.select2-container{z-index:9999999}.select2-container .select2-selection--single,.select2-container .select2-selection--single .select2-selection__rendered,.select2-container .select2-selection--single .select2-selection__arrow{height:30px!important;line-height:30px!important}.wooccm-premium{opacity:.5;pointer-events:none}.button.fileinput-button{position:relative;overflow:hidden!important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}table.wc_gateways>tbody>tr>td select{line-height:1!important}table.wc_gateways>tbody>tr>td.label{font-weight:600}table.wooccm-enhanced-options{border:0;box-shadow:none}table.wooccm-enhanced-options>thead>th .woocommerce-help-tip{margin:-1px 0 0 .25em}table.wooccm-enhanced-options>tbody>tr>td input.label{width:100%}table.wooccm-enhanced-options>tbody>tr>td select.add-price-type{margin:0 0 0 10px}table.wooccm-enhanced-options>tbody>tr>td input.check{margin:0 9px}table.wooccm-enhanced-options>tbody>tr>td.sort .wc-item-reorder-nav{width:auto}#wooccm_modal.processing{pointer-events:none}#wooccm_modal.processing:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:99999999;opacity:.8}#wooccm_modal select{min-height:30px}#wooccm_modal .form-field .wrap{padding:0}#wooccm_modal .attachment-info .details,#wooccm_modal .attachment-info .settings{width:100%}#wooccm_modal .attachment-info .woocommerce_options_panel label,#wooccm_modal .attachment-info .woocommerce_options_panel legend{width:75px;margin:0 0 0 -90px;font-weight:600}#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field{padding:0 20px 0 92px!important}#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],#wooccm_modal .attachment-info .woocommerce_options_panel select,#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container{width:100%!important}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel{width:100%}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium{display:block;clear:both}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip{margin:0 0 0 .5em}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:50%!important;line-height:16px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection{box-shadow:none;border-radius:3px;padding:0 24px 0 8px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple{line-height:16px;min-height:30px}@media only screen and (max-width:1280px){#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:80%!important}}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li{margin:3px 3px 0 0}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#5b9dd9!important;box-shadow:0 0 2px rgba(30,140,190,0.8)!important;outline:2px solid transparent!important}#wooccm-order-files .inside{margin:0;padding:0;background:#fefefe;display:block!important}#wooccm-order-files .handlediv,#wooccm-order-files .hndle{display:none}#wooccm-order-files .wooccm_upload_results{display:inline-block;margin:0 10px}#wooccm-order-files .wooccm_order_attachments_wrapper{margin:0;overflow-x:auto}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments{width:100%;background:#fff}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable{cursor:pointer}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item{min-width:200px}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;user-select:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td{border-top:0}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#wooccm-order-files .wc-order-data-row{border-bottom:1px solid #dfdfdf;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:left}
|
1 |
+
|
2 |
.select2-container{z-index:9999999}.select2-container .select2-selection--single,.select2-container .select2-selection--single .select2-selection__rendered,.select2-container .select2-selection--single .select2-selection__arrow{height:30px!important;line-height:30px!important}.wooccm-premium{opacity:.5;pointer-events:none}.button.fileinput-button{position:relative;overflow:hidden!important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}table.wc_gateways>tbody>tr>td select{line-height:1!important}table.wc_gateways>tbody>tr>td.label{font-weight:600}table.wooccm-enhanced-options{border:0;box-shadow:none}table.wooccm-enhanced-options>thead>th .woocommerce-help-tip{margin:-1px 0 0 .25em}table.wooccm-enhanced-options>tbody>tr>td input.label{width:100%}table.wooccm-enhanced-options>tbody>tr>td select.add-price-type{margin:0 0 0 10px}table.wooccm-enhanced-options>tbody>tr>td input.check{margin:0 9px}table.wooccm-enhanced-options>tbody>tr>td.sort .wc-item-reorder-nav{width:auto}#wooccm_modal.processing{pointer-events:none}#wooccm_modal.processing:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:99999999;opacity:.8}#wooccm_modal select{min-height:30px}#wooccm_modal .form-field .wrap{padding:0}#wooccm_modal .attachment-info .details,#wooccm_modal .attachment-info .settings{width:100%}#wooccm_modal .attachment-info .woocommerce_options_panel label,#wooccm_modal .attachment-info .woocommerce_options_panel legend{width:75px;margin:0 0 0 -90px;font-weight:600}#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field{padding:0 20px 0 92px!important}#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],#wooccm_modal .attachment-info .woocommerce_options_panel select,#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container{width:100%!important}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel{width:100%}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium{display:block;clear:both}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip{margin:0 0 0 .5em}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:50%!important;line-height:16px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection{box-shadow:none;border-radius:3px;padding:0 24px 0 8px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple{line-height:16px;min-height:30px}@media only screen and (max-width:1280px){#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:80%!important}}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li{margin:3px 3px 0 0}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#5b9dd9!important;box-shadow:0 0 2px rgba(30,140,190,0.8)!important;outline:2px solid transparent!important}#wooccm-order-files .inside{margin:0;padding:0;background:#fefefe;display:block!important}#wooccm-order-files .handlediv,#wooccm-order-files .hndle{display:none}#wooccm-order-files .wooccm_upload_results{display:inline-block;margin:0 10px}#wooccm-order-files .wooccm_order_attachments_wrapper{margin:0;overflow-x:auto}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments{width:100%;background:#fff}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable{cursor:pointer}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item{min-width:200px}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;user-select:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td{border-top:0}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#wooccm-order-files .wc-order-data-row{border-bottom:1px solid #dfdfdf;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:left}
|
assets/backend/js/wooccm-admin-field.js
CHANGED
@@ -1,482 +1,482 @@
|
|
1 |
-
(function ($) {
|
2 |
-
|
3 |
-
var count = 0,
|
4 |
-
timer;
|
5 |
-
|
6 |
-
var is_blocked = function ($node) {
|
7 |
-
return $node.is('.processing') || $node.parents('.processing').length;
|
8 |
-
};
|
9 |
-
var block = function () {
|
10 |
-
$('#wooccm_modal').addClass('processing');
|
11 |
-
};
|
12 |
-
var unblock = function () {
|
13 |
-
$('#wooccm_modal').removeClass('processing');
|
14 |
-
};
|
15 |
-
|
16 |
-
_.mixin({
|
17 |
-
sortOptions: function (object) {
|
18 |
-
return _.sortBy(object, function (o) {
|
19 |
-
return o.order;
|
20 |
-
});
|
21 |
-
}
|
22 |
-
});
|
23 |
-
var FieldViewTabs = Backbone.View.extend({
|
24 |
-
templates: {},
|
25 |
-
initialize: function () {
|
26 |
-
this.templates.window = wp.template('wooccm-modal-tabs');
|
27 |
-
},
|
28 |
-
render: function () {
|
29 |
-
this.model.attributes.panel = 'general';
|
30 |
-
this.$el.html(this.templates.window(this.model.attributes));
|
31 |
-
//this.$el.trigger('wooccm-tab-panels');
|
32 |
-
}
|
33 |
-
});
|
34 |
-
var FieldViewPanels = Backbone.View.extend({
|
35 |
-
templates: {},
|
36 |
-
initialize: function () {
|
37 |
-
this.templates.window = wp.template('wooccm-modal-panels');
|
38 |
-
},
|
39 |
-
render: function () {
|
40 |
-
this.$el.html(this.templates.window(this.model.attributes));
|
41 |
-
this.$el.trigger('wooccm-enhanced-options');
|
42 |
-
this.$el.trigger('wooccm-enhanced-select');
|
43 |
-
this.$el.trigger('init_tooltips');
|
44 |
-
}
|
45 |
-
});
|
46 |
-
var FieldViewInfo = Backbone.View.extend({
|
47 |
-
templates: {},
|
48 |
-
initialize: function () {
|
49 |
-
this.templates.window = wp.template('wooccm-modal-info');
|
50 |
-
},
|
51 |
-
render: function () {
|
52 |
-
this.$el.html(this.templates.window(this.model.attributes));
|
53 |
-
this.$el.trigger('wooccm-enhanced-select');
|
54 |
-
this.$el.trigger('init_tooltips');
|
55 |
-
}
|
56 |
-
});
|
57 |
-
var FieldView = Backbone.View.extend({
|
58 |
-
events: {
|
59 |
-
'change input': 'enableSave',
|
60 |
-
'change textarea': 'enableSave',
|
61 |
-
'change select': 'enableSave',
|
62 |
-
'click .media-modal-backdrop': 'close',
|
63 |
-
'click .media-modal-close': 'close',
|
64 |
-
'click .media-modal-prev': 'edit',
|
65 |
-
'click .media-modal-next': 'edit',
|
66 |
-
'click .media-modal-tab': 'tab',
|
67 |
-
'change .media-modal-parent': 'parent',
|
68 |
-
'change .media-modal-render-tabs': 'renderTabs',
|
69 |
-
'change .media-modal-render-panels': 'renderPanels',
|
70 |
-
'change .media-modal-render-info': 'renderInfo',
|
71 |
-
'submit .media-modal-form': 'submit',
|
72 |
-
},
|
73 |
-
templates: {},
|
74 |
-
initialize: function () {
|
75 |
-
_.bindAll(this, 'tab', 'open', 'edit', 'parent', 'load', 'render', 'close', 'submit');
|
76 |
-
this.init();
|
77 |
-
this.open();
|
78 |
-
},
|
79 |
-
init: function () {
|
80 |
-
this.templates.window = wp.template('wooccm-modal-main');
|
81 |
-
},
|
82 |
-
assign: function (view, selector) {
|
83 |
-
view.setElement(this.$(selector)).render();
|
84 |
-
},
|
85 |
-
render: function () {
|
86 |
-
var modal = this;
|
87 |
-
modal.$el.html(modal.templates.window(modal.model.attributes));
|
88 |
-
this.tabs = new FieldViewTabs({model: modal.model});
|
89 |
-
this.panels = new FieldViewPanels({model: modal.model});
|
90 |
-
this.info = new FieldViewInfo({model: modal.model});
|
91 |
-
this.assign(this.tabs, '#wooccm-modal-tabs');
|
92 |
-
this.assign(this.panels, '#wooccm-modal-panels');
|
93 |
-
this.assign(this.info, '#wooccm-modal-info');
|
94 |
-
},
|
95 |
-
load: function () {
|
96 |
-
|
97 |
-
var modal = this;
|
98 |
-
|
99 |
-
block();
|
100 |
-
|
101 |
-
$.ajax({
|
102 |
-
url: wooccm_field.ajax_url,
|
103 |
-
data: {
|
104 |
-
action: 'wooccm_load_field',
|
105 |
-
nonce: wooccm_field.nonce,
|
106 |
-
field_id: this.model.attributes.id
|
107 |
-
},
|
108 |
-
dataType: 'json',
|
109 |
-
type: 'POST',
|
110 |
-
beforeSend: function () {
|
111 |
-
},
|
112 |
-
complete: function () {
|
113 |
-
unblock();
|
114 |
-
},
|
115 |
-
error: function () {
|
116 |
-
alert('Error!');
|
117 |
-
},
|
118 |
-
success: function (response) {
|
119 |
-
if (response.success) {
|
120 |
-
modal.model.set(response.data);
|
121 |
-
modal.render();
|
122 |
-
} else {
|
123 |
-
alert(response.data);
|
124 |
-
}
|
125 |
-
}
|
126 |
-
});
|
127 |
-
},
|
128 |
-
edit: function (e) {
|
129 |
-
e.preventDefault();
|
130 |
-
var modal = this,
|
131 |
-
$button = $(e.target),
|
132 |
-
field_count = parseInt($('.wc_gateways tr[data-field_id]').length),
|
133 |
-
order = parseInt(modal.model.get('order'));
|
134 |
-
count++;
|
135 |
-
if (timer) {
|
136 |
-
clearTimeout(timer);
|
137 |
-
}
|
138 |
-
|
139 |
-
timer = setTimeout(function () {
|
140 |
-
|
141 |
-
if ($button.hasClass('media-modal-next')) {
|
142 |
-
order = Math.min(order + count, field_count);
|
143 |
-
} else {
|
144 |
-
order = Math.max(order - count, 1);
|
145 |
-
}
|
146 |
-
|
147 |
-
modal.model.set({
|
148 |
-
id: parseInt($('.wc_gateways tr[data-field_order=' + order + ']').data('field_id'))
|
149 |
-
});
|
150 |
-
count = 0;
|
151 |
-
modal.load();
|
152 |
-
}, 300);
|
153 |
-
},
|
154 |
-
open: function (e) {
|
155 |
-
$('body').addClass('modal-open').append(this.$el);
|
156 |
-
if (this.model.attributes.id == undefined) {
|
157 |
-
_.delay(function () {
|
158 |
-
unblock();
|
159 |
-
}, 100);
|
160 |
-
return;
|
161 |
-
}
|
162 |
-
this.load();
|
163 |
-
},
|
164 |
-
updateModel: function (e) {
|
165 |
-
e.preventDefault();
|
166 |
-
|
167 |
-
var $field = $(e.target),
|
168 |
-
name = $field.attr('name'),
|
169 |
-
value = $field.val();
|
170 |
-
|
171 |
-
if (e.target.type === 'checkbox') {
|
172 |
-
value = $field.prop('checked') === true ? 1 : 0;
|
173 |
-
}
|
174 |
-
|
175 |
-
this.model.attributes[name] = value;
|
176 |
-
this.model.changed[name] = value;
|
177 |
-
},
|
178 |
-
tab: function (e) {
|
179 |
-
e.preventDefault();
|
180 |
-
|
181 |
-
var modal = this,
|
182 |
-
$modal = modal.$el.find('#wooccm_modal'),
|
183 |
-
$tab = $(e.currentTarget),
|
184 |
-
$tabs = $modal.find('ul.wc-tabs'),
|
185 |
-
panel = $tab.find('a').attr('href').replace('#', '');
|
186 |
-
|
187 |
-
$tabs.find('.active').removeClass('active');
|
188 |
-
$tab.addClass('active');
|
189 |
-
|
190 |
-
this.model.attributes['panel'] = panel;
|
191 |
-
this.model.changed['panel'] = panel;
|
192 |
-
|
193 |
-
this.renderPanels(e);
|
194 |
-
},
|
195 |
-
renderTabs: function (e) {
|
196 |
-
this.renderPanels(e);
|
197 |
-
this.tabs.render();
|
198 |
-
},
|
199 |
-
renderPanels: function (e) {
|
200 |
-
this.updateModel(e);
|
201 |
-
this.panels.render();
|
202 |
-
},
|
203 |
-
renderInfo: function () {
|
204 |
-
this.info.render();
|
205 |
-
},
|
206 |
-
close: function (e) {
|
207 |
-
e.preventDefault();
|
208 |
-
this.undelegateEvents();
|
209 |
-
$(document).off('focusin');
|
210 |
-
$('body').removeClass('modal-open');
|
211 |
-
this.remove();
|
212 |
-
},
|
213 |
-
parent: function (e) {
|
214 |
-
e.preventDefault();
|
215 |
-
var modal = this,
|
216 |
-
$modal = modal.$el.find('#wooccm_modal'),
|
217 |
-
$details = $modal.find('.attachment-details');
|
218 |
-
this.updateModel(e);
|
219 |
-
$.ajax({
|
220 |
-
url: wooccm_field.ajax_url,
|
221 |
-
data: {
|
222 |
-
action: 'wooccm_load_parent',
|
223 |
-
nonce: wooccm_field.nonce,
|
224 |
-
conditional_parent_key: modal.model.attributes.conditional_parent_key
|
225 |
-
},
|
226 |
-
dataType: 'json',
|
227 |
-
type: 'POST',
|
228 |
-
beforeSend: function () {
|
229 |
-
modal.disableSave();
|
230 |
-
$details.addClass('save-waiting');
|
231 |
-
},
|
232 |
-
complete: function () {
|
233 |
-
$details.addClass('save-complete');
|
234 |
-
$details.removeClass('save-waiting');
|
235 |
-
modal.enableSave();
|
236 |
-
},
|
237 |
-
error: function () {
|
238 |
-
alert('Error!');
|
239 |
-
},
|
240 |
-
success: function (response) {
|
241 |
-
if (response.success) {
|
242 |
-
modal.model.attributes['parent'] = response.data;
|
243 |
-
modal.model.changed['parent'] = response.data;
|
244 |
-
modal.renderInfo();
|
245 |
-
} else {
|
246 |
-
alert(response.data);
|
247 |
-
}
|
248 |
-
}
|
249 |
-
});
|
250 |
-
return false;
|
251 |
-
},
|
252 |
-
reload: function (e) {
|
253 |
-
if (this.$el.find('#wooccm_modal').hasClass('reload')) {
|
254 |
-
location.reload();
|
255 |
-
return;
|
256 |
-
}
|
257 |
-
this.remove();
|
258 |
-
return;
|
259 |
-
},
|
260 |
-
close: function (e) {
|
261 |
-
e.preventDefault();
|
262 |
-
this.undelegateEvents();
|
263 |
-
$(document).off('focusin');
|
264 |
-
$('body').removeClass('modal-open');
|
265 |
-
this.reload(e);
|
266 |
-
return;
|
267 |
-
},
|
268 |
-
enableSave: function (e) {
|
269 |
-
$('.media-modal-submit').removeProp('disabled');
|
270 |
-
},
|
271 |
-
disableSave: function (e) {
|
272 |
-
$('.media-modal-submit').prop('disabled', true);
|
273 |
-
},
|
274 |
-
submit: function (e) {
|
275 |
-
e.preventDefault();
|
276 |
-
var modal = this,
|
277 |
-
$modal = modal.$el.find('#wooccm_modal'),
|
278 |
-
$details = $modal.find('.attachment-details');
|
279 |
-
|
280 |
-
$.ajax({
|
281 |
-
url: wooccm_field.ajax_url,
|
282 |
-
data: {
|
283 |
-
action: 'wooccm_save_field',
|
284 |
-
nonce: wooccm_field.nonce,
|
285 |
-
field_id: modal.model.attributes.id,
|
286 |
-
field_data: $('form', this.$el).serialize()
|
287 |
-
},
|
288 |
-
dataType: 'json',
|
289 |
-
type: 'POST',
|
290 |
-
beforeSend: function () {
|
291 |
-
$('.media-modal-submit').prop('disabled', true);
|
292 |
-
$details.addClass('save-waiting');
|
293 |
-
block();
|
294 |
-
},
|
295 |
-
complete: function () {
|
296 |
-
$details.addClass('save-complete');
|
297 |
-
$details.removeClass('save-waiting');
|
298 |
-
unblock();
|
299 |
-
},
|
300 |
-
error: function () {
|
301 |
-
alert('Error!');
|
302 |
-
},
|
303 |
-
success: function (response) {
|
304 |
-
if (response.success) {
|
305 |
-
|
306 |
-
if (modal.model.attributes.id == undefined) {
|
307 |
-
$modal.addClass('reload');
|
308 |
-
modal.close(e);
|
309 |
-
}
|
310 |
-
|
311 |
-
//re-render dont load select2 saved options
|
312 |
-
modal.model.set(response.data);
|
313 |
-
//$modal.addClass('reload');
|
314 |
-
|
315 |
-
} else {
|
316 |
-
alert(response.data);
|
317 |
-
}
|
318 |
-
}
|
319 |
-
});
|
320 |
-
return false;
|
321 |
-
}
|
322 |
-
});
|
323 |
-
var FieldModel = Backbone.Model.extend({
|
324 |
-
defaults: wooccm_field.args
|
325 |
-
});
|
326 |
-
var FieldModal = Backbone.View.extend({
|
327 |
-
initialize: function (e) {
|
328 |
-
|
329 |
-
var $button = $(e.target),
|
330 |
-
field_id = $button.closest('[data-field_id]').data('field_id');
|
331 |
-
var model = new FieldModel();
|
332 |
-
model.set({
|
333 |
-
id: field_id
|
334 |
-
});
|
335 |
-
new FieldView({
|
336 |
-
model: model
|
337 |
-
}).render();
|
338 |
-
},
|
339 |
-
});
|
340 |
-
$('#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add').on('click', function (e) {
|
341 |
-
e.preventDefault();
|
342 |
-
new FieldModal(e);
|
343 |
-
});
|
344 |
-
$('#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset').on('click', function (e) {
|
345 |
-
e.preventDefault();
|
346 |
-
var $button = $(e.target);
|
347 |
-
var c = confirm(wooccm_field.message.reset);
|
348 |
-
if (!c) {
|
349 |
-
return false;
|
350 |
-
}
|
351 |
-
|
352 |
-
$.ajax({
|
353 |
-
url: wooccm_field.ajax_url,
|
354 |
-
data: {
|
355 |
-
action: 'wooccm_reset_fields',
|
356 |
-
nonce: wooccm_field.nonce
|
357 |
-
},
|
358 |
-
dataType: 'json',
|
359 |
-
type: 'POST',
|
360 |
-
beforeSend: function () {
|
361 |
-
},
|
362 |
-
complete: function () {
|
363 |
-
},
|
364 |
-
error: function () {
|
365 |
-
alert('Error!');
|
366 |
-
},
|
367 |
-
success: function (response) {
|
368 |
-
if (response.success) {
|
369 |
-
|
370 |
-
location.reload();
|
371 |
-
} else {
|
372 |
-
alert(response.data);
|
373 |
-
}
|
374 |
-
}
|
375 |
-
});
|
376 |
-
return false;
|
377 |
-
});
|
378 |
-
$('.wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit').on('click', function (e) {
|
379 |
-
e.preventDefault();
|
380 |
-
new FieldModal(e);
|
381 |
-
});
|
382 |
-
$('.wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete').on('click', function (e) {
|
383 |
-
e.preventDefault();
|
384 |
-
var $button = $(e.target),
|
385 |
-
$field = $button.closest('[data-field_id]'),
|
386 |
-
field_id = $field.data('field_id');
|
387 |
-
var c = confirm(wooccm_field.message.remove);
|
388 |
-
if (!c) {
|
389 |
-
return false;
|
390 |
-
}
|
391 |
-
|
392 |
-
$.ajax({
|
393 |
-
url: wooccm_field.ajax_url,
|
394 |
-
data: {
|
395 |
-
action: 'wooccm_delete_field',
|
396 |
-
nonce: wooccm_field.nonce,
|
397 |
-
field_id: field_id,
|
398 |
-
},
|
399 |
-
dataType: 'json',
|
400 |
-
type: 'POST',
|
401 |
-
beforeSend: function () {
|
402 |
-
},
|
403 |
-
complete: function () {
|
404 |
-
},
|
405 |
-
error: function () {
|
406 |
-
alert('Error!');
|
407 |
-
},
|
408 |
-
success: function (response) {
|
409 |
-
if (response.success) {
|
410 |
-
|
411 |
-
$field.remove();
|
412 |
-
} else {
|
413 |
-
alert(response.data);
|
414 |
-
}
|
415 |
-
}
|
416 |
-
});
|
417 |
-
return false;
|
418 |
-
});
|
419 |
-
$(document).on('click', '.wooccm-field-toggle-attribute', function (e) {
|
420 |
-
e.preventDefault();
|
421 |
-
var $link = $(this),
|
422 |
-
$tr = $link.closest('tr'),
|
423 |
-
$toggle = $link.find('.woocommerce-input-toggle');
|
424 |
-
$.ajax({
|
425 |
-
url: wooccm_field.ajax_url,
|
426 |
-
data: {
|
427 |
-
action: 'wooccm_toggle_field_attribute',
|
428 |
-
nonce: wooccm_field.nonce,
|
429 |
-
field_attr: $(this).data('field_attr'),
|
430 |
-
field_id: $tr.data('field_id')
|
431 |
-
},
|
432 |
-
dataType: 'json',
|
433 |
-
type: 'POST',
|
434 |
-
beforeSend: function (response) {
|
435 |
-
$toggle.addClass('woocommerce-input-toggle--loading');
|
436 |
-
},
|
437 |
-
success: function (response) {
|
438 |
-
|
439 |
-
if (true === response.data) {
|
440 |
-
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
441 |
-
$toggle.addClass('woocommerce-input-toggle--enabled');
|
442 |
-
$toggle.removeClass('woocommerce-input-toggle--loading');
|
443 |
-
} else if (true !== response.data) {
|
444 |
-
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
445 |
-
$toggle.addClass('woocommerce-input-toggle--disabled');
|
446 |
-
$toggle.removeClass('woocommerce-input-toggle--loading');
|
447 |
-
} //else if ('needs_setup' === response.data) {
|
448 |
-
//window.location.href = $link.attr('href');
|
449 |
-
//}
|
450 |
-
}
|
451 |
-
|
452 |
-
});
|
453 |
-
return false;
|
454 |
-
});
|
455 |
-
$(document).on('change', '.wooccm-field-change-attribute', function (e) {
|
456 |
-
e.preventDefault();
|
457 |
-
var $change = $(this),
|
458 |
-
$tr = $change.closest('tr');
|
459 |
-
$.ajax({
|
460 |
-
url: wooccm_field.ajax_url,
|
461 |
-
data: {
|
462 |
-
action: 'wooccm_change_field_attribute',
|
463 |
-
nonce: wooccm_field.nonce,
|
464 |
-
field_attr: $change.data('field_attr'),
|
465 |
-
field_value: $change.val(),
|
466 |
-
field_id: $tr.data('field_id'),
|
467 |
-
},
|
468 |
-
dataType: 'json',
|
469 |
-
type: 'POST',
|
470 |
-
beforeSend: function (response) {
|
471 |
-
$change.prop('disabled', true);
|
472 |
-
},
|
473 |
-
success: function (response) {
|
474 |
-
console.log(response.data);
|
475 |
-
},
|
476 |
-
complete: function (response) {
|
477 |
-
$change.prop('disabled', false);
|
478 |
-
},
|
479 |
-
});
|
480 |
-
return false;
|
481 |
-
});
|
482 |
})(jQuery);
|
1 |
+
(function ($) {
|
2 |
+
|
3 |
+
var count = 0,
|
4 |
+
timer;
|
5 |
+
|
6 |
+
var is_blocked = function ($node) {
|
7 |
+
return $node.is('.processing') || $node.parents('.processing').length;
|
8 |
+
};
|
9 |
+
var block = function () {
|
10 |
+
$('#wooccm_modal').addClass('processing');
|
11 |
+
};
|
12 |
+
var unblock = function () {
|
13 |
+
$('#wooccm_modal').removeClass('processing');
|
14 |
+
};
|
15 |
+
|
16 |
+
_.mixin({
|
17 |
+
sortOptions: function (object) {
|
18 |
+
return _.sortBy(object, function (o) {
|
19 |
+
return o.order;
|
20 |
+
});
|
21 |
+
}
|
22 |
+
});
|
23 |
+
var FieldViewTabs = Backbone.View.extend({
|
24 |
+
templates: {},
|
25 |
+
initialize: function () {
|
26 |
+
this.templates.window = wp.template('wooccm-modal-tabs');
|
27 |
+
},
|
28 |
+
render: function () {
|
29 |
+
this.model.attributes.panel = 'general';
|
30 |
+
this.$el.html(this.templates.window(this.model.attributes));
|
31 |
+
//this.$el.trigger('wooccm-tab-panels');
|
32 |
+
}
|
33 |
+
});
|
34 |
+
var FieldViewPanels = Backbone.View.extend({
|
35 |
+
templates: {},
|
36 |
+
initialize: function () {
|
37 |
+
this.templates.window = wp.template('wooccm-modal-panels');
|
38 |
+
},
|
39 |
+
render: function () {
|
40 |
+
this.$el.html(this.templates.window(this.model.attributes));
|
41 |
+
this.$el.trigger('wooccm-enhanced-options');
|
42 |
+
this.$el.trigger('wooccm-enhanced-select');
|
43 |
+
this.$el.trigger('init_tooltips');
|
44 |
+
}
|
45 |
+
});
|
46 |
+
var FieldViewInfo = Backbone.View.extend({
|
47 |
+
templates: {},
|
48 |
+
initialize: function () {
|
49 |
+
this.templates.window = wp.template('wooccm-modal-info');
|
50 |
+
},
|
51 |
+
render: function () {
|
52 |
+
this.$el.html(this.templates.window(this.model.attributes));
|
53 |
+
this.$el.trigger('wooccm-enhanced-select');
|
54 |
+
this.$el.trigger('init_tooltips');
|
55 |
+
}
|
56 |
+
});
|
57 |
+
var FieldView = Backbone.View.extend({
|
58 |
+
events: {
|
59 |
+
'change input': 'enableSave',
|
60 |
+
'change textarea': 'enableSave',
|
61 |
+
'change select': 'enableSave',
|
62 |
+
'click .media-modal-backdrop': 'close',
|
63 |
+
'click .media-modal-close': 'close',
|
64 |
+
'click .media-modal-prev': 'edit',
|
65 |
+
'click .media-modal-next': 'edit',
|
66 |
+
'click .media-modal-tab': 'tab',
|
67 |
+
'change .media-modal-parent': 'parent',
|
68 |
+
'change .media-modal-render-tabs': 'renderTabs',
|
69 |
+
'change .media-modal-render-panels': 'renderPanels',
|
70 |
+
'change .media-modal-render-info': 'renderInfo',
|
71 |
+
'submit .media-modal-form': 'submit',
|
72 |
+
},
|
73 |
+
templates: {},
|
74 |
+
initialize: function () {
|
75 |
+
_.bindAll(this, 'tab', 'open', 'edit', 'parent', 'load', 'render', 'close', 'submit');
|
76 |
+
this.init();
|
77 |
+
this.open();
|
78 |
+
},
|
79 |
+
init: function () {
|
80 |
+
this.templates.window = wp.template('wooccm-modal-main');
|
81 |
+
},
|
82 |
+
assign: function (view, selector) {
|
83 |
+
view.setElement(this.$(selector)).render();
|
84 |
+
},
|
85 |
+
render: function () {
|
86 |
+
var modal = this;
|
87 |
+
modal.$el.html(modal.templates.window(modal.model.attributes));
|
88 |
+
this.tabs = new FieldViewTabs({model: modal.model});
|
89 |
+
this.panels = new FieldViewPanels({model: modal.model});
|
90 |
+
this.info = new FieldViewInfo({model: modal.model});
|
91 |
+
this.assign(this.tabs, '#wooccm-modal-tabs');
|
92 |
+
this.assign(this.panels, '#wooccm-modal-panels');
|
93 |
+
this.assign(this.info, '#wooccm-modal-info');
|
94 |
+
},
|
95 |
+
load: function () {
|
96 |
+
|
97 |
+
var modal = this;
|
98 |
+
|
99 |
+
block();
|
100 |
+
|
101 |
+
$.ajax({
|
102 |
+
url: wooccm_field.ajax_url,
|
103 |
+
data: {
|
104 |
+
action: 'wooccm_load_field',
|
105 |
+
nonce: wooccm_field.nonce,
|
106 |
+
field_id: this.model.attributes.id
|
107 |
+
},
|
108 |
+
dataType: 'json',
|
109 |
+
type: 'POST',
|
110 |
+
beforeSend: function () {
|
111 |
+
},
|
112 |
+
complete: function () {
|
113 |
+
unblock();
|
114 |
+
},
|
115 |
+
error: function () {
|
116 |
+
alert('Error!');
|
117 |
+
},
|
118 |
+
success: function (response) {
|
119 |
+
if (response.success) {
|
120 |
+
modal.model.set(response.data);
|
121 |
+
modal.render();
|
122 |
+
} else {
|
123 |
+
alert(response.data);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
});
|
127 |
+
},
|
128 |
+
edit: function (e) {
|
129 |
+
e.preventDefault();
|
130 |
+
var modal = this,
|
131 |
+
$button = $(e.target),
|
132 |
+
field_count = parseInt($('.wc_gateways tr[data-field_id]').length),
|
133 |
+
order = parseInt(modal.model.get('order'));
|
134 |
+
count++;
|
135 |
+
if (timer) {
|
136 |
+
clearTimeout(timer);
|
137 |
+
}
|
138 |
+
|
139 |
+
timer = setTimeout(function () {
|
140 |
+
|
141 |
+
if ($button.hasClass('media-modal-next')) {
|
142 |
+
order = Math.min(order + count, field_count);
|
143 |
+
} else {
|
144 |
+
order = Math.max(order - count, 1);
|
145 |
+
}
|
146 |
+
|
147 |
+
modal.model.set({
|
148 |
+
id: parseInt($('.wc_gateways tr[data-field_order=' + order + ']').data('field_id'))
|
149 |
+
});
|
150 |
+
count = 0;
|
151 |
+
modal.load();
|
152 |
+
}, 300);
|
153 |
+
},
|
154 |
+
open: function (e) {
|
155 |
+
$('body').addClass('modal-open').append(this.$el);
|
156 |
+
if (this.model.attributes.id == undefined) {
|
157 |
+
_.delay(function () {
|
158 |
+
unblock();
|
159 |
+
}, 100);
|
160 |
+
return;
|
161 |
+
}
|
162 |
+
this.load();
|
163 |
+
},
|
164 |
+
updateModel: function (e) {
|
165 |
+
e.preventDefault();
|
166 |
+
|
167 |
+
var $field = $(e.target),
|
168 |
+
name = $field.attr('name'),
|
169 |
+
value = $field.val();
|
170 |
+
|
171 |
+
if (e.target.type === 'checkbox') {
|
172 |
+
value = $field.prop('checked') === true ? 1 : 0;
|
173 |
+
}
|
174 |
+
|
175 |
+
this.model.attributes[name] = value;
|
176 |
+
this.model.changed[name] = value;
|
177 |
+
},
|
178 |
+
tab: function (e) {
|
179 |
+
e.preventDefault();
|
180 |
+
|
181 |
+
var modal = this,
|
182 |
+
$modal = modal.$el.find('#wooccm_modal'),
|
183 |
+
$tab = $(e.currentTarget),
|
184 |
+
$tabs = $modal.find('ul.wc-tabs'),
|
185 |
+
panel = $tab.find('a').attr('href').replace('#', '');
|
186 |
+
|
187 |
+
$tabs.find('.active').removeClass('active');
|
188 |
+
$tab.addClass('active');
|
189 |
+
|
190 |
+
this.model.attributes['panel'] = panel;
|
191 |
+
this.model.changed['panel'] = panel;
|
192 |
+
|
193 |
+
this.renderPanels(e);
|
194 |
+
},
|
195 |
+
renderTabs: function (e) {
|
196 |
+
this.renderPanels(e);
|
197 |
+
this.tabs.render();
|
198 |
+
},
|
199 |
+
renderPanels: function (e) {
|
200 |
+
this.updateModel(e);
|
201 |
+
this.panels.render();
|
202 |
+
},
|
203 |
+
renderInfo: function () {
|
204 |
+
this.info.render();
|
205 |
+
},
|
206 |
+
close: function (e) {
|
207 |
+
e.preventDefault();
|
208 |
+
this.undelegateEvents();
|
209 |
+
$(document).off('focusin');
|
210 |
+
$('body').removeClass('modal-open');
|
211 |
+
this.remove();
|
212 |
+
},
|
213 |
+
parent: function (e) {
|
214 |
+
e.preventDefault();
|
215 |
+
var modal = this,
|
216 |
+
$modal = modal.$el.find('#wooccm_modal'),
|
217 |
+
$details = $modal.find('.attachment-details');
|
218 |
+
this.updateModel(e);
|
219 |
+
$.ajax({
|
220 |
+
url: wooccm_field.ajax_url,
|
221 |
+
data: {
|
222 |
+
action: 'wooccm_load_parent',
|
223 |
+
nonce: wooccm_field.nonce,
|
224 |
+
conditional_parent_key: modal.model.attributes.conditional_parent_key
|
225 |
+
},
|
226 |
+
dataType: 'json',
|
227 |
+
type: 'POST',
|
228 |
+
beforeSend: function () {
|
229 |
+
modal.disableSave();
|
230 |
+
$details.addClass('save-waiting');
|
231 |
+
},
|
232 |
+
complete: function () {
|
233 |
+
$details.addClass('save-complete');
|
234 |
+
$details.removeClass('save-waiting');
|
235 |
+
modal.enableSave();
|
236 |
+
},
|
237 |
+
error: function () {
|
238 |
+
alert('Error!');
|
239 |
+
},
|
240 |
+
success: function (response) {
|
241 |
+
if (response.success) {
|
242 |
+
modal.model.attributes['parent'] = response.data;
|
243 |
+
modal.model.changed['parent'] = response.data;
|
244 |
+
modal.renderInfo();
|
245 |
+
} else {
|
246 |
+
alert(response.data);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
});
|
250 |
+
return false;
|
251 |
+
},
|
252 |
+
reload: function (e) {
|
253 |
+
if (this.$el.find('#wooccm_modal').hasClass('reload')) {
|
254 |
+
location.reload();
|
255 |
+
return;
|
256 |
+
}
|
257 |
+
this.remove();
|
258 |
+
return;
|
259 |
+
},
|
260 |
+
close: function (e) {
|
261 |
+
e.preventDefault();
|
262 |
+
this.undelegateEvents();
|
263 |
+
$(document).off('focusin');
|
264 |
+
$('body').removeClass('modal-open');
|
265 |
+
this.reload(e);
|
266 |
+
return;
|
267 |
+
},
|
268 |
+
enableSave: function (e) {
|
269 |
+
$('.media-modal-submit').removeProp('disabled');
|
270 |
+
},
|
271 |
+
disableSave: function (e) {
|
272 |
+
$('.media-modal-submit').prop('disabled', true);
|
273 |
+
},
|
274 |
+
submit: function (e) {
|
275 |
+
e.preventDefault();
|
276 |
+
var modal = this,
|
277 |
+
$modal = modal.$el.find('#wooccm_modal'),
|
278 |
+
$details = $modal.find('.attachment-details');
|
279 |
+
|
280 |
+
$.ajax({
|
281 |
+
url: wooccm_field.ajax_url,
|
282 |
+
data: {
|
283 |
+
action: 'wooccm_save_field',
|
284 |
+
nonce: wooccm_field.nonce,
|
285 |
+
field_id: modal.model.attributes.id,
|
286 |
+
field_data: $('form', this.$el).serialize()
|
287 |
+
},
|
288 |
+
dataType: 'json',
|
289 |
+
type: 'POST',
|
290 |
+
beforeSend: function () {
|
291 |
+
$('.media-modal-submit').prop('disabled', true);
|
292 |
+
$details.addClass('save-waiting');
|
293 |
+
block();
|
294 |
+
},
|
295 |
+
complete: function () {
|
296 |
+
$details.addClass('save-complete');
|
297 |
+
$details.removeClass('save-waiting');
|
298 |
+
unblock();
|
299 |
+
},
|
300 |
+
error: function () {
|
301 |
+
alert('Error!');
|
302 |
+
},
|
303 |
+
success: function (response) {
|
304 |
+
if (response.success) {
|
305 |
+
|
306 |
+
if (modal.model.attributes.id == undefined) {
|
307 |
+
$modal.addClass('reload');
|
308 |
+
modal.close(e);
|
309 |
+
}
|
310 |
+
|
311 |
+
//re-render dont load select2 saved options
|
312 |
+
modal.model.set(response.data);
|
313 |
+
//$modal.addClass('reload');
|
314 |
+
|
315 |
+
} else {
|
316 |
+
alert(response.data);
|
317 |
+
}
|
318 |
+
}
|
319 |
+
});
|
320 |
+
return false;
|
321 |
+
}
|
322 |
+
});
|
323 |
+
var FieldModel = Backbone.Model.extend({
|
324 |
+
defaults: wooccm_field.args
|
325 |
+
});
|
326 |
+
var FieldModal = Backbone.View.extend({
|
327 |
+
initialize: function (e) {
|
328 |
+
|
329 |
+
var $button = $(e.target),
|
330 |
+
field_id = $button.closest('[data-field_id]').data('field_id');
|
331 |
+
var model = new FieldModel();
|
332 |
+
model.set({
|
333 |
+
id: field_id
|
334 |
+
});
|
335 |
+
new FieldView({
|
336 |
+
model: model
|
337 |
+
}).render();
|
338 |
+
},
|
339 |
+
});
|
340 |
+
$('#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add').on('click', function (e) {
|
341 |
+
e.preventDefault();
|
342 |
+
new FieldModal(e);
|
343 |
+
});
|
344 |
+
$('#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset').on('click', function (e) {
|
345 |
+
e.preventDefault();
|
346 |
+
var $button = $(e.target);
|
347 |
+
var c = confirm(wooccm_field.message.reset);
|
348 |
+
if (!c) {
|
349 |
+
return false;
|
350 |
+
}
|
351 |
+
|
352 |
+
$.ajax({
|
353 |
+
url: wooccm_field.ajax_url,
|
354 |
+
data: {
|
355 |
+
action: 'wooccm_reset_fields',
|
356 |
+
nonce: wooccm_field.nonce
|
357 |
+
},
|
358 |
+
dataType: 'json',
|
359 |
+
type: 'POST',
|
360 |
+
beforeSend: function () {
|
361 |
+
},
|
362 |
+
complete: function () {
|
363 |
+
},
|
364 |
+
error: function () {
|
365 |
+
alert('Error!');
|
366 |
+
},
|
367 |
+
success: function (response) {
|
368 |
+
if (response.success) {
|
369 |
+
|
370 |
+
location.reload();
|
371 |
+
} else {
|
372 |
+
alert(response.data);
|
373 |
+
}
|
374 |
+
}
|
375 |
+
});
|
376 |
+
return false;
|
377 |
+
});
|
378 |
+
$('.wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit').on('click', function (e) {
|
379 |
+
e.preventDefault();
|
380 |
+
new FieldModal(e);
|
381 |
+
});
|
382 |
+
$('.wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete').on('click', function (e) {
|
383 |
+
e.preventDefault();
|
384 |
+
var $button = $(e.target),
|
385 |
+
$field = $button.closest('[data-field_id]'),
|
386 |
+
field_id = $field.data('field_id');
|
387 |
+
var c = confirm(wooccm_field.message.remove);
|
388 |
+
if (!c) {
|
389 |
+
return false;
|
390 |
+
}
|
391 |
+
|
392 |
+
$.ajax({
|
393 |
+
url: wooccm_field.ajax_url,
|
394 |
+
data: {
|
395 |
+
action: 'wooccm_delete_field',
|
396 |
+
nonce: wooccm_field.nonce,
|
397 |
+
field_id: field_id,
|
398 |
+
},
|
399 |
+
dataType: 'json',
|
400 |
+
type: 'POST',
|
401 |
+
beforeSend: function () {
|
402 |
+
},
|
403 |
+
complete: function () {
|
404 |
+
},
|
405 |
+
error: function () {
|
406 |
+
alert('Error!');
|
407 |
+
},
|
408 |
+
success: function (response) {
|
409 |
+
if (response.success) {
|
410 |
+
|
411 |
+
$field.remove();
|
412 |
+
} else {
|
413 |
+
alert(response.data);
|
414 |
+
}
|
415 |
+
}
|
416 |
+
});
|
417 |
+
return false;
|
418 |
+
});
|
419 |
+
$(document).on('click', '.wooccm-field-toggle-attribute', function (e) {
|
420 |
+
e.preventDefault();
|
421 |
+
var $link = $(this),
|
422 |
+
$tr = $link.closest('tr'),
|
423 |
+
$toggle = $link.find('.woocommerce-input-toggle');
|
424 |
+
$.ajax({
|
425 |
+
url: wooccm_field.ajax_url,
|
426 |
+
data: {
|
427 |
+
action: 'wooccm_toggle_field_attribute',
|
428 |
+
nonce: wooccm_field.nonce,
|
429 |
+
field_attr: $(this).data('field_attr'),
|
430 |
+
field_id: $tr.data('field_id')
|
431 |
+
},
|
432 |
+
dataType: 'json',
|
433 |
+
type: 'POST',
|
434 |
+
beforeSend: function (response) {
|
435 |
+
$toggle.addClass('woocommerce-input-toggle--loading');
|
436 |
+
},
|
437 |
+
success: function (response) {
|
438 |
+
|
439 |
+
if (true === response.data) {
|
440 |
+
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
441 |
+
$toggle.addClass('woocommerce-input-toggle--enabled');
|
442 |
+
$toggle.removeClass('woocommerce-input-toggle--loading');
|
443 |
+
} else if (true !== response.data) {
|
444 |
+
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
445 |
+
$toggle.addClass('woocommerce-input-toggle--disabled');
|
446 |
+
$toggle.removeClass('woocommerce-input-toggle--loading');
|
447 |
+
} //else if ('needs_setup' === response.data) {
|
448 |
+
//window.location.href = $link.attr('href');
|
449 |
+
//}
|
450 |
+
}
|
451 |
+
|
452 |
+
});
|
453 |
+
return false;
|
454 |
+
});
|
455 |
+
$(document).on('change', '.wooccm-field-change-attribute', function (e) {
|
456 |
+
e.preventDefault();
|
457 |
+
var $change = $(this),
|
458 |
+
$tr = $change.closest('tr');
|
459 |
+
$.ajax({
|
460 |
+
url: wooccm_field.ajax_url,
|
461 |
+
data: {
|
462 |
+
action: 'wooccm_change_field_attribute',
|
463 |
+
nonce: wooccm_field.nonce,
|
464 |
+
field_attr: $change.data('field_attr'),
|
465 |
+
field_value: $change.val(),
|
466 |
+
field_id: $tr.data('field_id'),
|
467 |
+
},
|
468 |
+
dataType: 'json',
|
469 |
+
type: 'POST',
|
470 |
+
beforeSend: function (response) {
|
471 |
+
$change.prop('disabled', true);
|
472 |
+
},
|
473 |
+
success: function (response) {
|
474 |
+
console.log(response.data);
|
475 |
+
},
|
476 |
+
complete: function (response) {
|
477 |
+
$change.prop('disabled', false);
|
478 |
+
},
|
479 |
+
});
|
480 |
+
return false;
|
481 |
+
});
|
482 |
})(jQuery);
|
assets/backend/js/wooccm-admin.js
CHANGED
@@ -1,279 +1,279 @@
|
|
1 |
-
(function ($) {
|
2 |
-
|
3 |
-
$('.wooccm-premium-field').closest('tr').addClass('wooccm-premium');
|
4 |
-
|
5 |
-
function date_picker_select(datepicker) {
|
6 |
-
var option = $(datepicker).next().is('.hasDatepicker') ? 'minDate' : 'maxDate',
|
7 |
-
otherDateField = 'minDate' === option ? $(datepicker).next() : $(datepicker).prev(),
|
8 |
-
date = $(datepicker).datepicker('getDate');
|
9 |
-
|
10 |
-
$(otherDateField).datepicker('option', option, date);
|
11 |
-
$(datepicker).change();
|
12 |
-
}
|
13 |
-
|
14 |
-
function getEnhancedSelectFormatString() {
|
15 |
-
return {
|
16 |
-
'language': {
|
17 |
-
errorLoading: function () {
|
18 |
-
// Workaround for https://github.com/select2/select2/issues/4355 instead of i18n_ajax_error.
|
19 |
-
return wc_enhanced_select_params.i18n_searching;
|
20 |
-
},
|
21 |
-
inputTooLong: function (args) {
|
22 |
-
var overChars = args.input.length - args.maximum;
|
23 |
-
|
24 |
-
if (1 === overChars) {
|
25 |
-
return wc_enhanced_select_params.i18n_input_too_long_1;
|
26 |
-
}
|
27 |
-
|
28 |
-
return wc_enhanced_select_params.i18n_input_too_long_n.replace('%qty%', overChars);
|
29 |
-
},
|
30 |
-
inputTooShort: function (args) {
|
31 |
-
var remainingChars = args.minimum - args.input.length;
|
32 |
-
|
33 |
-
if (1 === remainingChars) {
|
34 |
-
return wc_enhanced_select_params.i18n_input_too_short_1;
|
35 |
-
}
|
36 |
-
|
37 |
-
return wc_enhanced_select_params.i18n_input_too_short_n.replace('%qty%', remainingChars);
|
38 |
-
},
|
39 |
-
loadingMore: function () {
|
40 |
-
return wc_enhanced_select_params.i18n_load_more;
|
41 |
-
},
|
42 |
-
maximumSelected: function (args) {
|
43 |
-
if (args.maximum === 1) {
|
44 |
-
return wc_enhanced_select_params.i18n_selection_too_long_1;
|
45 |
-
}
|
46 |
-
|
47 |
-
return wc_enhanced_select_params.i18n_selection_too_long_n.replace('%qty%', args.maximum);
|
48 |
-
},
|
49 |
-
noResults: function () {
|
50 |
-
return wc_enhanced_select_params.i18n_no_matches;
|
51 |
-
},
|
52 |
-
searching: function () {
|
53 |
-
return wc_enhanced_select_params.i18n_searching;
|
54 |
-
}
|
55 |
-
}
|
56 |
-
};
|
57 |
-
}
|
58 |
-
|
59 |
-
$(document).on('wooccm-enhanced-between-dates', function (e) {
|
60 |
-
|
61 |
-
$('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
|
62 |
-
|
63 |
-
$(this).find('input').datepicker({
|
64 |
-
defaultDate: '',
|
65 |
-
dateFormat: 'yy-mm-dd',
|
66 |
-
numberOfMonths: 1,
|
67 |
-
showButtonPanel: true,
|
68 |
-
onSelect: function () {
|
69 |
-
date_picker_select($(this));
|
70 |
-
}
|
71 |
-
});
|
72 |
-
|
73 |
-
$(this).find('input').each(function () {
|
74 |
-
date_picker_select($(this));
|
75 |
-
});
|
76 |
-
|
77 |
-
});
|
78 |
-
|
79 |
-
});
|
80 |
-
|
81 |
-
$(document).on('wooccm-enhanced-options', function (e) {
|
82 |
-
|
83 |
-
$('table.wc_gateways tbody').sortable({
|
84 |
-
items: 'tr',
|
85 |
-
cursor: 'move',
|
86 |
-
axis: 'y',
|
87 |
-
handle: 'td.sort',
|
88 |
-
scrollSensitivity: 40,
|
89 |
-
helper: function (event, ui) {
|
90 |
-
ui.children().each(function () {
|
91 |
-
$(this).width($(this).width());
|
92 |
-
});
|
93 |
-
ui.css('left', '0');
|
94 |
-
return ui;
|
95 |
-
},
|
96 |
-
start: function (event, ui) {
|
97 |
-
ui.item.css('background-color', '#f6f6f6');
|
98 |
-
},
|
99 |
-
stop: function (event, ui) {
|
100 |
-
ui.item.removeAttr('style');
|
101 |
-
ui.item.trigger('updateMoveButtons');
|
102 |
-
},
|
103 |
-
update: function (event, ui) {
|
104 |
-
$(this).find('tr').each(function (i, tr) {
|
105 |
-
$(tr).find('input.add-order').val(i).trigger('change');
|
106 |
-
});
|
107 |
-
}
|
108 |
-
});
|
109 |
-
|
110 |
-
$('.wooccm-enhanced-options').each(function () {
|
111 |
-
|
112 |
-
var $table = $(this),
|
113 |
-
$add = $table.find('.add-option'),
|
114 |
-
$remove = $table.find('.remove-options');
|
115 |
-
|
116 |
-
$add.on('click', function (e) {
|
117 |
-
|
118 |
-
var $tr = $table.find('tbody > tr'),
|
119 |
-
id = $tr.length,
|
120 |
-
tr = $tr.first().clone().html().replace(/options\[([0-9]+)\]/g, 'options[' + id + ']').replace('disabled="disabled"', '').replace('checked="checked"', '').replace('<input value="0"', '<input value="' + id + '"').replace('<input value="0"', '<input value="' + id + '"');
|
121 |
-
|
122 |
-
$tr.last().after($('<tr>' + tr + '</tr>')).find('input').trigger('change');
|
123 |
-
|
124 |
-
$remove.removeProp('disabled');
|
125 |
-
|
126 |
-
});
|
127 |
-
|
128 |
-
$remove.on('click', function (e) {
|
129 |
-
|
130 |
-
$table.find('tr > td.check-column input:checked').closest('tr').remove();
|
131 |
-
|
132 |
-
var $tr = $table.find('tbody > tr');
|
133 |
-
|
134 |
-
if ($tr.length < 2) {
|
135 |
-
$(this).prop('disabled', true);
|
136 |
-
}
|
137 |
-
});
|
138 |
-
|
139 |
-
});
|
140 |
-
|
141 |
-
});
|
142 |
-
|
143 |
-
$(document).on('wooccm-enhanced-select', function (e) {
|
144 |
-
|
145 |
-
$('.wooccm-enhanced-select').filter(':not(.enhanced)').each(function () {
|
146 |
-
var select2_args = $.extend({
|
147 |
-
minimumResultsForSearch: 10,
|
148 |
-
allowClear: $(this).data('allow_clear') ? true : false,
|
149 |
-
placeholder: $(this).data('placeholder')
|
150 |
-
}, getEnhancedSelectFormatString());
|
151 |
-
|
152 |
-
$(this).selectWoo(select2_args).addClass('enhanced');
|
153 |
-
});
|
154 |
-
|
155 |
-
$('.wooccm-product-search').filter(':not(.enhanced)').each(function () {
|
156 |
-
|
157 |
-
var select2_args = {
|
158 |
-
allowClear: $(this).data('allow_clear') ? true : false,
|
159 |
-
placeholder: $(this).data('placeholder'),
|
160 |
-
minimumInputLength: $(this).data('minimum_input_length') ? $(this).data('minimum_input_length') : '3',
|
161 |
-
escapeMarkup: function (m) {
|
162 |
-
return m;
|
163 |
-
},
|
164 |
-
ajax: {
|
165 |
-
url: wc_enhanced_select_params.ajax_url,
|
166 |
-
dataType: 'json',
|
167 |
-
delay: 250,
|
168 |
-
data: function (params) {
|
169 |
-
return {
|
170 |
-
term: params.term,
|
171 |
-
action: $(this).data('action') || 'wooccm_select_search_products',
|
172 |
-
//nonce: wooccm_admin.nonce,
|
173 |
-
security: wc_enhanced_select_params.search_products_nonce,
|
174 |
-
selected: $(this).select2('val') || 0,
|
175 |
-
exclude: $(this).data('exclude'),
|
176 |
-
include: $(this).data('include'),
|
177 |
-
limit: $(this).data('limit'),
|
178 |
-
display_stock: $(this).data('display_stock')
|
179 |
-
};
|
180 |
-
},
|
181 |
-
processResults: function (data) {
|
182 |
-
var terms = [];
|
183 |
-
if (data) {
|
184 |
-
$.each(data, function (id, text) {
|
185 |
-
terms.push({id: id, text: text});
|
186 |
-
});
|
187 |
-
}
|
188 |
-
return {
|
189 |
-
results: terms
|
190 |
-
};
|
191 |
-
},
|
192 |
-
cache: true
|
193 |
-
}
|
194 |
-
};
|
195 |
-
|
196 |
-
select2_args = $.extend(select2_args, getEnhancedSelectFormatString());
|
197 |
-
|
198 |
-
$(this).selectWoo(select2_args).addClass('enhanced');
|
199 |
-
|
200 |
-
if ($(this).data('sortable')) {
|
201 |
-
var $select = $(this);
|
202 |
-
var $list = $(this).next('.select2-container').find('ul.select2-selection__rendered');
|
203 |
-
|
204 |
-
$list.sortable({
|
205 |
-
placeholder: 'ui-state-highlight select2-selection__choice',
|
206 |
-
forcePlaceholderSize: true,
|
207 |
-
items: 'li:not(.select2-search__field)',
|
208 |
-
tolerance: 'pointer',
|
209 |
-
stop: function () {
|
210 |
-
$($list.find('.select2-selection__choice').get().reverse()).each(function () {
|
211 |
-
var id = $(this).data('data').id;
|
212 |
-
var option = $select.find('option[value="' + id + '"]')[0];
|
213 |
-
$select.prepend(option);
|
214 |
-
});
|
215 |
-
}
|
216 |
-
});
|
217 |
-
// Keep multiselects ordered alphabetically if they are not sortable.
|
218 |
-
} else if ($(this).prop('multiple')) {
|
219 |
-
$(this).on('change', function () {
|
220 |
-
var $children = $(this).children();
|
221 |
-
$children.sort(function (a, b) {
|
222 |
-
var atext = a.text.toLowerCase();
|
223 |
-
var btext = b.text.toLowerCase();
|
224 |
-
|
225 |
-
if (atext > btext) {
|
226 |
-
return 1;
|
227 |
-
}
|
228 |
-
if (atext < btext) {
|
229 |
-
return -1;
|
230 |
-
}
|
231 |
-
return 0;
|
232 |
-
});
|
233 |
-
$(this).html($children);
|
234 |
-
});
|
235 |
-
}
|
236 |
-
});
|
237 |
-
|
238 |
-
});
|
239 |
-
|
240 |
-
$('.wooccm-enhanced-search').filter(':not(.enhanced)').each(function () {
|
241 |
-
|
242 |
-
var select2_args = {
|
243 |
-
allowClear: $(this).data('allow_clear') ? true : false,
|
244 |
-
placeholder: $(this).data('placeholder'),
|
245 |
-
minimumInputLength: $(this).data('minimum_input_length') || '3',
|
246 |
-
escapeMarkup: function (m) {
|
247 |
-
return m;
|
248 |
-
},
|
249 |
-
ajax: {
|
250 |
-
url: wooccm_admin.ajax_url,
|
251 |
-
dataType: 'json',
|
252 |
-
cache: true,
|
253 |
-
delay: 250,
|
254 |
-
data: function (params) {
|
255 |
-
return {
|
256 |
-
term: params.term,
|
257 |
-
key: $(this).data('key'),
|
258 |
-
action: 'wooccm_search_field',
|
259 |
-
nonce: wooccm_admin.nonce,
|
260 |
-
};
|
261 |
-
},
|
262 |
-
processResults: function (data, params) {
|
263 |
-
var terms = [];
|
264 |
-
if (data) {
|
265 |
-
$.each(data, function (id, text) {
|
266 |
-
terms.push({id: id, text: text});
|
267 |
-
});
|
268 |
-
}
|
269 |
-
return {results: terms};
|
270 |
-
}
|
271 |
-
}
|
272 |
-
};
|
273 |
-
|
274 |
-
select2_args = $.extend(select2_args, getEnhancedSelectFormatString());
|
275 |
-
|
276 |
-
$(this).select2(select2_args).addClass('enhanced');
|
277 |
-
});
|
278 |
-
|
279 |
})(jQuery);
|
1 |
+
(function ($) {
|
2 |
+
|
3 |
+
$('.wooccm-premium-field').closest('tr').addClass('wooccm-premium');
|
4 |
+
|
5 |
+
function date_picker_select(datepicker) {
|
6 |
+
var option = $(datepicker).next().is('.hasDatepicker') ? 'minDate' : 'maxDate',
|
7 |
+
otherDateField = 'minDate' === option ? $(datepicker).next() : $(datepicker).prev(),
|
8 |
+
date = $(datepicker).datepicker('getDate');
|
9 |
+
|
10 |
+
$(otherDateField).datepicker('option', option, date);
|
11 |
+
$(datepicker).change();
|
12 |
+
}
|
13 |
+
|
14 |
+
function getEnhancedSelectFormatString() {
|
15 |
+
return {
|
16 |
+
'language': {
|
17 |
+
errorLoading: function () {
|
18 |
+
// Workaround for https://github.com/select2/select2/issues/4355 instead of i18n_ajax_error.
|
19 |
+
return wc_enhanced_select_params.i18n_searching;
|
20 |
+
},
|
21 |
+
inputTooLong: function (args) {
|
22 |
+
var overChars = args.input.length - args.maximum;
|
23 |
+
|
24 |
+
if (1 === overChars) {
|
25 |
+
return wc_enhanced_select_params.i18n_input_too_long_1;
|
26 |
+
}
|
27 |
+
|
28 |
+
return wc_enhanced_select_params.i18n_input_too_long_n.replace('%qty%', overChars);
|
29 |
+
},
|
30 |
+
inputTooShort: function (args) {
|
31 |
+
var remainingChars = args.minimum - args.input.length;
|
32 |
+
|
33 |
+
if (1 === remainingChars) {
|
34 |
+
return wc_enhanced_select_params.i18n_input_too_short_1;
|
35 |
+
}
|
36 |
+
|
37 |
+
return wc_enhanced_select_params.i18n_input_too_short_n.replace('%qty%', remainingChars);
|
38 |
+
},
|
39 |
+
loadingMore: function () {
|
40 |
+
return wc_enhanced_select_params.i18n_load_more;
|
41 |
+
},
|
42 |
+
maximumSelected: function (args) {
|
43 |
+
if (args.maximum === 1) {
|
44 |
+
return wc_enhanced_select_params.i18n_selection_too_long_1;
|
45 |
+
}
|
46 |
+
|
47 |
+
return wc_enhanced_select_params.i18n_selection_too_long_n.replace('%qty%', args.maximum);
|
48 |
+
},
|
49 |
+
noResults: function () {
|
50 |
+
return wc_enhanced_select_params.i18n_no_matches;
|
51 |
+
},
|
52 |
+
searching: function () {
|
53 |
+
return wc_enhanced_select_params.i18n_searching;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
};
|
57 |
+
}
|
58 |
+
|
59 |
+
$(document).on('wooccm-enhanced-between-dates', function (e) {
|
60 |
+
|
61 |
+
$('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
|
62 |
+
|
63 |
+
$(this).find('input').datepicker({
|
64 |
+
defaultDate: '',
|
65 |
+
dateFormat: 'yy-mm-dd',
|
66 |
+
numberOfMonths: 1,
|
67 |
+
showButtonPanel: true,
|
68 |
+
onSelect: function () {
|
69 |
+
date_picker_select($(this));
|
70 |
+
}
|
71 |
+
});
|
72 |
+
|
73 |
+
$(this).find('input').each(function () {
|
74 |
+
date_picker_select($(this));
|
75 |
+
});
|
76 |
+
|
77 |
+
});
|
78 |
+
|
79 |
+
});
|
80 |
+
|
81 |
+
$(document).on('wooccm-enhanced-options', function (e) {
|
82 |
+
|
83 |
+
$('table.wc_gateways tbody').sortable({
|
84 |
+
items: 'tr',
|
85 |
+
cursor: 'move',
|
86 |
+
axis: 'y',
|
87 |
+
handle: 'td.sort',
|
88 |
+
scrollSensitivity: 40,
|
89 |
+
helper: function (event, ui) {
|
90 |
+
ui.children().each(function () {
|
91 |
+
$(this).width($(this).width());
|
92 |
+
});
|
93 |
+
ui.css('left', '0');
|
94 |
+
return ui;
|
95 |
+
},
|
96 |
+
start: function (event, ui) {
|
97 |
+
ui.item.css('background-color', '#f6f6f6');
|
98 |
+
},
|
99 |
+
stop: function (event, ui) {
|
100 |
+
ui.item.removeAttr('style');
|
101 |
+
ui.item.trigger('updateMoveButtons');
|
102 |
+
},
|
103 |
+
update: function (event, ui) {
|
104 |
+
$(this).find('tr').each(function (i, tr) {
|
105 |
+
$(tr).find('input.add-order').val(i).trigger('change');
|
106 |
+
});
|
107 |
+
}
|
108 |
+
});
|
109 |
+
|
110 |
+
$('.wooccm-enhanced-options').each(function () {
|
111 |
+
|
112 |
+
var $table = $(this),
|
113 |
+
$add = $table.find('.add-option'),
|
114 |
+
$remove = $table.find('.remove-options');
|
115 |
+
|
116 |
+
$add.on('click', function (e) {
|
117 |
+
|
118 |
+
var $tr = $table.find('tbody > tr'),
|
119 |
+
id = $tr.length,
|
120 |
+
tr = $tr.first().clone().html().replace(/options\[([0-9]+)\]/g, 'options[' + id + ']').replace('disabled="disabled"', '').replace('checked="checked"', '').replace('<input value="0"', '<input value="' + id + '"').replace('<input value="0"', '<input value="' + id + '"');
|
121 |
+
|
122 |
+
$tr.last().after($('<tr>' + tr + '</tr>')).find('input').trigger('change');
|
123 |
+
|
124 |
+
$remove.removeProp('disabled');
|
125 |
+
|
126 |
+
});
|
127 |
+
|
128 |
+
$remove.on('click', function (e) {
|
129 |
+
|
130 |
+
$table.find('tr > td.check-column input:checked').closest('tr').remove();
|
131 |
+
|
132 |
+
var $tr = $table.find('tbody > tr');
|
133 |
+
|
134 |
+
if ($tr.length < 2) {
|
135 |
+
$(this).prop('disabled', true);
|
136 |
+
}
|
137 |
+
});
|
138 |
+
|
139 |
+
});
|
140 |
+
|
141 |
+
});
|
142 |
+
|
143 |
+
$(document).on('wooccm-enhanced-select', function (e) {
|
144 |
+
|
145 |
+
$('.wooccm-enhanced-select').filter(':not(.enhanced)').each(function () {
|
146 |
+
var select2_args = $.extend({
|
147 |
+
minimumResultsForSearch: 10,
|
148 |
+
allowClear: $(this).data('allow_clear') ? true : false,
|
149 |
+
placeholder: $(this).data('placeholder')
|
150 |
+
}, getEnhancedSelectFormatString());
|
151 |
+
|
152 |
+
$(this).selectWoo(select2_args).addClass('enhanced');
|
153 |
+
});
|
154 |
+
|
155 |
+
$('.wooccm-product-search').filter(':not(.enhanced)').each(function () {
|
156 |
+
|
157 |
+
var select2_args = {
|
158 |
+
allowClear: $(this).data('allow_clear') ? true : false,
|
159 |
+
placeholder: $(this).data('placeholder'),
|
160 |
+
minimumInputLength: $(this).data('minimum_input_length') ? $(this).data('minimum_input_length') : '3',
|
161 |
+
escapeMarkup: function (m) {
|
162 |
+
return m;
|
163 |
+
},
|
164 |
+
ajax: {
|
165 |
+
url: wc_enhanced_select_params.ajax_url,
|
166 |
+
dataType: 'json',
|
167 |
+
delay: 250,
|
168 |
+
data: function (params) {
|
169 |
+
return {
|
170 |
+
term: params.term,
|
171 |
+
action: $(this).data('action') || 'wooccm_select_search_products',
|
172 |
+
//nonce: wooccm_admin.nonce,
|
173 |
+
security: wc_enhanced_select_params.search_products_nonce,
|
174 |
+
selected: $(this).select2('val') || 0,
|
175 |
+
exclude: $(this).data('exclude'),
|
176 |
+
include: $(this).data('include'),
|
177 |
+
limit: $(this).data('limit'),
|
178 |
+
display_stock: $(this).data('display_stock')
|
179 |
+
};
|
180 |
+
},
|
181 |
+
processResults: function (data) {
|
182 |
+
var terms = [];
|
183 |
+
if (data) {
|
184 |
+
$.each(data, function (id, text) {
|
185 |
+
terms.push({id: id, text: text});
|
186 |
+
});
|
187 |
+
}
|
188 |
+
return {
|
189 |
+
results: terms
|
190 |
+
};
|
191 |
+
},
|
192 |
+
cache: true
|
193 |
+
}
|
194 |
+
};
|
195 |
+
|
196 |
+
select2_args = $.extend(select2_args, getEnhancedSelectFormatString());
|
197 |
+
|
198 |
+
$(this).selectWoo(select2_args).addClass('enhanced');
|
199 |
+
|
200 |
+
if ($(this).data('sortable')) {
|
201 |
+
var $select = $(this);
|
202 |
+
var $list = $(this).next('.select2-container').find('ul.select2-selection__rendered');
|
203 |
+
|
204 |
+
$list.sortable({
|
205 |
+
placeholder: 'ui-state-highlight select2-selection__choice',
|
206 |
+
forcePlaceholderSize: true,
|
207 |
+
items: 'li:not(.select2-search__field)',
|
208 |
+
tolerance: 'pointer',
|
209 |
+
stop: function () {
|
210 |
+
$($list.find('.select2-selection__choice').get().reverse()).each(function () {
|
211 |
+
var id = $(this).data('data').id;
|
212 |
+
var option = $select.find('option[value="' + id + '"]')[0];
|
213 |
+
$select.prepend(option);
|
214 |
+
});
|
215 |
+
}
|
216 |
+
});
|
217 |
+
// Keep multiselects ordered alphabetically if they are not sortable.
|
218 |
+
} else if ($(this).prop('multiple')) {
|
219 |
+
$(this).on('change', function () {
|
220 |
+
var $children = $(this).children();
|
221 |
+
$children.sort(function (a, b) {
|
222 |
+
var atext = a.text.toLowerCase();
|
223 |
+
var btext = b.text.toLowerCase();
|
224 |
+
|
225 |
+
if (atext > btext) {
|
226 |
+
return 1;
|
227 |
+
}
|
228 |
+
if (atext < btext) {
|
229 |
+
return -1;
|
230 |
+
}
|
231 |
+
return 0;
|
232 |
+
});
|
233 |
+
$(this).html($children);
|
234 |
+
});
|
235 |
+
}
|
236 |
+
});
|
237 |
+
|
238 |
+
});
|
239 |
+
|
240 |
+
$('.wooccm-enhanced-search').filter(':not(.enhanced)').each(function () {
|
241 |
+
|
242 |
+
var select2_args = {
|
243 |
+
allowClear: $(this).data('allow_clear') ? true : false,
|
244 |
+
placeholder: $(this).data('placeholder'),
|
245 |
+
minimumInputLength: $(this).data('minimum_input_length') || '3',
|
246 |
+
escapeMarkup: function (m) {
|
247 |
+
return m;
|
248 |
+
},
|
249 |
+
ajax: {
|
250 |
+
url: wooccm_admin.ajax_url,
|
251 |
+
dataType: 'json',
|
252 |
+
cache: true,
|
253 |
+
delay: 250,
|
254 |
+
data: function (params) {
|
255 |
+
return {
|
256 |
+
term: params.term,
|
257 |
+
key: $(this).data('key'),
|
258 |
+
action: 'wooccm_search_field',
|
259 |
+
nonce: wooccm_admin.nonce,
|
260 |
+
};
|
261 |
+
},
|
262 |
+
processResults: function (data, params) {
|
263 |
+
var terms = [];
|
264 |
+
if (data) {
|
265 |
+
$.each(data, function (id, text) {
|
266 |
+
terms.push({id: id, text: text});
|
267 |
+
});
|
268 |
+
}
|
269 |
+
return {results: terms};
|
270 |
+
}
|
271 |
+
}
|
272 |
+
};
|
273 |
+
|
274 |
+
select2_args = $.extend(select2_args, getEnhancedSelectFormatString());
|
275 |
+
|
276 |
+
$(this).select2(select2_args).addClass('enhanced');
|
277 |
+
});
|
278 |
+
|
279 |
})(jQuery);
|
assets/frontend/css/wooccm.css
CHANGED
@@ -1,121 +1,121 @@
|
|
1 |
-
.woocommerce form {
|
2 |
-
/* @media (min-width: 768px) {
|
3 |
-
.wooccm-field {
|
4 |
-
&.form-row-first {
|
5 |
-
width: 47.0588235294%;
|
6 |
-
float: left;
|
7 |
-
margin-right: 5.8823529412%;
|
8 |
-
clear: both;
|
9 |
-
}
|
10 |
-
&.form-row-last {
|
11 |
-
width: 45.4545454545%;
|
12 |
-
float: right;
|
13 |
-
margin-right: 0;
|
14 |
-
}
|
15 |
-
}
|
16 |
-
}*/
|
17 |
-
}
|
18 |
-
.woocommerce form .wooccm-clearfix:before,
|
19 |
-
.woocommerce form .wooccm-clearfix:after {
|
20 |
-
content: '';
|
21 |
-
display: table;
|
22 |
-
}
|
23 |
-
.woocommerce form .wooccm-clearfix:after {
|
24 |
-
clear: both;
|
25 |
-
}
|
26 |
-
.woocommerce form .wooccm-conditional-child {
|
27 |
-
display: none;
|
28 |
-
}
|
29 |
-
.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label {
|
30 |
-
display: inline-block;
|
31 |
-
}
|
32 |
-
.woocommerce form .wooccm-colorpicker-iris .iris-picker {
|
33 |
-
display: none;
|
34 |
-
}
|
35 |
-
.woocommerce form .wooccm-colorpicker-iris.active .iris-picker {
|
36 |
-
display: block;
|
37 |
-
}
|
38 |
-
.button.fileinput-button {
|
39 |
-
position: relative;
|
40 |
-
overflow: hidden!important;
|
41 |
-
}
|
42 |
-
.button.fileinput-button input {
|
43 |
-
position: absolute;
|
44 |
-
top: 0;
|
45 |
-
right: 0;
|
46 |
-
margin: 0;
|
47 |
-
opacity: 0;
|
48 |
-
-ms-filter: 'alpha(opacity=0)';
|
49 |
-
font-size: 200px;
|
50 |
-
direction: ltr;
|
51 |
-
cursor: pointer;
|
52 |
-
}
|
53 |
-
.wooccm-file-list {
|
54 |
-
margin: 0 -5px;
|
55 |
-
padding: 0;
|
56 |
-
display: flex;
|
57 |
-
flex-wrap: wrap;
|
58 |
-
align-items: center;
|
59 |
-
justify-content: start;
|
60 |
-
}
|
61 |
-
.wooccm-file-list .wooccm-file-file {
|
62 |
-
display: flex;
|
63 |
-
justify-content: center;
|
64 |
-
align-items: stretch;
|
65 |
-
box-sizing: border-box;
|
66 |
-
padding: 10px 5px 0 5px;
|
67 |
-
width: 25%;
|
68 |
-
position: relative;
|
69 |
-
}
|
70 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete {
|
71 |
-
z-index: 1;
|
72 |
-
position: absolute;
|
73 |
-
top: 2px;
|
74 |
-
right: -3px;
|
75 |
-
width: 16px;
|
76 |
-
height: 16px;
|
77 |
-
background-color: #222;
|
78 |
-
display: block;
|
79 |
-
line-height: 16px;
|
80 |
-
text-align: center;
|
81 |
-
color: #fefefe;
|
82 |
-
font-weight: 900;
|
83 |
-
border-radius: 50%;
|
84 |
-
font-size: 12px;
|
85 |
-
cursor: pointer;
|
86 |
-
font-family: code;
|
87 |
-
text-decoration: none!important;
|
88 |
-
}
|
89 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-container {
|
90 |
-
width: 100%;
|
91 |
-
overflow: hidden;
|
92 |
-
}
|
93 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container {
|
94 |
-
display: flex;
|
95 |
-
justify-content: center;
|
96 |
-
align-items: center;
|
97 |
-
overflow: hidden;
|
98 |
-
width: 100%;
|
99 |
-
padding-top: 100%;
|
100 |
-
position: relative;
|
101 |
-
background: #eee;
|
102 |
-
}
|
103 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container > img {
|
104 |
-
overflow: hidden;
|
105 |
-
object-fit: cover;
|
106 |
-
position: absolute;
|
107 |
-
top: 30%;
|
108 |
-
bottom: auto;
|
109 |
-
height: 40%;
|
110 |
-
opacity: 0.8;
|
111 |
-
}
|
112 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container > img.image {
|
113 |
-
top: 0;
|
114 |
-
bottom: 0;
|
115 |
-
left: 0;
|
116 |
-
right: 0;
|
117 |
-
max-height: 100%;
|
118 |
-
height: 100%;
|
119 |
-
width: 100%;
|
120 |
-
}
|
121 |
/*# sourceMappingURL=wooccm.css.map */
|
1 |
+
.woocommerce form {
|
2 |
+
/* @media (min-width: 768px) {
|
3 |
+
.wooccm-field {
|
4 |
+
&.form-row-first {
|
5 |
+
width: 47.0588235294%;
|
6 |
+
float: left;
|
7 |
+
margin-right: 5.8823529412%;
|
8 |
+
clear: both;
|
9 |
+
}
|
10 |
+
&.form-row-last {
|
11 |
+
width: 45.4545454545%;
|
12 |
+
float: right;
|
13 |
+
margin-right: 0;
|
14 |
+
}
|
15 |
+
}
|
16 |
+
}*/
|
17 |
+
}
|
18 |
+
.woocommerce form .wooccm-clearfix:before,
|
19 |
+
.woocommerce form .wooccm-clearfix:after {
|
20 |
+
content: '';
|
21 |
+
display: table;
|
22 |
+
}
|
23 |
+
.woocommerce form .wooccm-clearfix:after {
|
24 |
+
clear: both;
|
25 |
+
}
|
26 |
+
.woocommerce form .wooccm-conditional-child {
|
27 |
+
display: none;
|
28 |
+
}
|
29 |
+
.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label {
|
30 |
+
display: inline-block;
|
31 |
+
}
|
32 |
+
.woocommerce form .wooccm-colorpicker-iris .iris-picker {
|
33 |
+
display: none;
|
34 |
+
}
|
35 |
+
.woocommerce form .wooccm-colorpicker-iris.active .iris-picker {
|
36 |
+
display: block;
|
37 |
+
}
|
38 |
+
.button.fileinput-button {
|
39 |
+
position: relative;
|
40 |
+
overflow: hidden!important;
|
41 |
+
}
|
42 |
+
.button.fileinput-button input {
|
43 |
+
position: absolute;
|
44 |
+
top: 0;
|
45 |
+
right: 0;
|
46 |
+
margin: 0;
|
47 |
+
opacity: 0;
|
48 |
+
-ms-filter: 'alpha(opacity=0)';
|
49 |
+
font-size: 200px;
|
50 |
+
direction: ltr;
|
51 |
+
cursor: pointer;
|
52 |
+
}
|
53 |
+
.wooccm-file-list {
|
54 |
+
margin: 0 -5px;
|
55 |
+
padding: 0;
|
56 |
+
display: flex;
|
57 |
+
flex-wrap: wrap;
|
58 |
+
align-items: center;
|
59 |
+
justify-content: start;
|
60 |
+
}
|
61 |
+
.wooccm-file-list .wooccm-file-file {
|
62 |
+
display: flex;
|
63 |
+
justify-content: center;
|
64 |
+
align-items: stretch;
|
65 |
+
box-sizing: border-box;
|
66 |
+
padding: 10px 5px 0 5px;
|
67 |
+
width: 25%;
|
68 |
+
position: relative;
|
69 |
+
}
|
70 |
+
.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete {
|
71 |
+
z-index: 1;
|
72 |
+
position: absolute;
|
73 |
+
top: 2px;
|
74 |
+
right: -3px;
|
75 |
+
width: 16px;
|
76 |
+
height: 16px;
|
77 |
+
background-color: #222;
|
78 |
+
display: block;
|
79 |
+
line-height: 16px;
|
80 |
+
text-align: center;
|
81 |
+
color: #fefefe;
|
82 |
+
font-weight: 900;
|
83 |
+
border-radius: 50%;
|
84 |
+
font-size: 12px;
|
85 |
+
cursor: pointer;
|
86 |
+
font-family: code;
|
87 |
+
text-decoration: none!important;
|
88 |
+
}
|
89 |
+
.wooccm-file-list .wooccm-file-file .wooccm-file-list-container {
|
90 |
+
width: 100%;
|
91 |
+
overflow: hidden;
|
92 |
+
}
|
93 |
+
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container {
|
94 |
+
display: flex;
|
95 |
+
justify-content: center;
|
96 |
+
align-items: center;
|
97 |
+
overflow: hidden;
|
98 |
+
width: 100%;
|
99 |
+
padding-top: 100%;
|
100 |
+
position: relative;
|
101 |
+
background: #eee;
|
102 |
+
}
|
103 |
+
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container > img {
|
104 |
+
overflow: hidden;
|
105 |
+
object-fit: cover;
|
106 |
+
position: absolute;
|
107 |
+
top: 30%;
|
108 |
+
bottom: auto;
|
109 |
+
height: 40%;
|
110 |
+
opacity: 0.8;
|
111 |
+
}
|
112 |
+
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container > img.image {
|
113 |
+
top: 0;
|
114 |
+
bottom: 0;
|
115 |
+
left: 0;
|
116 |
+
right: 0;
|
117 |
+
max-height: 100%;
|
118 |
+
height: 100%;
|
119 |
+
width: 100%;
|
120 |
+
}
|
121 |
/*# sourceMappingURL=wooccm.css.map */
|
assets/frontend/css/wooccm.min.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
|
2 |
.woocommerce form .wooccm-clearfix:before,.woocommerce form .wooccm-clearfix:after{content:'';display:table}.woocommerce form .wooccm-clearfix:after{clear:both}.woocommerce form .wooccm-conditional-child{display:none}.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label{display:inline-block}.woocommerce form .wooccm-colorpicker-iris .iris-picker{display:none}.woocommerce form .wooccm-colorpicker-iris.active .iris-picker{display:block}@media(min-width:768px){.woocommerce form .wooccm-field.form-row-first{width:47.0588235294%;float:left;margin-right:5.8823529412%;clear:both}.woocommerce form .wooccm-field.form-row-last{width:45.4545454545%;float:right;margin-right:0}}.button.fileinput-button{position:relative;overflow:hidden!important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}.wooccm-file-list{margin:0 -5px;padding:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:start}.wooccm-file-list .wooccm-file-file{display:flex;justify-content:center;align-items:stretch;box-sizing:border-box;padding:10px 5px 0 5px;width:25%;position:relative}.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete{z-index:1;position:absolute;top:2px;right:-3px;width:16px;height:16px;background-color:#222;display:block;line-height:16px;text-align:center;color:#fefefe;font-weight:900;border-radius:50%;font-size:12px;cursor:pointer;font-family:code;text-decoration:none!important}.wooccm-file-list .wooccm-file-file .wooccm-file-list-container{width:100%;overflow:hidden}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container{display:flex;justify-content:center;align-items:center;overflow:hidden;width:100%;padding-top:100%;position:relative;background:#eee}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img{overflow:hidden;object-fit:cover;position:absolute;top:30%;bottom:auto;height:40%;opacity:.8}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img.image{top:0;bottom:0;left:0;right:0;max-height:100%;height:100%;width:100%}
|
1 |
+
|
2 |
.woocommerce form .wooccm-clearfix:before,.woocommerce form .wooccm-clearfix:after{content:'';display:table}.woocommerce form .wooccm-clearfix:after{clear:both}.woocommerce form .wooccm-conditional-child{display:none}.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label{display:inline-block}.woocommerce form .wooccm-colorpicker-iris .iris-picker{display:none}.woocommerce form .wooccm-colorpicker-iris.active .iris-picker{display:block}@media(min-width:768px){.woocommerce form .wooccm-field.form-row-first{width:47.0588235294%;float:left;margin-right:5.8823529412%;clear:both}.woocommerce form .wooccm-field.form-row-last{width:45.4545454545%;float:right;margin-right:0}}.button.fileinput-button{position:relative;overflow:hidden!important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}.wooccm-file-list{margin:0 -5px;padding:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:start}.wooccm-file-list .wooccm-file-file{display:flex;justify-content:center;align-items:stretch;box-sizing:border-box;padding:10px 5px 0 5px;width:25%;position:relative}.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete{z-index:1;position:absolute;top:2px;right:-3px;width:16px;height:16px;background-color:#222;display:block;line-height:16px;text-align:center;color:#fefefe;font-weight:900;border-radius:50%;font-size:12px;cursor:pointer;font-family:code;text-decoration:none!important}.wooccm-file-list .wooccm-file-file .wooccm-file-list-container{width:100%;overflow:hidden}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container{display:flex;justify-content:center;align-items:center;overflow:hidden;width:100%;padding-top:100%;position:relative;background:#eee}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img{overflow:hidden;object-fit:cover;position:absolute;top:30%;bottom:auto;height:40%;opacity:.8}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img.image{top:0;bottom:0;left:0;right:0;max-height:100%;height:100%;width:100%}
|
assets/frontend/js/wooccm-checkout.js
CHANGED
@@ -1,516 +1,516 @@
|
|
1 |
-
(function ($) {
|
2 |
-
|
3 |
-
var is_blocked = function ($node) {
|
4 |
-
return $node.is('.processing') || $node.parents('.processing').length;
|
5 |
-
};
|
6 |
-
var block = function ($node) {
|
7 |
-
if (!is_blocked($node)) {
|
8 |
-
$node.addClass('processing').block({
|
9 |
-
message: null,
|
10 |
-
overlayCSS: {
|
11 |
-
background: '#fff',
|
12 |
-
opacity: 0.6
|
13 |
-
}
|
14 |
-
});
|
15 |
-
}
|
16 |
-
};
|
17 |
-
var unblock = function ($node) {
|
18 |
-
$node.removeClass('processing').unblock();
|
19 |
-
};
|
20 |
-
var append_image = function (list, i, source, name, filetype) {
|
21 |
-
|
22 |
-
var $field_list = $(list),
|
23 |
-
source_class;
|
24 |
-
if (filetype.match('image.*')) {
|
25 |
-
source_class = 'image';
|
26 |
-
} else if (filetype.match('application/ms.*')) {
|
27 |
-
source = wooccm_upload.icons.spreadsheet;
|
28 |
-
source_class = 'spreadsheet';
|
29 |
-
} else if (filetype.match('application/x.*')) {
|
30 |
-
source = wooccm_upload.icons.archive;
|
31 |
-
source_class = 'application';
|
32 |
-
} else if (filetype.match('audio.*')) {
|
33 |
-
source = wooccm_upload.icons.audio;
|
34 |
-
source_class = 'audio';
|
35 |
-
} else if (filetype.match('text.*')) {
|
36 |
-
source = wooccm_upload.icons.text;
|
37 |
-
source_class = 'text';
|
38 |
-
} else if (filetype.match('video.*')) {
|
39 |
-
source = wooccm_upload.icons.video;
|
40 |
-
source_class = 'video';
|
41 |
-
} else {
|
42 |
-
//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)) {
|
43 |
-
source = wooccm_upload.icons.interactive;
|
44 |
-
source_class = 'interactive';
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
var html = '<span data-file_id="' + i + '" title="' + name + '" class="wooccm-file-file">\n\
|
49 |
-
<span class="wooccm-file-list-container">\n\
|
50 |
-
<a title="' + name + '" class="wooccm-file-list-delete">×</a>\n\
|
51 |
-
<span class="wooccm-file-list-image-container">\n\
|
52 |
-
<img class="' + source_class + '" alt="' + name + '" src="' + source + '"/>\n\
|
53 |
-
</span>\n\
|
54 |
-
</span>\n\
|
55 |
-
</span>';
|
56 |
-
$field_list.append(html).fadeIn();
|
57 |
-
}
|
58 |
-
|
59 |
-
|
60 |
-
function field_is_required(field, is_required) {
|
61 |
-
if (is_required) {
|
62 |
-
field.find('label .optional').remove();
|
63 |
-
field.addClass('validate-required');
|
64 |
-
if (field.find('label .required').length === 0) {
|
65 |
-
field.find('label').append(
|
66 |
-
'<abbr class="required" title="' +
|
67 |
-
wc_address_i18n_params.i18n_required_text +
|
68 |
-
'">*</abbr>'
|
69 |
-
);
|
70 |
-
}
|
71 |
-
|
72 |
-
//fix state hidden
|
73 |
-
field.show();
|
74 |
-
field.find('input[type=hidden]').prop('type', 'text');
|
75 |
-
|
76 |
-
} else {
|
77 |
-
field.find('label .required').remove();
|
78 |
-
field.removeClass('validate-required woocommerce-invalid woocommerce-invalid-required-field');
|
79 |
-
if (field.find('label .optional').length === 0) {
|
80 |
-
field.find('label').append('<span class="optional">(' + wc_address_i18n_params.i18n_optional_text + ')</span>');
|
81 |
-
}
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
$(document).on('country_to_state_changing', function (event, country, wrapper) {
|
87 |
-
|
88 |
-
var thisform = wrapper, thislocale;
|
89 |
-
var locale_fields = $.parseJSON(wc_address_i18n_params.locale_fields);
|
90 |
-
$.each(locale_fields, function (key, value) {
|
91 |
-
|
92 |
-
var field = thisform.find(value),
|
93 |
-
required = field.find('[data-required]').data('required') || field.find('.wooccm-required-field').length;
|
94 |
-
|
95 |
-
field_is_required(field, required);
|
96 |
-
});
|
97 |
-
});
|
98 |
-
// Field
|
99 |
-
// ---------------------------------------------------------------------------
|
100 |
-
|
101 |
-
var fileList = {};
|
102 |
-
|
103 |
-
$('.wooccm-type-file').each(function (i, field) {
|
104 |
-
|
105 |
-
var $field = $(field),
|
106 |
-
$button_file = $field.find('[type=file]'),
|
107 |
-
$button_click = $field.find('.wooccm-file-button'),
|
108 |
-
$field_list = $field.find('.wooccm-file-list');
|
109 |
-
|
110 |
-
fileList[$field.attr('id')] = [];
|
111 |
-
|
112 |
-
// Simulate click
|
113 |
-
// -------------------------------------------------------------------------
|
114 |
-
|
115 |
-
$button_click.on('click', function (e) {
|
116 |
-
e.preventDefault();
|
117 |
-
$button_file.trigger('click');
|
118 |
-
});
|
119 |
-
|
120 |
-
// Delete images
|
121 |
-
// ---------------------------------------------------------------------------
|
122 |
-
|
123 |
-
$field_list.on('click', '.wooccm-file-list-delete', function (e) {
|
124 |
-
|
125 |
-
var $file = $(this).closest('.wooccm-file-file'),
|
126 |
-
file_id = $(this).closest('[data-file_id]').data('file_id');
|
127 |
-
|
128 |
-
fileList[$field.attr('id')] = $.grep(fileList[$field.attr('id')], function (value, index) {
|
129 |
-
return index != file_id;
|
130 |
-
});
|
131 |
-
|
132 |
-
$file.remove();
|
133 |
-
|
134 |
-
$('#order_review').trigger('wooccm_upload');
|
135 |
-
});
|
136 |
-
// Append images
|
137 |
-
// -------------------------------------------------------------------------
|
138 |
-
|
139 |
-
$button_file.on('change', function (e) {
|
140 |
-
|
141 |
-
var files = $(this)[0].files;
|
142 |
-
if (files.length) {
|
143 |
-
|
144 |
-
if (window.FileReader) {
|
145 |
-
|
146 |
-
$.each(files, function (i, file) {
|
147 |
-
|
148 |
-
var count = $field_list.find('span[data-file_id]').length + i;
|
149 |
-
if (count >= wooccm_upload.limit.max_files) {
|
150 |
-
alert('Exeeds max files limit of ' + wooccm_upload.limit.max_files);
|
151 |
-
return false;
|
152 |
-
}
|
153 |
-
|
154 |
-
if (file.size > wooccm_upload.limit.max_file_size) {
|
155 |
-
alert('Exeeds max file size of ' + wooccm_upload.limit.max_file_size);
|
156 |
-
return true;
|
157 |
-
}
|
158 |
-
|
159 |
-
reader = new FileReader();
|
160 |
-
reader.onload = (function (theFile) {
|
161 |
-
return function (e) {
|
162 |
-
setTimeout(function () {
|
163 |
-
append_image($field_list, fileList[$field.attr('id')].push(file) - 1, e.target.result, theFile.name, theFile.type);
|
164 |
-
$('#order_review').trigger('wooccm_upload');
|
165 |
-
}, 200);
|
166 |
-
};
|
167 |
-
})(file);
|
168 |
-
console.log(file.name);
|
169 |
-
reader.readAsDataURL(file);
|
170 |
-
});
|
171 |
-
}
|
172 |
-
}
|
173 |
-
});
|
174 |
-
});
|
175 |
-
// Add class on place order reload if upload field exists
|
176 |
-
// ---------------------------------------------------------------------------
|
177 |
-
|
178 |
-
// $(document).on('checkout_place_order_success', function (e) {
|
179 |
-
// alert('submit!');
|
180 |
-
// });
|
181 |
-
// $('form.checkout').on('checkout_place_order_success', function (e) {
|
182 |
-
// alert('submit!');
|
183 |
-
// });
|
184 |
-
$('#order_review').on('ajaxSuccess wooccm_upload', function (e, xhr, settings) {
|
185 |
-
|
186 |
-
// console.log('e', e);
|
187 |
-
// console.log('xhr', xhr);
|
188 |
-
// console.log('settings', settings);
|
189 |
-
|
190 |
-
var $order_review = $(e.target),
|
191 |
-
$place_order = $order_review.find('#place_order'),
|
192 |
-
$fields = $('.wooccm-type-file'),
|
193 |
-
fields = $fields.length;
|
194 |
-
|
195 |
-
if (fields) {
|
196 |
-
$place_order.addClass('wooccm-upload-process');
|
197 |
-
} else {
|
198 |
-
$place_order.removeClass('wooccm-upload-process');
|
199 |
-
}
|
200 |
-
|
201 |
-
});
|
202 |
-
// Upload files
|
203 |
-
// ---------------------------------------------------------------------------
|
204 |
-
|
205 |
-
$(document).on('click', '#place_order.wooccm-upload-process', function (e) {
|
206 |
-
|
207 |
-
e.preventDefault();
|
208 |
-
var $form = $('form.checkout'),
|
209 |
-
$place_order = $(this),
|
210 |
-
$fields = $('.wooccm-type-file');
|
211 |
-
|
212 |
-
if (!$fields.length) {
|
213 |
-
return;
|
214 |
-
}
|
215 |
-
|
216 |
-
if (!window.FormData) {
|
217 |
-
return;
|
218 |
-
}
|
219 |
-
|
220 |
-
if (!Object.keys(fileList).length) {
|
221 |
-
return;
|
222 |
-
}
|
223 |
-
|
224 |
-
if (!is_blocked($form)) {
|
225 |
-
$place_order.html(wooccm_upload.message.uploading);
|
226 |
-
block($form);
|
227 |
-
}
|
228 |
-
|
229 |
-
$.each(fileList, function (field_id, files) {
|
230 |
-
|
231 |
-
var $field = $('#' + field_id),
|
232 |
-
$attachment_ids = $field.find('.wooccm-file-field'),
|
233 |
-
data = new FormData();
|
234 |
-
|
235 |
-
$.each(files, function (file_id, file) {
|
236 |
-
|
237 |
-
if (file_id > wooccm_upload.limit.max_files) {
|
238 |
-
console.log('Exeeds max files limit of ' + wooccm_upload.limit.max_files);
|
239 |
-
return false;
|
240 |
-
}
|
241 |
-
|
242 |
-
if (file.size > wooccm_upload.limit.max_file_size) {
|
243 |
-
console.log('Exeeds max file size of ' + wooccm_upload.limit.max_files);
|
244 |
-
return true;
|
245 |
-
}
|
246 |
-
|
247 |
-
console.log('We\'re ready to upload ' + file.name);
|
248 |
-
|
249 |
-
data.append('wooccm_checkout_attachment_upload[]', file);
|
250 |
-
|
251 |
-
});
|
252 |
-
|
253 |
-
data.append('action', 'wooccm_checkout_attachment_upload');
|
254 |
-
data.append('nonce', wooccm_upload.nonce);
|
255 |
-
|
256 |
-
$.ajax({
|
257 |
-
async: false,
|
258 |
-
url: wooccm_upload.ajax_url,
|
259 |
-
type: 'POST',
|
260 |
-
cache: false,
|
261 |
-
data: data,
|
262 |
-
processData: false,
|
263 |
-
contentType: false,
|
264 |
-
beforeSend: function (response) {
|
265 |
-
//$place_order.html(wooccm_upload.message.uploading);
|
266 |
-
},
|
267 |
-
success: function (response) {
|
268 |
-
if (response.success) {
|
269 |
-
$attachment_ids.val(response.data);
|
270 |
-
} else {
|
271 |
-
$('body').trigger('update_checkout');
|
272 |
-
}
|
273 |
-
},
|
274 |
-
complete: function (response) {
|
275 |
-
}
|
276 |
-
});
|
277 |
-
|
278 |
-
});
|
279 |
-
|
280 |
-
unblock($form);
|
281 |
-
$place_order.removeClass('wooccm-upload-process').trigger('click');
|
282 |
-
|
283 |
-
});
|
284 |
-
// Update checkout fees
|
285 |
-
// ---------------------------------------------------------------------------
|
286 |
-
|
287 |
-
$(document).on('change', '.wooccm-add-price', function (e) {
|
288 |
-
$('body').trigger('update_checkout');
|
289 |
-
});
|
290 |
-
// Conditional
|
291 |
-
// ---------------------------------------------------------------------------
|
292 |
-
|
293 |
-
$('.wooccm-conditional-child').each(function (i, field) {
|
294 |
-
|
295 |
-
var $field = $(field),
|
296 |
-
$parent = $('#' + $field.find('[data-conditional-parent]').data('conditional-parent') + '_field'),
|
297 |
-
show_if_value = $field.find('[data-conditional-parent-value]').data('conditional-parent-value').toString();
|
298 |
-
if ($parent.length) {
|
299 |
-
|
300 |
-
$parent.on('wooccm_change change keyup', function (e) {
|
301 |
-
|
302 |
-
var $this = $(e.target),
|
303 |
-
value = $this.val();
|
304 |
-
// fix for select2 search
|
305 |
-
if ($this.hasClass('select2-selection')) {
|
306 |
-
return;
|
307 |
-
}
|
308 |
-
|
309 |
-
//make sure its a single checkbox otherwise return value
|
310 |
-
if ($this.prop('type') == 'checkbox') {
|
311 |
-
// fix for multicheckbox
|
312 |
-
if ($this.attr('name').indexOf('[]') !== -1) {
|
313 |
-
value = $parent.find('input:checked').map(function (i, e) {
|
314 |
-
return e.value
|
315 |
-
}).toArray();
|
316 |
-
} else {
|
317 |
-
value = $this.is(':checked');
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
if (show_if_value == value || ($.isArray(value) && value.indexOf(show_if_value) > -1)) {
|
322 |
-
$field.fadeIn();
|
323 |
-
} else {
|
324 |
-
$field.fadeOut();
|
325 |
-
}
|
326 |
-
|
327 |
-
$this.off('wooccm_change');
|
328 |
-
$this.off('change');
|
329 |
-
$this.off('keyup');
|
330 |
-
$field.trigger('change');
|
331 |
-
});
|
332 |
-
// dont use change event because trigger update_checkout event
|
333 |
-
$parent.find('select:first').trigger('wooccm_change');
|
334 |
-
$parent.find('textarea:first').trigger('wooccm_change');
|
335 |
-
$parent.find('input[type=button]:first').trigger('wooccm_change');
|
336 |
-
$parent.find('input[type=radio]:checked:first').trigger('wooccm_change');
|
337 |
-
$parent.find('input[type=checkbox]:checked:first').trigger('wooccm_change');
|
338 |
-
$parent.find('input[type=color]:first').trigger('wooccm_change');
|
339 |
-
$parent.find('input[type=date]:first').trigger('wooccm_change');
|
340 |
-
$parent.find('input[type=datetime-local]:first').trigger('wooccm_change');
|
341 |
-
$parent.find('input[type=email]:first').trigger('wooccm_change');
|
342 |
-
$parent.find('input[type=file]:first').trigger('wooccm_change');
|
343 |
-
$parent.find('input[type=hidden]:first').trigger('wooccm_change');
|
344 |
-
$parent.find('input[type=image]:first').trigger('wooccm_change');
|
345 |
-
$parent.find('input[type=month]:first').trigger('wooccm_change');
|
346 |
-
$parent.find('input[type=number]:first').trigger('wooccm_change');
|
347 |
-
$parent.find('input[type=password]:first').trigger('wooccm_change');
|
348 |
-
$parent.find('input[type=range]:first').trigger('wooccm_change');
|
349 |
-
$parent.find('input[type=reset]:first').trigger('wooccm_change');
|
350 |
-
$parent.find('input[type=search]:first').trigger('wooccm_change');
|
351 |
-
$parent.find('input[type=submit]:first').trigger('wooccm_change');
|
352 |
-
$parent.find('input[type=tel]:first').trigger('wooccm_change');
|
353 |
-
$parent.find('input[type=text]:first').trigger('wooccm_change');
|
354 |
-
$parent.find('input[type=time]:first').trigger('wooccm_change');
|
355 |
-
$parent.find('input[type=url]:first').trigger('wooccm_change');
|
356 |
-
$parent.find('input[type=week]:first').trigger('wooccm_change');
|
357 |
-
} else {
|
358 |
-
$field.show();
|
359 |
-
}
|
360 |
-
|
361 |
-
});
|
362 |
-
// Datepicker fields
|
363 |
-
// ---------------------------------------------------------------------------
|
364 |
-
|
365 |
-
$('.wooccm-enhanced-datepicker').each(function (i, field) {
|
366 |
-
|
367 |
-
var $input = $(this),
|
368 |
-
disable = $input.data('disable') || false;
|
369 |
-
|
370 |
-
console.log('mindate', $input.data('mindate'));
|
371 |
-
|
372 |
-
if ($.isFunction($.fn.datepicker)) {
|
373 |
-
$input.datepicker({
|
374 |
-
dateFormat: $input.data('formatdate') || 'dd-mm-yy',
|
375 |
-
minDate: $input.data('mindate'),
|
376 |
-
maxDate: $input.data('maxdate'),
|
377 |
-
beforeShowDay: function (date) {
|
378 |
-
var day = date.getDay().toString();
|
379 |
-
if (disable) {
|
380 |
-
return [$.inArray(day, disable) === -1];
|
381 |
-
}
|
382 |
-
return [true];
|
383 |
-
}
|
384 |
-
});
|
385 |
-
}
|
386 |
-
|
387 |
-
});
|
388 |
-
// Timepicker fields
|
389 |
-
// ---------------------------------------------------------------------------
|
390 |
-
|
391 |
-
$('.wooccm-enhanced-timepicker').each(function (i, field) {
|
392 |
-
|
393 |
-
var $input = $(this);
|
394 |
-
|
395 |
-
if ($.isFunction($.fn.timepicker)) {
|
396 |
-
$input.timepicker({
|
397 |
-
//timeFormat: 'HH:mm:ss',
|
398 |
-
showPeriod: true,
|
399 |
-
showLeadingZero: true,
|
400 |
-
hours: $input.data('hours') || undefined,
|
401 |
-
minutes: $input.data('minutes') || undefined,
|
402 |
-
});
|
403 |
-
}
|
404 |
-
|
405 |
-
});
|
406 |
-
// Color fields
|
407 |
-
// ---------------------------------------------------------------------------
|
408 |
-
|
409 |
-
$('.wooccm-colorpicker-farbtastic').each(function (i, field) {
|
410 |
-
|
411 |
-
var $field = $(field),
|
412 |
-
$input = $field.find('input[type=text]'),
|
413 |
-
$container = $field.find('.wooccmcolorpicker_container');
|
414 |
-
$input.hide();
|
415 |
-
if ($.isFunction($.fn.farbtastic)) {
|
416 |
-
|
417 |
-
$container.farbtastic('#' + $input.attr('id'));
|
418 |
-
$container.on('click', function (e) {
|
419 |
-
$input.fadeIn();
|
420 |
-
});
|
421 |
-
}
|
422 |
-
|
423 |
-
});
|
424 |
-
$('.wooccm-colorpicker-iris').each(function (i, field) {
|
425 |
-
|
426 |
-
var $field = $(field),
|
427 |
-
$input = $field.find('input[type=text]');
|
428 |
-
$input.css('background', $input.val());
|
429 |
-
$input.on('click', function (e) {
|
430 |
-
|
431 |
-
$field.toggleClass('active');
|
432 |
-
});
|
433 |
-
$input.iris({
|
434 |
-
class: $input.attr('id'),
|
435 |
-
palettes: true,
|
436 |
-
color: '',
|
437 |
-
hide: false,
|
438 |
-
change: function (event, ui) {
|
439 |
-
$input.css('background', ui.color.toString()).fadeIn();
|
440 |
-
}
|
441 |
-
});
|
442 |
-
});
|
443 |
-
$(document).on('click', function (e) {
|
444 |
-
if ($(e.target).closest('.iris-picker').length === 0) {
|
445 |
-
$('.wooccm-colorpicker-iris').removeClass('active');
|
446 |
-
}
|
447 |
-
});
|
448 |
-
|
449 |
-
if (typeof wc_country_select_params === 'undefined') {
|
450 |
-
return false;
|
451 |
-
}
|
452 |
-
|
453 |
-
if ($().selectWoo) {
|
454 |
-
var getEnhancedSelectFormatString = function () {
|
455 |
-
return {
|
456 |
-
'language': {
|
457 |
-
errorLoading: function () {
|
458 |
-
return wc_country_select_params.i18n_searching;
|
459 |
-
},
|
460 |
-
inputTooLong: function (args) {
|
461 |
-
var overChars = args.input.length - args.maximum;
|
462 |
-
if (1 === overChars) {
|
463 |
-
return wc_country_select_params.i18n_input_too_long_1;
|
464 |
-
}
|
465 |
-
|
466 |
-
return wc_country_select_params.i18n_input_too_long_n.replace('%qty%', overChars);
|
467 |
-
},
|
468 |
-
inputTooShort: function (args) {
|
469 |
-
var remainingChars = args.minimum - args.input.length;
|
470 |
-
if (1 === remainingChars) {
|
471 |
-
return wc_country_select_params.i18n_input_too_short_1;
|
472 |
-
}
|
473 |
-
|
474 |
-
return wc_country_select_params.i18n_input_too_short_n.replace('%qty%', remainingChars);
|
475 |
-
},
|
476 |
-
loadingMore: function () {
|
477 |
-
return wc_country_select_params.i18n_load_more;
|
478 |
-
},
|
479 |
-
maximumSelected: function (args) {
|
480 |
-
if (args.maximum === 1) {
|
481 |
-
return wc_country_select_params.i18n_selection_too_long_1;
|
482 |
-
}
|
483 |
-
return wc_country_select_params.i18n_selection_too_long_n.replace('%qty%', args.maximum);
|
484 |
-
},
|
485 |
-
noResults: function () {
|
486 |
-
return wc_country_select_params.i18n_no_matches;
|
487 |
-
},
|
488 |
-
searching: function () {
|
489 |
-
return wc_country_select_params.i18n_searching;
|
490 |
-
}
|
491 |
-
}
|
492 |
-
};
|
493 |
-
};
|
494 |
-
|
495 |
-
var wooccm_enhanced_select = function () {
|
496 |
-
$('select.wooccm-enhanced-select').each(function () {
|
497 |
-
var select2_args = $.extend({
|
498 |
-
width: '100%',
|
499 |
-
placeholder: $(this).data('placeholder') || '',
|
500 |
-
allowClear: $(this).data('allowclear') || false,
|
501 |
-
selectOnClose: $(this).data('selectonclose') || false,
|
502 |
-
closeOnSelect: $(this).data('closeonselect') || false,
|
503 |
-
//forceAbove: $(this).data('forceabove') || false,
|
504 |
-
minimumResultsForSearch: $(this).data('search') || -1,
|
505 |
-
}, getEnhancedSelectFormatString());
|
506 |
-
$(this).on('select2:select', function () {
|
507 |
-
$(this).focus();
|
508 |
-
}).selectWoo(select2_args);
|
509 |
-
});
|
510 |
-
};
|
511 |
-
|
512 |
-
wooccm_enhanced_select();
|
513 |
-
|
514 |
-
}
|
515 |
-
|
516 |
})(jQuery);
|
1 |
+
(function ($) {
|
2 |
+
|
3 |
+
var is_blocked = function ($node) {
|
4 |
+
return $node.is('.processing') || $node.parents('.processing').length;
|
5 |
+
};
|
6 |
+
var block = function ($node) {
|
7 |
+
if (!is_blocked($node)) {
|
8 |
+
$node.addClass('processing').block({
|
9 |
+
message: null,
|
10 |
+
overlayCSS: {
|
11 |
+
background: '#fff',
|
12 |
+
opacity: 0.6
|
13 |
+
}
|
14 |
+
});
|
15 |
+
}
|
16 |
+
};
|
17 |
+
var unblock = function ($node) {
|
18 |
+
$node.removeClass('processing').unblock();
|
19 |
+
};
|
20 |
+
var append_image = function (list, i, source, name, filetype) {
|
21 |
+
|
22 |
+
var $field_list = $(list),
|
23 |
+
source_class;
|
24 |
+
if (filetype.match('image.*')) {
|
25 |
+
source_class = 'image';
|
26 |
+
} else if (filetype.match('application/ms.*')) {
|
27 |
+
source = wooccm_upload.icons.spreadsheet;
|
28 |
+
source_class = 'spreadsheet';
|
29 |
+
} else if (filetype.match('application/x.*')) {
|
30 |
+
source = wooccm_upload.icons.archive;
|
31 |
+
source_class = 'application';
|
32 |
+
} else if (filetype.match('audio.*')) {
|
33 |
+
source = wooccm_upload.icons.audio;
|
34 |
+
source_class = 'audio';
|
35 |
+
} else if (filetype.match('text.*')) {
|
36 |
+
source = wooccm_upload.icons.text;
|
37 |
+
source_class = 'text';
|
38 |
+
} else if (filetype.match('video.*')) {
|
39 |
+
source = wooccm_upload.icons.video;
|
40 |
+
source_class = 'video';
|
41 |
+
} else {
|
42 |
+
//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)) {
|
43 |
+
source = wooccm_upload.icons.interactive;
|
44 |
+
source_class = 'interactive';
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
var html = '<span data-file_id="' + i + '" title="' + name + '" class="wooccm-file-file">\n\
|
49 |
+
<span class="wooccm-file-list-container">\n\
|
50 |
+
<a title="' + name + '" class="wooccm-file-list-delete">×</a>\n\
|
51 |
+
<span class="wooccm-file-list-image-container">\n\
|
52 |
+
<img class="' + source_class + '" alt="' + name + '" src="' + source + '"/>\n\
|
53 |
+
</span>\n\
|
54 |
+
</span>\n\
|
55 |
+
</span>';
|
56 |
+
$field_list.append(html).fadeIn();
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
function field_is_required(field, is_required) {
|
61 |
+
if (is_required) {
|
62 |
+
field.find('label .optional').remove();
|
63 |
+
field.addClass('validate-required');
|
64 |
+
if (field.find('label .required').length === 0) {
|
65 |
+
field.find('label').append(
|
66 |
+
'<abbr class="required" title="' +
|
67 |
+
wc_address_i18n_params.i18n_required_text +
|
68 |
+
'">*</abbr>'
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
//fix state hidden
|
73 |
+
field.show();
|
74 |
+
field.find('input[type=hidden]').prop('type', 'text');
|
75 |
+
|
76 |
+
} else {
|
77 |
+
field.find('label .required').remove();
|
78 |
+
field.removeClass('validate-required woocommerce-invalid woocommerce-invalid-required-field');
|
79 |
+
if (field.find('label .optional').length === 0) {
|
80 |
+
field.find('label').append('<span class="optional">(' + wc_address_i18n_params.i18n_optional_text + ')</span>');
|
81 |
+
}
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
$(document).on('country_to_state_changing', function (event, country, wrapper) {
|
87 |
+
|
88 |
+
var thisform = wrapper, thislocale;
|
89 |
+
var locale_fields = $.parseJSON(wc_address_i18n_params.locale_fields);
|
90 |
+
$.each(locale_fields, function (key, value) {
|
91 |
+
|
92 |
+
var field = thisform.find(value),
|
93 |
+
required = field.find('[data-required]').data('required') || field.find('.wooccm-required-field').length;
|
94 |
+
|
95 |
+
field_is_required(field, required);
|
96 |
+
});
|
97 |
+
});
|
98 |
+
// Field
|
99 |
+
// ---------------------------------------------------------------------------
|
100 |
+
|
101 |
+
var fileList = {};
|
102 |
+
|
103 |
+
$('.wooccm-type-file').each(function (i, field) {
|
104 |
+
|
105 |
+
var $field = $(field),
|
106 |
+
$button_file = $field.find('[type=file]'),
|
107 |
+
$button_click = $field.find('.wooccm-file-button'),
|
108 |
+
$field_list = $field.find('.wooccm-file-list');
|
109 |
+
|
110 |
+
fileList[$field.attr('id')] = [];
|
111 |
+
|
112 |
+
// Simulate click
|
113 |
+
// -------------------------------------------------------------------------
|
114 |
+
|
115 |
+
$button_click.on('click', function (e) {
|
116 |
+
e.preventDefault();
|
117 |
+
$button_file.trigger('click');
|
118 |
+
});
|
119 |
+
|
120 |
+
// Delete images
|
121 |
+
// ---------------------------------------------------------------------------
|
122 |
+
|
123 |
+
$field_list.on('click', '.wooccm-file-list-delete', function (e) {
|
124 |
+
|
125 |
+
var $file = $(this).closest('.wooccm-file-file'),
|
126 |
+
file_id = $(this).closest('[data-file_id]').data('file_id');
|
127 |
+
|
128 |
+
fileList[$field.attr('id')] = $.grep(fileList[$field.attr('id')], function (value, index) {
|
129 |
+
return index != file_id;
|
130 |
+
});
|
131 |
+
|
132 |
+
$file.remove();
|
133 |
+
|
134 |
+
$('#order_review').trigger('wooccm_upload');
|
135 |
+
});
|
136 |
+
// Append images
|
137 |
+
// -------------------------------------------------------------------------
|
138 |
+
|
139 |
+
$button_file.on('change', function (e) {
|
140 |
+
|
141 |
+
var files = $(this)[0].files;
|
142 |
+
if (files.length) {
|
143 |
+
|
144 |
+
if (window.FileReader) {
|
145 |
+
|
146 |
+
$.each(files, function (i, file) {
|
147 |
+
|
148 |
+
var count = $field_list.find('span[data-file_id]').length + i;
|
149 |
+
if (count >= wooccm_upload.limit.max_files) {
|
150 |
+
alert('Exeeds max files limit of ' + wooccm_upload.limit.max_files);
|
151 |
+
return false;
|
152 |
+
}
|
153 |
+
|
154 |
+
if (file.size > wooccm_upload.limit.max_file_size) {
|
155 |
+
alert('Exeeds max file size of ' + wooccm_upload.limit.max_file_size);
|
156 |
+
return true;
|
157 |
+
}
|
158 |
+
|
159 |
+
reader = new FileReader();
|
160 |
+
reader.onload = (function (theFile) {
|
161 |
+
return function (e) {
|
162 |
+
setTimeout(function () {
|
163 |
+
append_image($field_list, fileList[$field.attr('id')].push(file) - 1, e.target.result, theFile.name, theFile.type);
|
164 |
+
$('#order_review').trigger('wooccm_upload');
|
165 |
+
}, 200);
|
166 |
+
};
|
167 |
+
})(file);
|
168 |
+
console.log(file.name);
|
169 |
+
reader.readAsDataURL(file);
|
170 |
+
});
|
171 |
+
}
|
172 |
+
}
|
173 |
+
});
|
174 |
+
});
|
175 |
+
// Add class on place order reload if upload field exists
|
176 |
+
// ---------------------------------------------------------------------------
|
177 |
+
|
178 |
+
// $(document).on('checkout_place_order_success', function (e) {
|
179 |
+
// alert('submit!');
|
180 |
+
// });
|
181 |
+
// $('form.checkout').on('checkout_place_order_success', function (e) {
|
182 |
+
// alert('submit!');
|
183 |
+
// });
|
184 |
+
$('#order_review').on('ajaxSuccess wooccm_upload', function (e, xhr, settings) {
|
185 |
+
|
186 |
+
// console.log('e', e);
|
187 |
+
// console.log('xhr', xhr);
|
188 |
+
// console.log('settings', settings);
|
189 |
+
|
190 |
+
var $order_review = $(e.target),
|
191 |
+
$place_order = $order_review.find('#place_order'),
|
192 |
+
$fields = $('.wooccm-type-file'),
|
193 |
+
fields = $fields.length;
|
194 |
+
|
195 |
+
if (fields) {
|
196 |
+
$place_order.addClass('wooccm-upload-process');
|
197 |
+
} else {
|
198 |
+
$place_order.removeClass('wooccm-upload-process');
|
199 |
+
}
|
200 |
+
|
201 |
+
});
|
202 |
+
// Upload files
|
203 |
+
// ---------------------------------------------------------------------------
|
204 |
+
|
205 |
+
$(document).on('click', '#place_order.wooccm-upload-process', function (e) {
|
206 |
+
|
207 |
+
e.preventDefault();
|
208 |
+
var $form = $('form.checkout'),
|
209 |
+
$place_order = $(this),
|
210 |
+
$fields = $('.wooccm-type-file');
|
211 |
+
|
212 |
+
if (!$fields.length) {
|
213 |
+
return;
|
214 |
+
}
|
215 |
+
|
216 |
+
if (!window.FormData) {
|
217 |
+
return;
|
218 |
+
}
|
219 |
+
|
220 |
+
if (!Object.keys(fileList).length) {
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
|
224 |
+
if (!is_blocked($form)) {
|
225 |
+
$place_order.html(wooccm_upload.message.uploading);
|
226 |
+
block($form);
|
227 |
+
}
|
228 |
+
|
229 |
+
$.each(fileList, function (field_id, files) {
|
230 |
+
|
231 |
+
var $field = $('#' + field_id),
|
232 |
+
$attachment_ids = $field.find('.wooccm-file-field'),
|
233 |
+
data = new FormData();
|
234 |
+
|
235 |
+
$.each(files, function (file_id, file) {
|
236 |
+
|
237 |
+
if (file_id > wooccm_upload.limit.max_files) {
|
238 |
+
console.log('Exeeds max files limit of ' + wooccm_upload.limit.max_files);
|
239 |
+
return false;
|
240 |
+
}
|
241 |
+
|
242 |
+
if (file.size > wooccm_upload.limit.max_file_size) {
|
243 |
+
console.log('Exeeds max file size of ' + wooccm_upload.limit.max_files);
|
244 |
+
return true;
|
245 |
+
}
|
246 |
+
|
247 |
+
console.log('We\'re ready to upload ' + file.name);
|
248 |
+
|
249 |
+
data.append('wooccm_checkout_attachment_upload[]', file);
|
250 |
+
|
251 |
+
});
|
252 |
+
|
253 |
+
data.append('action', 'wooccm_checkout_attachment_upload');
|
254 |
+
data.append('nonce', wooccm_upload.nonce);
|
255 |
+
|
256 |
+
$.ajax({
|
257 |
+
async: false,
|
258 |
+
url: wooccm_upload.ajax_url,
|
259 |
+
type: 'POST',
|
260 |
+
cache: false,
|
261 |
+
data: data,
|
262 |
+
processData: false,
|
263 |
+
contentType: false,
|
264 |
+
beforeSend: function (response) {
|
265 |
+
//$place_order.html(wooccm_upload.message.uploading);
|
266 |
+
},
|
267 |
+
success: function (response) {
|
268 |
+
if (response.success) {
|
269 |
+
$attachment_ids.val(response.data);
|
270 |
+
} else {
|
271 |
+
$('body').trigger('update_checkout');
|
272 |
+
}
|
273 |
+
},
|
274 |
+
complete: function (response) {
|
275 |
+
}
|
276 |
+
});
|
277 |
+
|
278 |
+
});
|
279 |
+
|
280 |
+
unblock($form);
|
281 |
+
$place_order.removeClass('wooccm-upload-process').trigger('click');
|
282 |
+
|
283 |
+
});
|
284 |
+
// Update checkout fees
|
285 |
+
// ---------------------------------------------------------------------------
|
286 |
+
|
287 |
+
$(document).on('change', '.wooccm-add-price', function (e) {
|
288 |
+
$('body').trigger('update_checkout');
|
289 |
+
});
|
290 |
+
// Conditional
|
291 |
+
// ---------------------------------------------------------------------------
|
292 |
+
|
293 |
+
$('.wooccm-conditional-child').each(function (i, field) {
|
294 |
+
|
295 |
+
var $field = $(field),
|
296 |
+
$parent = $('#' + $field.find('[data-conditional-parent]').data('conditional-parent') + '_field'),
|
297 |
+
show_if_value = $field.find('[data-conditional-parent-value]').data('conditional-parent-value').toString();
|
298 |
+
if ($parent.length) {
|
299 |
+
|
300 |
+
$parent.on('wooccm_change change keyup', function (e) {
|
301 |
+
|
302 |
+
var $this = $(e.target),
|
303 |
+
value = $this.val();
|
304 |
+
// fix for select2 search
|
305 |
+
if ($this.hasClass('select2-selection')) {
|
306 |
+
return;
|
307 |
+
}
|
308 |
+
|
309 |
+
//make sure its a single checkbox otherwise return value
|
310 |
+
if ($this.prop('type') == 'checkbox') {
|
311 |
+
// fix for multicheckbox
|
312 |
+
if ($this.attr('name').indexOf('[]') !== -1) {
|
313 |
+
value = $parent.find('input:checked').map(function (i, e) {
|
314 |
+
return e.value
|
315 |
+
}).toArray();
|
316 |
+
} else {
|
317 |
+
value = $this.is(':checked');
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
if (show_if_value == value || ($.isArray(value) && value.indexOf(show_if_value) > -1)) {
|
322 |
+
$field.fadeIn();
|
323 |
+
} else {
|
324 |
+
$field.fadeOut();
|
325 |
+
}
|
326 |
+
|
327 |
+
$this.off('wooccm_change');
|
328 |
+
$this.off('change');
|
329 |
+
$this.off('keyup');
|
330 |
+
$field.trigger('change');
|
331 |
+
});
|
332 |
+
// dont use change event because trigger update_checkout event
|
333 |
+
$parent.find('select:first').trigger('wooccm_change');
|
334 |
+
$parent.find('textarea:first').trigger('wooccm_change');
|
335 |
+
$parent.find('input[type=button]:first').trigger('wooccm_change');
|
336 |
+
$parent.find('input[type=radio]:checked:first').trigger('wooccm_change');
|
337 |
+
$parent.find('input[type=checkbox]:checked:first').trigger('wooccm_change');
|
338 |
+
$parent.find('input[type=color]:first').trigger('wooccm_change');
|
339 |
+
$parent.find('input[type=date]:first').trigger('wooccm_change');
|
340 |
+
$parent.find('input[type=datetime-local]:first').trigger('wooccm_change');
|
341 |
+
$parent.find('input[type=email]:first').trigger('wooccm_change');
|
342 |
+
$parent.find('input[type=file]:first').trigger('wooccm_change');
|
343 |
+
$parent.find('input[type=hidden]:first').trigger('wooccm_change');
|
344 |
+
$parent.find('input[type=image]:first').trigger('wooccm_change');
|
345 |
+
$parent.find('input[type=month]:first').trigger('wooccm_change');
|
346 |
+
$parent.find('input[type=number]:first').trigger('wooccm_change');
|
347 |
+
$parent.find('input[type=password]:first').trigger('wooccm_change');
|
348 |
+
$parent.find('input[type=range]:first').trigger('wooccm_change');
|
349 |
+
$parent.find('input[type=reset]:first').trigger('wooccm_change');
|
350 |
+
$parent.find('input[type=search]:first').trigger('wooccm_change');
|
351 |
+
$parent.find('input[type=submit]:first').trigger('wooccm_change');
|
352 |
+
$parent.find('input[type=tel]:first').trigger('wooccm_change');
|
353 |
+
$parent.find('input[type=text]:first').trigger('wooccm_change');
|
354 |
+
$parent.find('input[type=time]:first').trigger('wooccm_change');
|
355 |
+
$parent.find('input[type=url]:first').trigger('wooccm_change');
|
356 |
+
$parent.find('input[type=week]:first').trigger('wooccm_change');
|
357 |
+
} else {
|
358 |
+
$field.show();
|
359 |
+
}
|
360 |
+
|
361 |
+
});
|
362 |
+
// Datepicker fields
|
363 |
+
// ---------------------------------------------------------------------------
|
364 |
+
|
365 |
+
$('.wooccm-enhanced-datepicker').each(function (i, field) {
|
366 |
+
|
367 |
+
var $input = $(this),
|
368 |
+
disable = $input.data('disable') || false;
|
369 |
+
|
370 |
+
console.log('mindate', $input.data('mindate'));
|
371 |
+
|
372 |
+
if ($.isFunction($.fn.datepicker)) {
|
373 |
+
$input.datepicker({
|
374 |
+
dateFormat: $input.data('formatdate') || 'dd-mm-yy',
|
375 |
+
minDate: $input.data('mindate'),
|
376 |
+
maxDate: $input.data('maxdate'),
|
377 |
+
beforeShowDay: function (date) {
|
378 |
+
var day = date.getDay().toString();
|
379 |
+
if (disable) {
|
380 |
+
return [$.inArray(day, disable) === -1];
|
381 |
+
}
|
382 |
+
return [true];
|
383 |
+
}
|
384 |
+
});
|
385 |
+
}
|
386 |
+
|
387 |
+
});
|
388 |
+
// Timepicker fields
|
389 |
+
// ---------------------------------------------------------------------------
|
390 |
+
|
391 |
+
$('.wooccm-enhanced-timepicker').each(function (i, field) {
|
392 |
+
|
393 |
+
var $input = $(this);
|
394 |
+
|
395 |
+
if ($.isFunction($.fn.timepicker)) {
|
396 |
+
$input.timepicker({
|
397 |
+
//timeFormat: 'HH:mm:ss',
|
398 |
+
showPeriod: true,
|
399 |
+
showLeadingZero: true,
|
400 |
+
hours: $input.data('hours') || undefined,
|
401 |
+
minutes: $input.data('minutes') || undefined,
|
402 |
+
});
|
403 |
+
}
|
404 |
+
|
405 |
+
});
|
406 |
+
// Color fields
|
407 |
+
// ---------------------------------------------------------------------------
|
408 |
+
|
409 |
+
$('.wooccm-colorpicker-farbtastic').each(function (i, field) {
|
410 |
+
|
411 |
+
var $field = $(field),
|
412 |
+
$input = $field.find('input[type=text]'),
|
413 |
+
$container = $field.find('.wooccmcolorpicker_container');
|
414 |
+
$input.hide();
|
415 |
+
if ($.isFunction($.fn.farbtastic)) {
|
416 |
+
|
417 |
+
$container.farbtastic('#' + $input.attr('id'));
|
418 |
+
$container.on('click', function (e) {
|
419 |
+
$input.fadeIn();
|
420 |
+
});
|
421 |
+
}
|
422 |
+
|
423 |
+
});
|
424 |
+
$('.wooccm-colorpicker-iris').each(function (i, field) {
|
425 |
+
|
426 |
+
var $field = $(field),
|
427 |
+
$input = $field.find('input[type=text]');
|
428 |
+
$input.css('background', $input.val());
|
429 |
+
$input.on('click', function (e) {
|
430 |
+
|
431 |
+
$field.toggleClass('active');
|
432 |
+
});
|
433 |
+
$input.iris({
|
434 |
+
class: $input.attr('id'),
|
435 |
+
palettes: true,
|
436 |
+
color: '',
|
437 |
+
hide: false,
|
438 |
+
change: function (event, ui) {
|
439 |
+
$input.css('background', ui.color.toString()).fadeIn();
|
440 |
+
}
|
441 |
+
});
|
442 |
+
});
|
443 |
+
$(document).on('click', function (e) {
|
444 |
+
if ($(e.target).closest('.iris-picker').length === 0) {
|
445 |
+
$('.wooccm-colorpicker-iris').removeClass('active');
|
446 |
+
}
|
447 |
+
});
|
448 |
+
|
449 |
+
if (typeof wc_country_select_params === 'undefined') {
|
450 |
+
return false;
|
451 |
+
}
|
452 |
+
|
453 |
+
if ($().selectWoo) {
|
454 |
+
var getEnhancedSelectFormatString = function () {
|
455 |
+
return {
|
456 |
+
'language': {
|
457 |
+
errorLoading: function () {
|
458 |
+
return wc_country_select_params.i18n_searching;
|
459 |
+
},
|
460 |
+
inputTooLong: function (args) {
|
461 |
+
var overChars = args.input.length - args.maximum;
|
462 |
+
if (1 === overChars) {
|
463 |
+
return wc_country_select_params.i18n_input_too_long_1;
|
464 |
+
}
|
465 |
+
|
466 |
+
return wc_country_select_params.i18n_input_too_long_n.replace('%qty%', overChars);
|
467 |
+
},
|
468 |
+
inputTooShort: function (args) {
|
469 |
+
var remainingChars = args.minimum - args.input.length;
|
470 |
+
if (1 === remainingChars) {
|
471 |
+
return wc_country_select_params.i18n_input_too_short_1;
|
472 |
+
}
|
473 |
+
|
474 |
+
return wc_country_select_params.i18n_input_too_short_n.replace('%qty%', remainingChars);
|
475 |
+
},
|
476 |
+
loadingMore: function () {
|
477 |
+
return wc_country_select_params.i18n_load_more;
|
478 |
+
},
|
479 |
+
maximumSelected: function (args) {
|
480 |
+
if (args.maximum === 1) {
|
481 |
+
return wc_country_select_params.i18n_selection_too_long_1;
|
482 |
+
}
|
483 |
+
return wc_country_select_params.i18n_selection_too_long_n.replace('%qty%', args.maximum);
|
484 |
+
},
|
485 |
+
noResults: function () {
|
486 |
+
return wc_country_select_params.i18n_no_matches;
|
487 |
+
},
|
488 |
+
searching: function () {
|
489 |
+
return wc_country_select_params.i18n_searching;
|
490 |
+
}
|
491 |
+
}
|
492 |
+
};
|
493 |
+
};
|
494 |
+
|
495 |
+
var wooccm_enhanced_select = function () {
|
496 |
+
$('select.wooccm-enhanced-select').each(function () {
|
497 |
+
var select2_args = $.extend({
|
498 |
+
width: '100%',
|
499 |
+
placeholder: $(this).data('placeholder') || '',
|
500 |
+
allowClear: $(this).data('allowclear') || false,
|
501 |
+
selectOnClose: $(this).data('selectonclose') || false,
|
502 |
+
closeOnSelect: $(this).data('closeonselect') || false,
|
503 |
+
//forceAbove: $(this).data('forceabove') || false,
|
504 |
+
minimumResultsForSearch: $(this).data('search') || -1,
|
505 |
+
}, getEnhancedSelectFormatString());
|
506 |
+
$(this).on('select2:select', function () {
|
507 |
+
$(this).focus();
|
508 |
+
}).selectWoo(select2_args);
|
509 |
+
});
|
510 |
+
};
|
511 |
+
|
512 |
+
wooccm_enhanced_select();
|
513 |
+
|
514 |
+
}
|
515 |
+
|
516 |
})(jQuery);
|
assets/frontend/js/wooccm-order-upload.js
CHANGED
@@ -1,135 +1,135 @@
|
|
1 |
-
(function ($) {
|
2 |
-
|
3 |
-
var is_blocked = function ($node) {
|
4 |
-
return $node.is('.processing') || $node.parents('.processing').length;
|
5 |
-
};
|
6 |
-
var block = function ($node) {
|
7 |
-
if (!is_blocked($node)) {
|
8 |
-
$node.addClass('processing').block({
|
9 |
-
message: null,
|
10 |
-
overlayCSS: {
|
11 |
-
background: '#fff',
|
12 |
-
opacity: 0.6
|
13 |
-
}
|
14 |
-
});
|
15 |
-
}
|
16 |
-
};
|
17 |
-
var unblock = function ($node) {
|
18 |
-
$node.removeClass('processing').unblock();
|
19 |
-
};
|
20 |
-
|
21 |
-
$(document).ready(function ($) {
|
22 |
-
|
23 |
-
// Delete
|
24 |
-
// -------------------------------------------------------------------------
|
25 |
-
$(document).on('click', '.wooccm_delete_attachment', function (e) {
|
26 |
-
|
27 |
-
var $tr = $(this).closest('tr'),
|
28 |
-
attachment_id = $(this).data('attachment_id');
|
29 |
-
|
30 |
-
$tr.hide();
|
31 |
-
|
32 |
-
$('#wooccm_order_attachment_update').prop('disabled', false);
|
33 |
-
|
34 |
-
$('#delete_attachments_ids').val($('#delete_attachments_ids').val().replace(attachment_id, ''));
|
35 |
-
});
|
36 |
-
|
37 |
-
$(document).on('click', '#wooccm_order_attachment_update', function (e) {
|
38 |
-
|
39 |
-
$.ajax({
|
40 |
-
url: wooccm_upload.ajax_url,
|
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 |
-
$('.wooccm_upload_results').html(wooccm_upload.message.saving);
|
51 |
-
},
|
52 |
-
success: function (response) {
|
53 |
-
if (response.success) {
|
54 |
-
$('.wooccm_upload_results').html(wooccm_upload.message.deleted);
|
55 |
-
|
56 |
-
$('#wooccm_order_attachment_update').prop('disabled', true);
|
57 |
-
} else {
|
58 |
-
$('.wooccm_upload_results').html(response.data);
|
59 |
-
}
|
60 |
-
}
|
61 |
-
});
|
62 |
-
});
|
63 |
-
// Upload
|
64 |
-
// -------------------------------------------------------------------------
|
65 |
-
|
66 |
-
$(document).on('change', '#wooccm_order_attachment_upload', function (e) {
|
67 |
-
|
68 |
-
var data = false,
|
69 |
-
order_id = $(this).data('order_id');
|
70 |
-
|
71 |
-
if (window.FormData) {
|
72 |
-
data = new FormData();
|
73 |
-
}
|
74 |
-
|
75 |
-
var i = 0, len = this.files.length, img, reader, file;
|
76 |
-
for (; i < len; i++) {
|
77 |
-
file = this.files[i];
|
78 |
-
if (data) {
|
79 |
-
data.append('wooccm_order_attachment_upload[]', file);
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
/*
|
84 |
-
* filter file types
|
85 |
-
* var file_array = ' . wooccm_js_array($file_types) . ';
|
86 |
-
var wooempt = "' . implode(',', $file_types) . '";
|
87 |
-
|
88 |
-
for ( i = 0; i < length; i++ ) {
|
89 |
-
file = this.files[i];
|
90 |
-
for(x=0; x < ' . $number_of_types . '; x++){
|
91 |
-
if( !wooempt || file.type.match(file_array[x]) ) {
|
92 |
-
if (formdata) {
|
93 |
-
formdata.append("files_wooccm[]",file);
|
94 |
-
}
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}
|
98 |
-
*/
|
99 |
-
|
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.ajax_url,
|
108 |
-
type: 'POST',
|
109 |
-
cache: false,
|
110 |
-
data: data,
|
111 |
-
processData: false,
|
112 |
-
contentType: false,
|
113 |
-
beforeSend: function (response) {
|
114 |
-
|
115 |
-
$('.wooccm_upload_results').html(wooccm_upload.message.uploading);
|
116 |
-
|
117 |
-
block($('.wooccm_order_attachments_wrapper'));
|
118 |
-
},
|
119 |
-
success: function (response) {
|
120 |
-
|
121 |
-
if (response.success) {
|
122 |
-
$('.wooccm_order_attachments_wrapper').fadeOut();
|
123 |
-
$('.wooccm_order_attachments_wrapper').replaceWith($(response.data).fadeIn());
|
124 |
-
$('.wooccm_upload_results').html(wooccm_upload.message.success);
|
125 |
-
} else {
|
126 |
-
$('.wooccm_upload_results').html(response.data);
|
127 |
-
}
|
128 |
-
|
129 |
-
unblock($('.wooccm_order_attachments_wrapper'));
|
130 |
-
}
|
131 |
-
});
|
132 |
-
}
|
133 |
-
});
|
134 |
-
});
|
135 |
})(jQuery);
|
1 |
+
(function ($) {
|
2 |
+
|
3 |
+
var is_blocked = function ($node) {
|
4 |
+
return $node.is('.processing') || $node.parents('.processing').length;
|
5 |
+
};
|
6 |
+
var block = function ($node) {
|
7 |
+
if (!is_blocked($node)) {
|
8 |
+
$node.addClass('processing').block({
|
9 |
+
message: null,
|
10 |
+
overlayCSS: {
|
11 |
+
background: '#fff',
|
12 |
+
opacity: 0.6
|
13 |
+
}
|
14 |
+
});
|
15 |
+
}
|
16 |
+
};
|
17 |
+
var unblock = function ($node) {
|
18 |
+
$node.removeClass('processing').unblock();
|
19 |
+
};
|
20 |
+
|
21 |
+
$(document).ready(function ($) {
|
22 |
+
|
23 |
+
// Delete
|
24 |
+
// -------------------------------------------------------------------------
|
25 |
+
$(document).on('click', '.wooccm_delete_attachment', function (e) {
|
26 |
+
|
27 |
+
var $tr = $(this).closest('tr'),
|
28 |
+
attachment_id = $(this).data('attachment_id');
|
29 |
+
|
30 |
+
$tr.hide();
|
31 |
+
|
32 |
+
$('#wooccm_order_attachment_update').prop('disabled', false);
|
33 |
+
|
34 |
+
$('#delete_attachments_ids').val($('#delete_attachments_ids').val().replace(attachment_id, ''));
|
35 |
+
});
|
36 |
+
|
37 |
+
$(document).on('click', '#wooccm_order_attachment_update', function (e) {
|
38 |
+
|
39 |
+
$.ajax({
|
40 |
+
url: wooccm_upload.ajax_url,
|
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 |
+
$('.wooccm_upload_results').html(wooccm_upload.message.saving);
|
51 |
+
},
|
52 |
+
success: function (response) {
|
53 |
+
if (response.success) {
|
54 |
+
$('.wooccm_upload_results').html(wooccm_upload.message.deleted);
|
55 |
+
|
56 |
+
$('#wooccm_order_attachment_update').prop('disabled', true);
|
57 |
+
} else {
|
58 |
+
$('.wooccm_upload_results').html(response.data);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
});
|
62 |
+
});
|
63 |
+
// Upload
|
64 |
+
// -------------------------------------------------------------------------
|
65 |
+
|
66 |
+
$(document).on('change', '#wooccm_order_attachment_upload', function (e) {
|
67 |
+
|
68 |
+
var data = false,
|
69 |
+
order_id = $(this).data('order_id');
|
70 |
+
|
71 |
+
if (window.FormData) {
|
72 |
+
data = new FormData();
|
73 |
+
}
|
74 |
+
|
75 |
+
var i = 0, len = this.files.length, img, reader, file;
|
76 |
+
for (; i < len; i++) {
|
77 |
+
file = this.files[i];
|
78 |
+
if (data) {
|
79 |
+
data.append('wooccm_order_attachment_upload[]', file);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
/*
|
84 |
+
* filter file types
|
85 |
+
* var file_array = ' . wooccm_js_array($file_types) . ';
|
86 |
+
var wooempt = "' . implode(',', $file_types) . '";
|
87 |
+
|
88 |
+
for ( i = 0; i < length; i++ ) {
|
89 |
+
file = this.files[i];
|
90 |
+
for(x=0; x < ' . $number_of_types . '; x++){
|
91 |
+
if( !wooempt || file.type.match(file_array[x]) ) {
|
92 |
+
if (formdata) {
|
93 |
+
formdata.append("files_wooccm[]",file);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
*/
|
99 |
+
|
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.ajax_url,
|
108 |
+
type: 'POST',
|
109 |
+
cache: false,
|
110 |
+
data: data,
|
111 |
+
processData: false,
|
112 |
+
contentType: false,
|
113 |
+
beforeSend: function (response) {
|
114 |
+
|
115 |
+
$('.wooccm_upload_results').html(wooccm_upload.message.uploading);
|
116 |
+
|
117 |
+
block($('.wooccm_order_attachments_wrapper'));
|
118 |
+
},
|
119 |
+
success: function (response) {
|
120 |
+
|
121 |
+
if (response.success) {
|
122 |
+
$('.wooccm_order_attachments_wrapper').fadeOut();
|
123 |
+
$('.wooccm_order_attachments_wrapper').replaceWith($(response.data).fadeIn());
|
124 |
+
$('.wooccm_upload_results').html(wooccm_upload.message.success);
|
125 |
+
} else {
|
126 |
+
$('.wooccm_upload_results').html(response.data);
|
127 |
+
}
|
128 |
+
|
129 |
+
unblock($('.wooccm_order_attachments_wrapper'));
|
130 |
+
}
|
131 |
+
});
|
132 |
+
}
|
133 |
+
});
|
134 |
+
});
|
135 |
})(jQuery);
|
includes/class-wooccm-compatibility.php
CHANGED
@@ -1,415 +1,415 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Field_Compatibility {
|
4 |
-
|
5 |
-
protected $fields = null;
|
6 |
-
protected $prefix = '';
|
7 |
-
protected $option_name = '';
|
8 |
-
protected $defaults = array();
|
9 |
-
private $old_to_old_types = array(
|
10 |
-
'heading' => 'heading',
|
11 |
-
'text' => 'wooccmtext',
|
12 |
-
'textarea' => 'wooccmtextarea',
|
13 |
-
'password' => 'wooccmpassword',
|
14 |
-
'select' => 'wooccmselect',
|
15 |
-
'radio' => 'wooccmradio',
|
16 |
-
'checkbox' => 'checkbox_wccm',
|
17 |
-
//'button' => __('Button', 'woocommerce-checkout-manager'),
|
18 |
-
'country' => 'wooccmcountry',
|
19 |
-
'state' => 'wooccmstate',
|
20 |
-
'multiselect' => 'multiselect',
|
21 |
-
'multicheckbox' => 'multicheckbox',
|
22 |
-
'datepicker' => 'datepicker',
|
23 |
-
'timepicker' => 'time',
|
24 |
-
'colorpicker' => 'colorpicker',
|
25 |
-
'file' => 'wooccmupload',
|
26 |
-
);
|
27 |
-
private $old_to_old_args = array(
|
28 |
-
'disabled' => null,
|
29 |
-
'order' => null,
|
30 |
-
'priority' => null,
|
31 |
-
'name' => 'cow',
|
32 |
-
'type' => null,
|
33 |
-
'label' => null,
|
34 |
-
'placeholder' => null,
|
35 |
-
'default' => 'force_title2',
|
36 |
-
'position' => null,
|
37 |
-
'clear' => 'clear_row',
|
38 |
-
'options' => 'option_array',
|
39 |
-
'required' => 'checkbox',
|
40 |
-
// Display
|
41 |
-
// -------------------------------------------------------------------
|
42 |
-
'show_role' => 'role_option',
|
43 |
-
'hide_role' => 'role_option2',
|
44 |
-
'more_product' => 'more_content',
|
45 |
-
'show_product' => 'single_px',
|
46 |
-
'hide_product' => 'single_p',
|
47 |
-
'show_product_cat' => 'single_px_cat',
|
48 |
-
'hide_product_cat' => 'single_p_cat',
|
49 |
-
// Timing
|
50 |
-
// -------------------------------------------------------------------
|
51 |
-
'time_limit_start' => 'start_hour',
|
52 |
-
'time_limit_end' => 'end_hour',
|
53 |
-
'time_limit_interval' => 'interval_min',
|
54 |
-
'manual_min' => null,
|
55 |
-
'date_limit' => 'date_limit',
|
56 |
-
'date_limit_variable_min' => 'min_before',
|
57 |
-
'date_limit_variable_max' => 'max_after',
|
58 |
-
'date_limit_fixed_min' => null,
|
59 |
-
'date_limit_fixed_max' => null,
|
60 |
-
'date_limit_days' => null,
|
61 |
-
'single_dd' => null,
|
62 |
-
'single_mm' => null,
|
63 |
-
'single_yy' => null,
|
64 |
-
'single_max_dd' => null,
|
65 |
-
'single_max_mm' => null,
|
66 |
-
'single_max_yy' => null,
|
67 |
-
// Amount
|
68 |
-
// -------------------------------------------------------------------
|
69 |
-
'add_price' => null,
|
70 |
-
'add_price_name' => 'fee_name',
|
71 |
-
'add_price_total' => 'add_price_field',
|
72 |
-
'add_price_type' => null,
|
73 |
-
'add_price_tax' => 'tax_remove',
|
74 |
-
'extra_class' => null,
|
75 |
-
// Conditional
|
76 |
-
// -------------------------------------------------------------------
|
77 |
-
'conditional' => 'conditional_parent_use',
|
78 |
-
'conditional_parent_key' => 'conditional_tie',
|
79 |
-
'conditional_parent_value' => 'chosen_valt',
|
80 |
-
// Color
|
81 |
-
// -------------------------------------------------------------------
|
82 |
-
'pickertype' => 'colorpickertype',
|
83 |
-
// State
|
84 |
-
// -------------------------------------------------------------------
|
85 |
-
'country' => null,
|
86 |
-
// Upload
|
87 |
-
// -------------------------------------------------------------------
|
88 |
-
'file_limit' => null,
|
89 |
-
'file_types' => null,
|
90 |
-
// Listing
|
91 |
-
// -------------------------------------------------------------------
|
92 |
-
'listable' => null,
|
93 |
-
'sortable' => null,
|
94 |
-
'filterable' => null,
|
95 |
-
);
|
96 |
-
private $old_args = array(
|
97 |
-
'disabled',
|
98 |
-
'order',
|
99 |
-
'priority',
|
100 |
-
'cow',
|
101 |
-
'type',
|
102 |
-
'label',
|
103 |
-
'placeholder',
|
104 |
-
'force_title2',
|
105 |
-
'position',
|
106 |
-
'clear_row',
|
107 |
-
'option_array',
|
108 |
-
'checkbox',
|
109 |
-
'role_option',
|
110 |
-
'role_option2',
|
111 |
-
'more_content',
|
112 |
-
'single_p',
|
113 |
-
'single_px',
|
114 |
-
'single_p_cat',
|
115 |
-
'single_px_cat',
|
116 |
-
'start_hour',
|
117 |
-
'end_hour',
|
118 |
-
'interval_min',
|
119 |
-
'manual_min',
|
120 |
-
'min_before',
|
121 |
-
'max_after',
|
122 |
-
'single_dd',
|
123 |
-
'single_mm',
|
124 |
-
'single_yy',
|
125 |
-
'single_max_dd',
|
126 |
-
'single_max_mm',
|
127 |
-
'single_max_yy',
|
128 |
-
'days_disabler',
|
129 |
-
'days_disabler0',
|
130 |
-
'days_disabler1',
|
131 |
-
'days_disabler2',
|
132 |
-
'days_disabler3',
|
133 |
-
'days_disabler4',
|
134 |
-
'days_disabler5',
|
135 |
-
'days_disabler6',
|
136 |
-
'add_amount',
|
137 |
-
'fee_name',
|
138 |
-
'add_amount_field',
|
139 |
-
'tax_remove',
|
140 |
-
'conditional_parent_use',
|
141 |
-
'conditional_tie',
|
142 |
-
'chosen_valt',
|
143 |
-
'extra_class',
|
144 |
-
'colorpickertype',
|
145 |
-
'colorpickerd',
|
146 |
-
'role_options',
|
147 |
-
'role_options2',
|
148 |
-
'changenamep',
|
149 |
-
'changename',
|
150 |
-
// New
|
151 |
-
// -----------------------------------------------------------------------
|
152 |
-
'country',
|
153 |
-
'file_limit',
|
154 |
-
'file_types',
|
155 |
-
'listable',
|
156 |
-
'sortable',
|
157 |
-
'filterable',
|
158 |
-
);
|
159 |
-
protected static $_instance;
|
160 |
-
|
161 |
-
public function __construct() {
|
162 |
-
$this->init();
|
163 |
-
}
|
164 |
-
|
165 |
-
public static function instance() {
|
166 |
-
|
167 |
-
if (is_null(self::$_instance)) {
|
168 |
-
self::$_instance = new self();
|
169 |
-
}
|
170 |
-
return self::$_instance;
|
171 |
-
}
|
172 |
-
|
173 |
-
public function init() {
|
174 |
-
|
175 |
-
if (false === get_option('wooccm_billing', false) && $fields = $this->get_fields_new('wccs_settings3', 'billing')) {
|
176 |
-
update_option('wooccm_billing', $fields);
|
177 |
-
}
|
178 |
-
|
179 |
-
if (false === get_option('wooccm_shipping', false) && $fields = $this->get_fields_new('wccs_settings2', 'shipping')) {
|
180 |
-
update_option('wooccm_shipping', $fields);
|
181 |
-
}
|
182 |
-
|
183 |
-
if (false === get_option('wooccm_additional', false) && $fields = $this->get_fields_new('wccs_settings', 'additional')) {
|
184 |
-
update_option('wooccm_additional', $fields);
|
185 |
-
}
|
186 |
-
}
|
187 |
-
|
188 |
-
function replace_keys($array = array(), $replace = array()) {
|
189 |
-
|
190 |
-
foreach ($array as $key => $value) {
|
191 |
-
|
192 |
-
if (array_key_exists($key, $replace)) {
|
193 |
-
|
194 |
-
$array[$replace[$key]] = $value;
|
195 |
-
|
196 |
-
unset($array[$key]);
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
200 |
-
return $array;
|
201 |
-
}
|
202 |
-
|
203 |
-
function replace_value($value = '', $replace = array()) {
|
204 |
-
if (array_key_exists($value, $replace)) {
|
205 |
-
return $replace[$value];
|
206 |
-
}
|
207 |
-
|
208 |
-
return $value;
|
209 |
-
}
|
210 |
-
|
211 |
-
function string_to_array($value) {
|
212 |
-
|
213 |
-
if (!empty($value) && !is_array($value)) {
|
214 |
-
if (strpos($value, '||') !== false) {
|
215 |
-
$value = explode('||', $value);
|
216 |
-
} elseif (strpos($value, ',') !== false) {
|
217 |
-
$value = explode(',', $value);
|
218 |
-
} else {
|
219 |
-
$value = (array) $value;
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
-
return $value;
|
224 |
-
}
|
225 |
-
|
226 |
-
function array_to_string($value) {
|
227 |
-
|
228 |
-
if (is_array($value)) {
|
229 |
-
if (count($value)) {
|
230 |
-
$value = implode('||', $value);
|
231 |
-
} else {
|
232 |
-
$value = @$value[0];
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
return $value;
|
237 |
-
}
|
238 |
-
|
239 |
-
function get_new_args($field = array(), $prefix = '') {
|
240 |
-
|
241 |
-
$replace = array_flip(array_filter($this->old_to_old_args));
|
242 |
-
|
243 |
-
$field = $this->replace_keys($field, $replace);
|
244 |
-
|
245 |
-
$field = wp_parse_args($field, WOOCCM()->$prefix->get_args());
|
246 |
-
|
247 |
-
return $field;
|
248 |
-
}
|
249 |
-
|
250 |
-
function get_new_type($type = '') {
|
251 |
-
|
252 |
-
$replace = array_flip(array_filter($this->old_to_old_types));
|
253 |
-
|
254 |
-
$type = $this->replace_value($type, $replace);
|
255 |
-
|
256 |
-
return $type;
|
257 |
-
}
|
258 |
-
|
259 |
-
function new_panel_compatibility($field_id, $field = array(), $fields = array(), $prefix = '') {
|
260 |
-
|
261 |
-
$field = $this->get_new_args($field, $prefix);
|
262 |
-
|
263 |
-
$field = WOOCCM()->$prefix->sanitize_field($field_id, $field, $fields);
|
264 |
-
|
265 |
-
// options compatibility
|
266 |
-
if (!empty($field['options']) && is_string($field['options'])) {
|
267 |
-
|
268 |
-
if (strpos($field['options'], '||') !== false) {
|
269 |
-
|
270 |
-
$options = explode('||', $field['options']);
|
271 |
-
|
272 |
-
if (is_array($options)) {
|
273 |
-
|
274 |
-
$field['options'] = array();
|
275 |
-
// $i = 0;
|
276 |
-
foreach ($options as $key => $label) {
|
277 |
-
$field['options'][] = array(
|
278 |
-
'label' => $label,
|
279 |
-
'add_price_total' => 0,
|
280 |
-
'add_price_type' => 'fixed',
|
281 |
-
'add_price_tax' => 0,
|
282 |
-
'default' => ''
|
283 |
-
);
|
284 |
-
|
285 |
-
if (!empty($field['conditional_parent_value']) && $field['conditional_parent_value'] == $label) {
|
286 |
-
$field['conditional_parent_value'] = $label;
|
287 |
-
}
|
288 |
-
|
289 |
-
// $i++;
|
290 |
-
}
|
291 |
-
}
|
292 |
-
}
|
293 |
-
}
|
294 |
-
|
295 |
-
if (!empty($field['conditional_parent_key']) && isset($field['conditional_parent_value'])) {
|
296 |
-
if ($parent_id = WOOCCM()->$prefix->get_field_id($fields, 'key', $field['conditional_parent_key'])) {
|
297 |
-
if (isset($fields[$parent_id]) && !empty($fields[$parent_id]['options'])) {
|
298 |
-
$labels = array_column($fields[$parent_id]['options'], 'label');
|
299 |
-
|
300 |
-
if (isset($labels[$field['conditional_parent_value']])) {
|
301 |
-
|
302 |
-
$field['conditional_parent_value'] = $labels[$field['conditional_parent_value']];
|
303 |
-
}
|
304 |
-
}
|
305 |
-
}
|
306 |
-
}
|
307 |
-
|
308 |
-
if ($field['type'] == 'colorpicker' && !empty($field['colorpickerd'])) {
|
309 |
-
$field['default'] = $field['colorpickerd'];
|
310 |
-
}
|
311 |
-
|
312 |
-
$field['type'] = $this->get_new_type($field['type']);
|
313 |
-
|
314 |
-
$field['show_role'] = $this->string_to_array($field['show_role']);
|
315 |
-
$field['hide_role'] = $this->string_to_array($field['hide_role']);
|
316 |
-
$field['show_product'] = $this->string_to_array($field['show_product']);
|
317 |
-
$field['hide_product'] = $this->string_to_array($field['hide_product']);
|
318 |
-
$field['show_product_cat'] = $this->string_to_array($field['show_product_cat']);
|
319 |
-
$field['hide_product_cat'] = $this->string_to_array($field['hide_product_cat']);
|
320 |
-
$field['add_price_tax'] = !@$field['add_amount_tax'];
|
321 |
-
|
322 |
-
// Days
|
323 |
-
if (!empty($field['days_disabler'])) {
|
324 |
-
|
325 |
-
$field['date_limit_days'] = array();
|
326 |
-
|
327 |
-
for ($day_index = 0; $day_index <= 6; $day_index++) {
|
328 |
-
|
329 |
-
if (!empty($field['days_disabler' . $day_index])) {
|
330 |
-
$field['date_limit_days'][strval($day_index)] = strval($day_index);
|
331 |
-
unset($field['days_disabler' . $day_index]);
|
332 |
-
}
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
// Dates
|
337 |
-
if (!empty($field['single_yy']) && !empty($field['single_mm']) && !empty($field['single_dd'])) {
|
338 |
-
$field['date_limit_fixed_min'] = $field['single_yy'] . '-' . $field['single_mm'] . '-' . $field['single_dd'];
|
339 |
-
unset($field['single_yy']);
|
340 |
-
unset($field['single_mm']);
|
341 |
-
unset($field['single_dd']);
|
342 |
-
} else {
|
343 |
-
$field['date_limit_fixed_min'] = '';
|
344 |
-
}
|
345 |
-
if (!empty($field['single_max_yy']) && !empty($field['single_max_mm']) && !empty($field['single_max_dd'])) {
|
346 |
-
$field['date_limit_fixed_max'] = $field['single_max_yy'] . '-' . $field['single_max_mm'] . '-' . $field['single_max_dd'];
|
347 |
-
unset($field['single_max_yy']);
|
348 |
-
unset($field['single_max_mm']);
|
349 |
-
unset($field['single_max_dd']);
|
350 |
-
} else {
|
351 |
-
$field['date_limit_fixed_max'] = '';
|
352 |
-
}
|
353 |
-
|
354 |
-
//return $field;
|
355 |
-
return WOOCCM()->$prefix->sanitize_field_data(array_intersect_key($field, array_flip(array_keys(WOOCCM()->$prefix->get_args()))));
|
356 |
-
}
|
357 |
-
|
358 |
-
protected function get_fields_new($name, $prefix = '') {
|
359 |
-
|
360 |
-
if ($fields = $this->get_option_old($name, $prefix)) {
|
361 |
-
|
362 |
-
$defaults = WOOCCM()->$prefix->get_default_fields();
|
363 |
-
|
364 |
-
foreach ($fields as $field_id => $field) {
|
365 |
-
|
366 |
-
$field = $this->new_panel_compatibility($field_id, $field, $fields, $prefix);
|
367 |
-
|
368 |
-
// if (count($defaults) && $default_id = @max(array_keys(array_column($defaults, 'key'), $field['key']))) {
|
369 |
-
if (count($defaults) && $default_id = WOOCCM()->$prefix->get_field_id($defaults, 'key', $field['key'])) {
|
370 |
-
|
371 |
-
if (isset($defaults[$default_id])) {
|
372 |
-
|
373 |
-
unset($field['type']);
|
374 |
-
|
375 |
-
unset($field['class']);
|
376 |
-
|
377 |
-
$field = wp_parse_args($field, $defaults[$default_id]);
|
378 |
-
}
|
379 |
-
}
|
380 |
-
|
381 |
-
$fields[$field_id] = $field;
|
382 |
-
}
|
383 |
-
|
384 |
-
return $fields;
|
385 |
-
}
|
386 |
-
|
387 |
-
return false;
|
388 |
-
}
|
389 |
-
|
390 |
-
// Core
|
391 |
-
// -------------------------------------------------------------------------
|
392 |
-
|
393 |
-
protected function get_option_old($name, $prefix) {
|
394 |
-
|
395 |
-
if ($fields = get_option($name)) {
|
396 |
-
|
397 |
-
// Compatibility with 4.x
|
398 |
-
// ---------------------------------------------------------------------
|
399 |
-
if (array_key_exists("{$prefix}_buttons", $fields)) {
|
400 |
-
$fields = $fields["{$prefix}_buttons"];
|
401 |
-
}
|
402 |
-
|
403 |
-
// Additional compatibility with 4.x
|
404 |
-
// ---------------------------------------------------------------------
|
405 |
-
if ('wccs_settings' == $name) {
|
406 |
-
$fields = (array) @$fields['buttons'];
|
407 |
-
}
|
408 |
-
}
|
409 |
-
|
410 |
-
return $fields;
|
411 |
-
}
|
412 |
-
|
413 |
-
}
|
414 |
-
|
415 |
-
WOOCCM_Field_Compatibility::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Field_Compatibility {
|
4 |
+
|
5 |
+
protected $fields = null;
|
6 |
+
protected $prefix = '';
|
7 |
+
protected $option_name = '';
|
8 |
+
protected $defaults = array();
|
9 |
+
private $old_to_old_types = array(
|
10 |
+
'heading' => 'heading',
|
11 |
+
'text' => 'wooccmtext',
|
12 |
+
'textarea' => 'wooccmtextarea',
|
13 |
+
'password' => 'wooccmpassword',
|
14 |
+
'select' => 'wooccmselect',
|
15 |
+
'radio' => 'wooccmradio',
|
16 |
+
'checkbox' => 'checkbox_wccm',
|
17 |
+
//'button' => __('Button', 'woocommerce-checkout-manager'),
|
18 |
+
'country' => 'wooccmcountry',
|
19 |
+
'state' => 'wooccmstate',
|
20 |
+
'multiselect' => 'multiselect',
|
21 |
+
'multicheckbox' => 'multicheckbox',
|
22 |
+
'datepicker' => 'datepicker',
|
23 |
+
'timepicker' => 'time',
|
24 |
+
'colorpicker' => 'colorpicker',
|
25 |
+
'file' => 'wooccmupload',
|
26 |
+
);
|
27 |
+
private $old_to_old_args = array(
|
28 |
+
'disabled' => null,
|
29 |
+
'order' => null,
|
30 |
+
'priority' => null,
|
31 |
+
'name' => 'cow',
|
32 |
+
'type' => null,
|
33 |
+
'label' => null,
|
34 |
+
'placeholder' => null,
|
35 |
+
'default' => 'force_title2',
|
36 |
+
'position' => null,
|
37 |
+
'clear' => 'clear_row',
|
38 |
+
'options' => 'option_array',
|
39 |
+
'required' => 'checkbox',
|
40 |
+
// Display
|
41 |
+
// -------------------------------------------------------------------
|
42 |
+
'show_role' => 'role_option',
|
43 |
+
'hide_role' => 'role_option2',
|
44 |
+
'more_product' => 'more_content',
|
45 |
+
'show_product' => 'single_px',
|
46 |
+
'hide_product' => 'single_p',
|
47 |
+
'show_product_cat' => 'single_px_cat',
|
48 |
+
'hide_product_cat' => 'single_p_cat',
|
49 |
+
// Timing
|
50 |
+
// -------------------------------------------------------------------
|
51 |
+
'time_limit_start' => 'start_hour',
|
52 |
+
'time_limit_end' => 'end_hour',
|
53 |
+
'time_limit_interval' => 'interval_min',
|
54 |
+
'manual_min' => null,
|
55 |
+
'date_limit' => 'date_limit',
|
56 |
+
'date_limit_variable_min' => 'min_before',
|
57 |
+
'date_limit_variable_max' => 'max_after',
|
58 |
+
'date_limit_fixed_min' => null,
|
59 |
+
'date_limit_fixed_max' => null,
|
60 |
+
'date_limit_days' => null,
|
61 |
+
'single_dd' => null,
|
62 |
+
'single_mm' => null,
|
63 |
+
'single_yy' => null,
|
64 |
+
'single_max_dd' => null,
|
65 |
+
'single_max_mm' => null,
|
66 |
+
'single_max_yy' => null,
|
67 |
+
// Amount
|
68 |
+
// -------------------------------------------------------------------
|
69 |
+
'add_price' => null,
|
70 |
+
'add_price_name' => 'fee_name',
|
71 |
+
'add_price_total' => 'add_price_field',
|
72 |
+
'add_price_type' => null,
|
73 |
+
'add_price_tax' => 'tax_remove',
|
74 |
+
'extra_class' => null,
|
75 |
+
// Conditional
|
76 |
+
// -------------------------------------------------------------------
|
77 |
+
'conditional' => 'conditional_parent_use',
|
78 |
+
'conditional_parent_key' => 'conditional_tie',
|
79 |
+
'conditional_parent_value' => 'chosen_valt',
|
80 |
+
// Color
|
81 |
+
// -------------------------------------------------------------------
|
82 |
+
'pickertype' => 'colorpickertype',
|
83 |
+
// State
|
84 |
+
// -------------------------------------------------------------------
|
85 |
+
'country' => null,
|
86 |
+
// Upload
|
87 |
+
// -------------------------------------------------------------------
|
88 |
+
'file_limit' => null,
|
89 |
+
'file_types' => null,
|
90 |
+
// Listing
|
91 |
+
// -------------------------------------------------------------------
|
92 |
+
'listable' => null,
|
93 |
+
'sortable' => null,
|
94 |
+
'filterable' => null,
|
95 |
+
);
|
96 |
+
private $old_args = array(
|
97 |
+
'disabled',
|
98 |
+
'order',
|
99 |
+
'priority',
|
100 |
+
'cow',
|
101 |
+
'type',
|
102 |
+
'label',
|
103 |
+
'placeholder',
|
104 |
+
'force_title2',
|
105 |
+
'position',
|
106 |
+
'clear_row',
|
107 |
+
'option_array',
|
108 |
+
'checkbox',
|
109 |
+
'role_option',
|
110 |
+
'role_option2',
|
111 |
+
'more_content',
|
112 |
+
'single_p',
|
113 |
+
'single_px',
|
114 |
+
'single_p_cat',
|
115 |
+
'single_px_cat',
|
116 |
+
'start_hour',
|
117 |
+
'end_hour',
|
118 |
+
'interval_min',
|
119 |
+
'manual_min',
|
120 |
+
'min_before',
|
121 |
+
'max_after',
|
122 |
+
'single_dd',
|
123 |
+
'single_mm',
|
124 |
+
'single_yy',
|
125 |
+
'single_max_dd',
|
126 |
+
'single_max_mm',
|
127 |
+
'single_max_yy',
|
128 |
+
'days_disabler',
|
129 |
+
'days_disabler0',
|
130 |
+
'days_disabler1',
|
131 |
+
'days_disabler2',
|
132 |
+
'days_disabler3',
|
133 |
+
'days_disabler4',
|
134 |
+
'days_disabler5',
|
135 |
+
'days_disabler6',
|
136 |
+
'add_amount',
|
137 |
+
'fee_name',
|
138 |
+
'add_amount_field',
|
139 |
+
'tax_remove',
|
140 |
+
'conditional_parent_use',
|
141 |
+
'conditional_tie',
|
142 |
+
'chosen_valt',
|
143 |
+
'extra_class',
|
144 |
+
'colorpickertype',
|
145 |
+
'colorpickerd',
|
146 |
+
'role_options',
|
147 |
+
'role_options2',
|
148 |
+
'changenamep',
|
149 |
+
'changename',
|
150 |
+
// New
|
151 |
+
// -----------------------------------------------------------------------
|
152 |
+
'country',
|
153 |
+
'file_limit',
|
154 |
+
'file_types',
|
155 |
+
'listable',
|
156 |
+
'sortable',
|
157 |
+
'filterable',
|
158 |
+
);
|
159 |
+
protected static $_instance;
|
160 |
+
|
161 |
+
public function __construct() {
|
162 |
+
$this->init();
|
163 |
+
}
|
164 |
+
|
165 |
+
public static function instance() {
|
166 |
+
|
167 |
+
if (is_null(self::$_instance)) {
|
168 |
+
self::$_instance = new self();
|
169 |
+
}
|
170 |
+
return self::$_instance;
|
171 |
+
}
|
172 |
+
|
173 |
+
public function init() {
|
174 |
+
|
175 |
+
if (false === get_option('wooccm_billing', false) && $fields = $this->get_fields_new('wccs_settings3', 'billing')) {
|
176 |
+
update_option('wooccm_billing', $fields);
|
177 |
+
}
|
178 |
+
|
179 |
+
if (false === get_option('wooccm_shipping', false) && $fields = $this->get_fields_new('wccs_settings2', 'shipping')) {
|
180 |
+
update_option('wooccm_shipping', $fields);
|
181 |
+
}
|
182 |
+
|
183 |
+
if (false === get_option('wooccm_additional', false) && $fields = $this->get_fields_new('wccs_settings', 'additional')) {
|
184 |
+
update_option('wooccm_additional', $fields);
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
+
function replace_keys($array = array(), $replace = array()) {
|
189 |
+
|
190 |
+
foreach ($array as $key => $value) {
|
191 |
+
|
192 |
+
if (array_key_exists($key, $replace)) {
|
193 |
+
|
194 |
+
$array[$replace[$key]] = $value;
|
195 |
+
|
196 |
+
unset($array[$key]);
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
return $array;
|
201 |
+
}
|
202 |
+
|
203 |
+
function replace_value($value = '', $replace = array()) {
|
204 |
+
if (array_key_exists($value, $replace)) {
|
205 |
+
return $replace[$value];
|
206 |
+
}
|
207 |
+
|
208 |
+
return $value;
|
209 |
+
}
|
210 |
+
|
211 |
+
function string_to_array($value) {
|
212 |
+
|
213 |
+
if (!empty($value) && !is_array($value)) {
|
214 |
+
if (strpos($value, '||') !== false) {
|
215 |
+
$value = explode('||', $value);
|
216 |
+
} elseif (strpos($value, ',') !== false) {
|
217 |
+
$value = explode(',', $value);
|
218 |
+
} else {
|
219 |
+
$value = (array) $value;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
return $value;
|
224 |
+
}
|
225 |
+
|
226 |
+
function array_to_string($value) {
|
227 |
+
|
228 |
+
if (is_array($value)) {
|
229 |
+
if (count($value)) {
|
230 |
+
$value = implode('||', $value);
|
231 |
+
} else {
|
232 |
+
$value = @$value[0];
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
return $value;
|
237 |
+
}
|
238 |
+
|
239 |
+
function get_new_args($field = array(), $prefix = '') {
|
240 |
+
|
241 |
+
$replace = array_flip(array_filter($this->old_to_old_args));
|
242 |
+
|
243 |
+
$field = $this->replace_keys($field, $replace);
|
244 |
+
|
245 |
+
$field = wp_parse_args($field, WOOCCM()->$prefix->get_args());
|
246 |
+
|
247 |
+
return $field;
|
248 |
+
}
|
249 |
+
|
250 |
+
function get_new_type($type = '') {
|
251 |
+
|
252 |
+
$replace = array_flip(array_filter($this->old_to_old_types));
|
253 |
+
|
254 |
+
$type = $this->replace_value($type, $replace);
|
255 |
+
|
256 |
+
return $type;
|
257 |
+
}
|
258 |
+
|
259 |
+
function new_panel_compatibility($field_id, $field = array(), $fields = array(), $prefix = '') {
|
260 |
+
|
261 |
+
$field = $this->get_new_args($field, $prefix);
|
262 |
+
|
263 |
+
$field = WOOCCM()->$prefix->sanitize_field($field_id, $field, $fields);
|
264 |
+
|
265 |
+
// options compatibility
|
266 |
+
if (!empty($field['options']) && is_string($field['options'])) {
|
267 |
+
|
268 |
+
if (strpos($field['options'], '||') !== false) {
|
269 |
+
|
270 |
+
$options = explode('||', $field['options']);
|
271 |
+
|
272 |
+
if (is_array($options)) {
|
273 |
+
|
274 |
+
$field['options'] = array();
|
275 |
+
// $i = 0;
|
276 |
+
foreach ($options as $key => $label) {
|
277 |
+
$field['options'][] = array(
|
278 |
+
'label' => $label,
|
279 |
+
'add_price_total' => 0,
|
280 |
+
'add_price_type' => 'fixed',
|
281 |
+
'add_price_tax' => 0,
|
282 |
+
'default' => ''
|
283 |
+
);
|
284 |
+
|
285 |
+
if (!empty($field['conditional_parent_value']) && $field['conditional_parent_value'] == $label) {
|
286 |
+
$field['conditional_parent_value'] = $label;
|
287 |
+
}
|
288 |
+
|
289 |
+
// $i++;
|
290 |
+
}
|
291 |
+
}
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
if (!empty($field['conditional_parent_key']) && isset($field['conditional_parent_value'])) {
|
296 |
+
if ($parent_id = WOOCCM()->$prefix->get_field_id($fields, 'key', $field['conditional_parent_key'])) {
|
297 |
+
if (isset($fields[$parent_id]) && !empty($fields[$parent_id]['options'])) {
|
298 |
+
$labels = array_column($fields[$parent_id]['options'], 'label');
|
299 |
+
|
300 |
+
if (isset($labels[$field['conditional_parent_value']])) {
|
301 |
+
|
302 |
+
$field['conditional_parent_value'] = $labels[$field['conditional_parent_value']];
|
303 |
+
}
|
304 |
+
}
|
305 |
+
}
|
306 |
+
}
|
307 |
+
|
308 |
+
if ($field['type'] == 'colorpicker' && !empty($field['colorpickerd'])) {
|
309 |
+
$field['default'] = $field['colorpickerd'];
|
310 |
+
}
|
311 |
+
|
312 |
+
$field['type'] = $this->get_new_type($field['type']);
|
313 |
+
|
314 |
+
$field['show_role'] = $this->string_to_array($field['show_role']);
|
315 |
+
$field['hide_role'] = $this->string_to_array($field['hide_role']);
|
316 |
+
$field['show_product'] = $this->string_to_array($field['show_product']);
|
317 |
+
$field['hide_product'] = $this->string_to_array($field['hide_product']);
|
318 |
+
$field['show_product_cat'] = $this->string_to_array($field['show_product_cat']);
|
319 |
+
$field['hide_product_cat'] = $this->string_to_array($field['hide_product_cat']);
|
320 |
+
$field['add_price_tax'] = !@$field['add_amount_tax'];
|
321 |
+
|
322 |
+
// Days
|
323 |
+
if (!empty($field['days_disabler'])) {
|
324 |
+
|
325 |
+
$field['date_limit_days'] = array();
|
326 |
+
|
327 |
+
for ($day_index = 0; $day_index <= 6; $day_index++) {
|
328 |
+
|
329 |
+
if (!empty($field['days_disabler' . $day_index])) {
|
330 |
+
$field['date_limit_days'][strval($day_index)] = strval($day_index);
|
331 |
+
unset($field['days_disabler' . $day_index]);
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
|
336 |
+
// Dates
|
337 |
+
if (!empty($field['single_yy']) && !empty($field['single_mm']) && !empty($field['single_dd'])) {
|
338 |
+
$field['date_limit_fixed_min'] = $field['single_yy'] . '-' . $field['single_mm'] . '-' . $field['single_dd'];
|
339 |
+
unset($field['single_yy']);
|
340 |
+
unset($field['single_mm']);
|
341 |
+
unset($field['single_dd']);
|
342 |
+
} else {
|
343 |
+
$field['date_limit_fixed_min'] = '';
|
344 |
+
}
|
345 |
+
if (!empty($field['single_max_yy']) && !empty($field['single_max_mm']) && !empty($field['single_max_dd'])) {
|
346 |
+
$field['date_limit_fixed_max'] = $field['single_max_yy'] . '-' . $field['single_max_mm'] . '-' . $field['single_max_dd'];
|
347 |
+
unset($field['single_max_yy']);
|
348 |
+
unset($field['single_max_mm']);
|
349 |
+
unset($field['single_max_dd']);
|
350 |
+
} else {
|
351 |
+
$field['date_limit_fixed_max'] = '';
|
352 |
+
}
|
353 |
+
|
354 |
+
//return $field;
|
355 |
+
return WOOCCM()->$prefix->sanitize_field_data(array_intersect_key($field, array_flip(array_keys(WOOCCM()->$prefix->get_args()))));
|
356 |
+
}
|
357 |
+
|
358 |
+
protected function get_fields_new($name, $prefix = '') {
|
359 |
+
|
360 |
+
if ($fields = $this->get_option_old($name, $prefix)) {
|
361 |
+
|
362 |
+
$defaults = WOOCCM()->$prefix->get_default_fields();
|
363 |
+
|
364 |
+
foreach ($fields as $field_id => $field) {
|
365 |
+
|
366 |
+
$field = $this->new_panel_compatibility($field_id, $field, $fields, $prefix);
|
367 |
+
|
368 |
+
// if (count($defaults) && $default_id = @max(array_keys(array_column($defaults, 'key'), $field['key']))) {
|
369 |
+
if (count($defaults) && $default_id = WOOCCM()->$prefix->get_field_id($defaults, 'key', $field['key'])) {
|
370 |
+
|
371 |
+
if (isset($defaults[$default_id])) {
|
372 |
+
|
373 |
+
unset($field['type']);
|
374 |
+
|
375 |
+
unset($field['class']);
|
376 |
+
|
377 |
+
$field = wp_parse_args($field, $defaults[$default_id]);
|
378 |
+
}
|
379 |
+
}
|
380 |
+
|
381 |
+
$fields[$field_id] = $field;
|
382 |
+
}
|
383 |
+
|
384 |
+
return $fields;
|
385 |
+
}
|
386 |
+
|
387 |
+
return false;
|
388 |
+
}
|
389 |
+
|
390 |
+
// Core
|
391 |
+
// -------------------------------------------------------------------------
|
392 |
+
|
393 |
+
protected function get_option_old($name, $prefix) {
|
394 |
+
|
395 |
+
if ($fields = get_option($name)) {
|
396 |
+
|
397 |
+
// Compatibility with 4.x
|
398 |
+
// ---------------------------------------------------------------------
|
399 |
+
if (array_key_exists("{$prefix}_buttons", $fields)) {
|
400 |
+
$fields = $fields["{$prefix}_buttons"];
|
401 |
+
}
|
402 |
+
|
403 |
+
// Additional compatibility with 4.x
|
404 |
+
// ---------------------------------------------------------------------
|
405 |
+
if ('wccs_settings' == $name) {
|
406 |
+
$fields = (array) @$fields['buttons'];
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
return $fields;
|
411 |
+
}
|
412 |
+
|
413 |
+
}
|
414 |
+
|
415 |
+
WOOCCM_Field_Compatibility::instance();
|
includes/class-wooccm-install.php
CHANGED
@@ -1,92 +1,92 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Install {
|
4 |
-
|
5 |
-
public static function install() {
|
6 |
-
|
7 |
-
// Check if we are not already running this routine.
|
8 |
-
if ('yes' === get_transient('wooccm_installing')) {
|
9 |
-
return;
|
10 |
-
}
|
11 |
-
|
12 |
-
// If we made it till here nothing is running yet, lets set the transient now.
|
13 |
-
set_transient('wooccm_installing', 'yes', MINUTE_IN_SECONDS * 10);
|
14 |
-
set_transient('wooccm-first-rating', true, MONTH_IN_SECONDS);
|
15 |
-
|
16 |
-
//wooccm_install();
|
17 |
-
}
|
18 |
-
|
19 |
-
public static function update() {
|
20 |
-
|
21 |
-
if (!get_option('wooccm_billing', false)) {
|
22 |
-
update_option(WOOCCM()->billing->get_fields());
|
23 |
-
}
|
24 |
-
|
25 |
-
if (!get_option('wooccm_shipping', false)) {
|
26 |
-
update_option(WOOCCM()->shipping->get_fields());
|
27 |
-
}
|
28 |
-
|
29 |
-
if (!get_option('wooccm_additional', false)) {
|
30 |
-
update_option(WOOCCM()->additional->get_fields());
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
-
public static function old_panel_compatibility($field_id, $field = array()) {
|
35 |
-
|
36 |
-
$field = $this->get_old_args($field);
|
37 |
-
|
38 |
-
$field = wp_parse_args($field, array_fill_keys($this->old_args, null));
|
39 |
-
|
40 |
-
if (!is_numeric($field['order'])) {
|
41 |
-
$field['order'] = $field_id + 1;
|
42 |
-
}
|
43 |
-
|
44 |
-
$field['type'] = $this->get_old_type($field['type']);
|
45 |
-
|
46 |
-
if (empty($field['position']) && isset($field['class'])) {
|
47 |
-
if ($position = $this->array_to_string(array_intersect((array) $field['class'], array('form-row-wide', 'form-row-first', 'form-row-last')))) {
|
48 |
-
$field['position'] = $position;
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
$field['role_option'] = $this->array_to_string($field['role_option']);
|
53 |
-
$field['role_option2'] = $this->array_to_string($field['role_option2']);
|
54 |
-
//$field['option_array'] = $this->array_to_string($field['option_array']);
|
55 |
-
$field['single_p'] = $this->array_to_string($field['single_p']);
|
56 |
-
$field['single_px'] = $this->array_to_string($field['single_px']);
|
57 |
-
$field['single_p_cat'] = $this->array_to_string($field['single_p_cat']);
|
58 |
-
$field['single_px_cat'] = $this->array_to_string($field['single_px_cat']);
|
59 |
-
$field['tax_remove'] = !$field['tax_remove'];
|
60 |
-
|
61 |
-
// Days
|
62 |
-
if (is_array($field['days_disabler'])) {
|
63 |
-
foreach ($field['days_disabler'] as $day_index => $day) {
|
64 |
-
$field['days_disabler' . strval($day_index)] = 1;
|
65 |
-
}
|
66 |
-
$field['days_disabler'] = 1;
|
67 |
-
unset($field['date_limit_days']);
|
68 |
-
}
|
69 |
-
|
70 |
-
// Dates
|
71 |
-
if (!empty($field['date_limit_fixed_min'])) {
|
72 |
-
|
73 |
-
$min = explode('-', $field['date_limit_fixed_min']);
|
74 |
-
|
75 |
-
$field['single_yy'] = $min[0];
|
76 |
-
$field['single_mm'] = $min[1];
|
77 |
-
$field['single_dd'] = $min[2];
|
78 |
-
}
|
79 |
-
|
80 |
-
if (!empty($field['date_limit_fixed_max'])) {
|
81 |
-
|
82 |
-
$max = explode('-', $field['date_limit_fixed_max']);
|
83 |
-
|
84 |
-
$field['single_max_yy'] = $max[0];
|
85 |
-
$field['single_max_mm'] = $max[1];
|
86 |
-
$field['single_max_dd'] = $max[2];
|
87 |
-
}
|
88 |
-
|
89 |
-
return array_intersect_key($field, array_flip($this->old_args));
|
90 |
-
}
|
91 |
-
|
92 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Install {
|
4 |
+
|
5 |
+
public static function install() {
|
6 |
+
|
7 |
+
// Check if we are not already running this routine.
|
8 |
+
if ('yes' === get_transient('wooccm_installing')) {
|
9 |
+
return;
|
10 |
+
}
|
11 |
+
|
12 |
+
// If we made it till here nothing is running yet, lets set the transient now.
|
13 |
+
set_transient('wooccm_installing', 'yes', MINUTE_IN_SECONDS * 10);
|
14 |
+
set_transient('wooccm-first-rating', true, MONTH_IN_SECONDS);
|
15 |
+
|
16 |
+
//wooccm_install();
|
17 |
+
}
|
18 |
+
|
19 |
+
public static function update() {
|
20 |
+
|
21 |
+
if (!get_option('wooccm_billing', false)) {
|
22 |
+
update_option(WOOCCM()->billing->get_fields());
|
23 |
+
}
|
24 |
+
|
25 |
+
if (!get_option('wooccm_shipping', false)) {
|
26 |
+
update_option(WOOCCM()->shipping->get_fields());
|
27 |
+
}
|
28 |
+
|
29 |
+
if (!get_option('wooccm_additional', false)) {
|
30 |
+
update_option(WOOCCM()->additional->get_fields());
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
public static function old_panel_compatibility($field_id, $field = array()) {
|
35 |
+
|
36 |
+
$field = $this->get_old_args($field);
|
37 |
+
|
38 |
+
$field = wp_parse_args($field, array_fill_keys($this->old_args, null));
|
39 |
+
|
40 |
+
if (!is_numeric($field['order'])) {
|
41 |
+
$field['order'] = $field_id + 1;
|
42 |
+
}
|
43 |
+
|
44 |
+
$field['type'] = $this->get_old_type($field['type']);
|
45 |
+
|
46 |
+
if (empty($field['position']) && isset($field['class'])) {
|
47 |
+
if ($position = $this->array_to_string(array_intersect((array) $field['class'], array('form-row-wide', 'form-row-first', 'form-row-last')))) {
|
48 |
+
$field['position'] = $position;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
$field['role_option'] = $this->array_to_string($field['role_option']);
|
53 |
+
$field['role_option2'] = $this->array_to_string($field['role_option2']);
|
54 |
+
//$field['option_array'] = $this->array_to_string($field['option_array']);
|
55 |
+
$field['single_p'] = $this->array_to_string($field['single_p']);
|
56 |
+
$field['single_px'] = $this->array_to_string($field['single_px']);
|
57 |
+
$field['single_p_cat'] = $this->array_to_string($field['single_p_cat']);
|
58 |
+
$field['single_px_cat'] = $this->array_to_string($field['single_px_cat']);
|
59 |
+
$field['tax_remove'] = !$field['tax_remove'];
|
60 |
+
|
61 |
+
// Days
|
62 |
+
if (is_array($field['days_disabler'])) {
|
63 |
+
foreach ($field['days_disabler'] as $day_index => $day) {
|
64 |
+
$field['days_disabler' . strval($day_index)] = 1;
|
65 |
+
}
|
66 |
+
$field['days_disabler'] = 1;
|
67 |
+
unset($field['date_limit_days']);
|
68 |
+
}
|
69 |
+
|
70 |
+
// Dates
|
71 |
+
if (!empty($field['date_limit_fixed_min'])) {
|
72 |
+
|
73 |
+
$min = explode('-', $field['date_limit_fixed_min']);
|
74 |
+
|
75 |
+
$field['single_yy'] = $min[0];
|
76 |
+
$field['single_mm'] = $min[1];
|
77 |
+
$field['single_dd'] = $min[2];
|
78 |
+
}
|
79 |
+
|
80 |
+
if (!empty($field['date_limit_fixed_max'])) {
|
81 |
+
|
82 |
+
$max = explode('-', $field['date_limit_fixed_max']);
|
83 |
+
|
84 |
+
$field['single_max_yy'] = $max[0];
|
85 |
+
$field['single_max_mm'] = $max[1];
|
86 |
+
$field['single_max_dd'] = $max[2];
|
87 |
+
}
|
88 |
+
|
89 |
+
return array_intersect_key($field, array_flip($this->old_args));
|
90 |
+
}
|
91 |
+
|
92 |
+
}
|
includes/class-wooccm-notices.php
CHANGED
@@ -1,166 +1,166 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Notices {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
private function init() {
|
19 |
-
add_action('wp_ajax_wooccm_dismiss_notice', array($this, 'ajax_dismiss_notice'));
|
20 |
-
add_action('admin_notices', array($this, 'add_notices'));
|
21 |
-
add_filter('plugin_action_links_' . plugin_basename(WOOCCM_PLUGIN_FILE), array($this, 'add_action_links'));
|
22 |
-
}
|
23 |
-
|
24 |
-
public function ajax_dismiss_notice() {
|
25 |
-
|
26 |
-
if (check_admin_referer('wooccm_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
|
27 |
-
|
28 |
-
$notice_id = sanitize_key($_REQUEST['notice_id']);
|
29 |
-
|
30 |
-
update_user_meta(get_current_user_id(), $notice_id, true);
|
31 |
-
|
32 |
-
wp_send_json($notice_id);
|
33 |
-
}
|
34 |
-
|
35 |
-
wp_die();
|
36 |
-
}
|
37 |
-
|
38 |
-
public function add_notices() {
|
39 |
-
|
40 |
-
if (!get_user_meta(get_current_user_id(), 'wooccm-beta-notice', true) && get_option('wccs_settings')) {
|
41 |
-
?>
|
42 |
-
<div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-beta-notice">
|
43 |
-
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
44 |
-
<div class="notice-image">
|
45 |
-
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
|
46 |
-
</div>
|
47 |
-
<div class="notice-content" style="margin-left: 15px;">
|
48 |
-
<p>
|
49 |
-
<h3>Hello! the new admin panel is here!</h3>
|
50 |
-
</p>
|
51 |
-
<p>
|
52 |
-
As you know, we've recently acquired this plugin and we've been working very hard to bring you a quality product.
|
53 |
-
</p>
|
54 |
-
<p>
|
55 |
-
Finally, we're glad to introduce you to the new admin panel available in the WooCommerce > Checkout dashboard.
|
56 |
-
</p>
|
57 |
-
<p>
|
58 |
-
The entire panel has been rebuilt and now each field has its own modal of settings. Also, conditional relationships have been simplified.
|
59 |
-
</p>
|
60 |
-
<p>
|
61 |
-
This has been a titanic task and we were forced to remove some settings. We want to apologies to you if you experience some issues in the last couple of updates or even in this one. :)
|
62 |
-
</p>
|
63 |
-
<p>
|
64 |
-
Don't hesitate to contact us to report any issue or join our community to be in touch.
|
65 |
-
</p>
|
66 |
-
<p>
|
67 |
-
We wish you the best! and good luck with your sales! The QuadLayers team.
|
68 |
-
</p>
|
69 |
-
<p>
|
70 |
-
<a href="<?php echo esc_url(WOOCCM_GROUP_URL); ?>" class="button-primary" target="_blank">
|
71 |
-
<?php esc_html_e('Join Community!', 'woocommerce-checkout-manager'); ?>
|
72 |
-
</a>
|
73 |
-
<a href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
74 |
-
<?php esc_html_e('Report a bug', 'woocommerce-checkout-manager'); ?>
|
75 |
-
</a>
|
76 |
-
<a style="margin-left: 10px;" href="https://quadlayers.com/?utm_source=wooccm_admin" target="_blank">
|
77 |
-
<?php esc_html_e('About us', 'woocommerce-checkout-manager'); ?>
|
78 |
-
</a>
|
79 |
-
</p>
|
80 |
-
</div>
|
81 |
-
</div>
|
82 |
-
</div>
|
83 |
-
<?php
|
84 |
-
} elseif (!get_user_meta(get_current_user_id(), 'wooccm-user-rating', true) && !get_transient('wooccm-first-rating') && !get_option('wccs_settings')) {
|
85 |
-
?>
|
86 |
-
<div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-user-rating">
|
87 |
-
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
88 |
-
<div class="notice-image">
|
89 |
-
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
|
90 |
-
</div>
|
91 |
-
<div class="notice-content" style="margin-left: 15px;">
|
92 |
-
<p>
|
93 |
-
<?php printf(esc_html__('Hello! We\'ve recently acquired this plugin!', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
|
94 |
-
<br/>
|
95 |
-
<?php esc_html_e('We will do our best to improve it and include new features gradually. Please be patient and let us know about the issues and improvements that you want to see in this plugin.', 'woocommerce-checkout-manager'); ?>
|
96 |
-
</p>
|
97 |
-
<a href="<?php echo esc_url(WOOCCM_GROUP_URL); ?>" class="button-primary" target="_blank">
|
98 |
-
<?php esc_html_e('Join Community!', 'woocommerce-checkout-manager'); ?>
|
99 |
-
</a>
|
100 |
-
<a href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
101 |
-
<?php esc_html_e('Report a bug', 'woocommerce-checkout-manager'); ?>
|
102 |
-
</a>
|
103 |
-
<a style="margin-left: 10px;" href="https://quadlayers.com/?utm_source=wooccm_admin" target="_blank">
|
104 |
-
<?php esc_html_e('About us', 'woocommerce-checkout-manager'); ?>
|
105 |
-
</a>
|
106 |
-
</div>
|
107 |
-
</div>
|
108 |
-
</div>
|
109 |
-
<?php } elseif (!get_user_meta(get_current_user_id(), 'wooccm-update-5', true)) { ?>
|
110 |
-
<div id="wooccm-update-5" class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-update-5">
|
111 |
-
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
112 |
-
<div class="notice-image">
|
113 |
-
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
|
114 |
-
</div>
|
115 |
-
<div class="notice-content" style="margin-left: 15px;">
|
116 |
-
<p>
|
117 |
-
<b><?php printf(esc_html__('Important! Manual update is required.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?></b>
|
118 |
-
<br/>
|
119 |
-
<?php esc_html_e('Due to the recent WooCommerce 4.0 changes it is necessary to reconfigure conditional fields. If you have conditional fields, please go to the billing, shipping and advanced sections and set conditionals relationships again.', 'woocommerce-checkout-manager'); ?>
|
120 |
-
</p>
|
121 |
-
<a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm'); ?>" class="button-primary" target="_blank">
|
122 |
-
<?php esc_html_e('Settings', 'woocommerce-checkout-manager'); ?>
|
123 |
-
</a>
|
124 |
-
<a href="<?php echo str_replace('/?utm_source=wooccm_admin', '/conditional/?utm_source=wooccm_admin', WOOCCM_DOCUMENTATION_URL); ?>" class="button-secondary" target="_blank">
|
125 |
-
<?php esc_html_e('Documentation', 'woocommerce-checkout-manager'); ?>
|
126 |
-
</a>
|
127 |
-
</div>
|
128 |
-
</div>
|
129 |
-
</div>
|
130 |
-
<?php
|
131 |
-
}
|
132 |
-
?>
|
133 |
-
<script>
|
134 |
-
(function ($) {
|
135 |
-
$('.wooccm-notice').on('click', '.notice-dismiss', function (e) {
|
136 |
-
e.preventDefault();
|
137 |
-
var notice_id = $(e.delegateTarget).data('notice_id');
|
138 |
-
$.ajax({
|
139 |
-
type: 'POST',
|
140 |
-
url: ajaxurl,
|
141 |
-
data: {
|
142 |
-
notice_id: notice_id,
|
143 |
-
action: 'wooccm_dismiss_notice',
|
144 |
-
nonce: '<?php echo wp_create_nonce('wooccm_dismiss_notice'); ?>'
|
145 |
-
},
|
146 |
-
success: function (response) {
|
147 |
-
console.log(response);
|
148 |
-
},
|
149 |
-
});
|
150 |
-
});
|
151 |
-
})(jQuery);
|
152 |
-
</script>
|
153 |
-
<?php
|
154 |
-
}
|
155 |
-
|
156 |
-
public function add_action_links($links) {
|
157 |
-
|
158 |
-
$links[] = '<a target="_blank" href="' . WOOCCM_PURCHASE_URL . '">' . esc_html__('Premium', 'woocommerce-checkout-manager') . '</a>';
|
159 |
-
$links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(WOOCCM_PREFIX)) . '">' . esc_html__('Settings', 'woocommerce-checkout-manager') . '</a>';
|
160 |
-
|
161 |
-
return $links;
|
162 |
-
}
|
163 |
-
|
164 |
-
}
|
165 |
-
|
166 |
-
WOOCCM_Notices::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Notices {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
private function init() {
|
19 |
+
add_action('wp_ajax_wooccm_dismiss_notice', array($this, 'ajax_dismiss_notice'));
|
20 |
+
add_action('admin_notices', array($this, 'add_notices'));
|
21 |
+
add_filter('plugin_action_links_' . plugin_basename(WOOCCM_PLUGIN_FILE), array($this, 'add_action_links'));
|
22 |
+
}
|
23 |
+
|
24 |
+
public function ajax_dismiss_notice() {
|
25 |
+
|
26 |
+
if (check_admin_referer('wooccm_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
|
27 |
+
|
28 |
+
$notice_id = sanitize_key($_REQUEST['notice_id']);
|
29 |
+
|
30 |
+
update_user_meta(get_current_user_id(), $notice_id, true);
|
31 |
+
|
32 |
+
wp_send_json($notice_id);
|
33 |
+
}
|
34 |
+
|
35 |
+
wp_die();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function add_notices() {
|
39 |
+
|
40 |
+
if (!get_user_meta(get_current_user_id(), 'wooccm-beta-notice', true) && get_option('wccs_settings')) {
|
41 |
+
?>
|
42 |
+
<div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-beta-notice">
|
43 |
+
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
44 |
+
<div class="notice-image">
|
45 |
+
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
|
46 |
+
</div>
|
47 |
+
<div class="notice-content" style="margin-left: 15px;">
|
48 |
+
<p>
|
49 |
+
<h3>Hello! the new admin panel is here!</h3>
|
50 |
+
</p>
|
51 |
+
<p>
|
52 |
+
As you know, we've recently acquired this plugin and we've been working very hard to bring you a quality product.
|
53 |
+
</p>
|
54 |
+
<p>
|
55 |
+
Finally, we're glad to introduce you to the new admin panel available in the WooCommerce > Checkout dashboard.
|
56 |
+
</p>
|
57 |
+
<p>
|
58 |
+
The entire panel has been rebuilt and now each field has its own modal of settings. Also, conditional relationships have been simplified.
|
59 |
+
</p>
|
60 |
+
<p>
|
61 |
+
This has been a titanic task and we were forced to remove some settings. We want to apologies to you if you experience some issues in the last couple of updates or even in this one. :)
|
62 |
+
</p>
|
63 |
+
<p>
|
64 |
+
Don't hesitate to contact us to report any issue or join our community to be in touch.
|
65 |
+
</p>
|
66 |
+
<p>
|
67 |
+
We wish you the best! and good luck with your sales! The QuadLayers team.
|
68 |
+
</p>
|
69 |
+
<p>
|
70 |
+
<a href="<?php echo esc_url(WOOCCM_GROUP_URL); ?>" class="button-primary" target="_blank">
|
71 |
+
<?php esc_html_e('Join Community!', 'woocommerce-checkout-manager'); ?>
|
72 |
+
</a>
|
73 |
+
<a href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
74 |
+
<?php esc_html_e('Report a bug', 'woocommerce-checkout-manager'); ?>
|
75 |
+
</a>
|
76 |
+
<a style="margin-left: 10px;" href="https://quadlayers.com/?utm_source=wooccm_admin" target="_blank">
|
77 |
+
<?php esc_html_e('About us', 'woocommerce-checkout-manager'); ?>
|
78 |
+
</a>
|
79 |
+
</p>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
<?php
|
84 |
+
} elseif (!get_user_meta(get_current_user_id(), 'wooccm-user-rating', true) && !get_transient('wooccm-first-rating') && !get_option('wccs_settings')) {
|
85 |
+
?>
|
86 |
+
<div class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-user-rating">
|
87 |
+
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
88 |
+
<div class="notice-image">
|
89 |
+
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
|
90 |
+
</div>
|
91 |
+
<div class="notice-content" style="margin-left: 15px;">
|
92 |
+
<p>
|
93 |
+
<?php printf(esc_html__('Hello! We\'ve recently acquired this plugin!', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?>
|
94 |
+
<br/>
|
95 |
+
<?php esc_html_e('We will do our best to improve it and include new features gradually. Please be patient and let us know about the issues and improvements that you want to see in this plugin.', 'woocommerce-checkout-manager'); ?>
|
96 |
+
</p>
|
97 |
+
<a href="<?php echo esc_url(WOOCCM_GROUP_URL); ?>" class="button-primary" target="_blank">
|
98 |
+
<?php esc_html_e('Join Community!', 'woocommerce-checkout-manager'); ?>
|
99 |
+
</a>
|
100 |
+
<a href="<?php echo esc_url(WOOCCM_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
101 |
+
<?php esc_html_e('Report a bug', 'woocommerce-checkout-manager'); ?>
|
102 |
+
</a>
|
103 |
+
<a style="margin-left: 10px;" href="https://quadlayers.com/?utm_source=wooccm_admin" target="_blank">
|
104 |
+
<?php esc_html_e('About us', 'woocommerce-checkout-manager'); ?>
|
105 |
+
</a>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
<?php } elseif (!get_user_meta(get_current_user_id(), 'wooccm-update-5', true)) { ?>
|
110 |
+
<div id="wooccm-update-5" class="wooccm-notice notice is-dismissible" data-notice_id="wooccm-update-5">
|
111 |
+
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
112 |
+
<div class="notice-image">
|
113 |
+
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', WOOCCM_PLUGIN_FILE); ?>" alt="<?php echo esc_html(WOOCCM_PLUGIN_NAME); ?>>">
|
114 |
+
</div>
|
115 |
+
<div class="notice-content" style="margin-left: 15px;">
|
116 |
+
<p>
|
117 |
+
<b><?php printf(esc_html__('Important! Manual update is required.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?></b>
|
118 |
+
<br/>
|
119 |
+
<?php esc_html_e('Due to the recent WooCommerce 4.0 changes it is necessary to reconfigure conditional fields. If you have conditional fields, please go to the billing, shipping and advanced sections and set conditionals relationships again.', 'woocommerce-checkout-manager'); ?>
|
120 |
+
</p>
|
121 |
+
<a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm'); ?>" class="button-primary" target="_blank">
|
122 |
+
<?php esc_html_e('Settings', 'woocommerce-checkout-manager'); ?>
|
123 |
+
</a>
|
124 |
+
<a href="<?php echo str_replace('/?utm_source=wooccm_admin', '/conditional/?utm_source=wooccm_admin', WOOCCM_DOCUMENTATION_URL); ?>" class="button-secondary" target="_blank">
|
125 |
+
<?php esc_html_e('Documentation', 'woocommerce-checkout-manager'); ?>
|
126 |
+
</a>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
<?php
|
131 |
+
}
|
132 |
+
?>
|
133 |
+
<script>
|
134 |
+
(function ($) {
|
135 |
+
$('.wooccm-notice').on('click', '.notice-dismiss', function (e) {
|
136 |
+
e.preventDefault();
|
137 |
+
var notice_id = $(e.delegateTarget).data('notice_id');
|
138 |
+
$.ajax({
|
139 |
+
type: 'POST',
|
140 |
+
url: ajaxurl,
|
141 |
+
data: {
|
142 |
+
notice_id: notice_id,
|
143 |
+
action: 'wooccm_dismiss_notice',
|
144 |
+
nonce: '<?php echo wp_create_nonce('wooccm_dismiss_notice'); ?>'
|
145 |
+
},
|
146 |
+
success: function (response) {
|
147 |
+
console.log(response);
|
148 |
+
},
|
149 |
+
});
|
150 |
+
});
|
151 |
+
})(jQuery);
|
152 |
+
</script>
|
153 |
+
<?php
|
154 |
+
}
|
155 |
+
|
156 |
+
public function add_action_links($links) {
|
157 |
+
|
158 |
+
$links[] = '<a target="_blank" href="' . WOOCCM_PURCHASE_URL . '">' . esc_html__('Premium', 'woocommerce-checkout-manager') . '</a>';
|
159 |
+
$links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(WOOCCM_PREFIX)) . '">' . esc_html__('Settings', 'woocommerce-checkout-manager') . '</a>';
|
160 |
+
|
161 |
+
return $links;
|
162 |
+
}
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
WOOCCM_Notices::instance();
|
includes/class-wooccm-suggestions-list-table.php
CHANGED
@@ -1,140 +1,140 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
require_once( ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php' );
|
4 |
-
|
5 |
-
class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
|
6 |
-
|
7 |
-
public $promote = array(
|
8 |
-
'woocommerce-direct-checkout',
|
9 |
-
'perfect-woocommerce-brands',
|
10 |
-
'wp-whatsapp-chat',
|
11 |
-
'wp-tiktok-feed',
|
12 |
-
'insta-gallery',
|
13 |
-
'quadmenu',
|
14 |
-
);
|
15 |
-
|
16 |
-
private function remove_plugins($plugins) {
|
17 |
-
|
18 |
-
$promote = array();
|
19 |
-
|
20 |
-
foreach ($this->promote as $order => $slug) {
|
21 |
-
|
22 |
-
if ($id = @max(array_keys(array_column($plugins, 'slug'), $slug))) {
|
23 |
-
|
24 |
-
$promote[] = $plugins[$id];
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
return $promote;
|
29 |
-
}
|
30 |
-
|
31 |
-
public function self_admin_url($url, $path) {
|
32 |
-
|
33 |
-
if (strpos($url, 'tab=plugin-information') !== false) {
|
34 |
-
$url = network_admin_url($path);
|
35 |
-
}
|
36 |
-
|
37 |
-
return $url;
|
38 |
-
}
|
39 |
-
|
40 |
-
public function network_admin_url($url, $path) {
|
41 |
-
|
42 |
-
if (strpos($url, 'plugins.php') !== false) {
|
43 |
-
$url = self_admin_url($path);
|
44 |
-
}
|
45 |
-
|
46 |
-
return $url;
|
47 |
-
}
|
48 |
-
|
49 |
-
public function display_rows() {
|
50 |
-
add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
|
51 |
-
add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
|
52 |
-
parent::display_rows();
|
53 |
-
}
|
54 |
-
|
55 |
-
public function is_connected() {
|
56 |
-
|
57 |
-
global $wp_version;
|
58 |
-
|
59 |
-
$http_args = array(
|
60 |
-
'timeout' => 15,
|
61 |
-
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
|
62 |
-
);
|
63 |
-
|
64 |
-
return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
|
65 |
-
}
|
66 |
-
|
67 |
-
public function get_plugins() {
|
68 |
-
|
69 |
-
$tk = WOOCCM_PREFIX . '_suggestions_plugins';
|
70 |
-
|
71 |
-
$plugins = get_transient($tk);
|
72 |
-
|
73 |
-
if ($plugins === false) {
|
74 |
-
|
75 |
-
$args = array(
|
76 |
-
'per_page' => 36,
|
77 |
-
'author' => 'quadlayers',
|
78 |
-
'locale' => get_user_locale(),
|
79 |
-
);
|
80 |
-
|
81 |
-
$api = plugins_api('query_plugins', $args);
|
82 |
-
|
83 |
-
if (!is_wp_error($api)) {
|
84 |
-
|
85 |
-
$plugins = $this->remove_plugins($api->plugins);
|
86 |
-
|
87 |
-
set_transient($tk, $plugins, 24 * HOUR_IN_SECONDS);
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
return $plugins;
|
92 |
-
}
|
93 |
-
|
94 |
-
public function prepare_items() {
|
95 |
-
|
96 |
-
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
|
97 |
-
|
98 |
-
global $tabs, $tab;
|
99 |
-
|
100 |
-
wp_enqueue_style('thickbox');
|
101 |
-
wp_enqueue_script('plugin-install');
|
102 |
-
wp_enqueue_script('thickbox');
|
103 |
-
wp_enqueue_script('updates');
|
104 |
-
wp_localize_script('updates', 'pagenow', 'plugin-install-network');
|
105 |
-
|
106 |
-
wp_reset_vars(array('tab'));
|
107 |
-
|
108 |
-
$tabs = array();
|
109 |
-
|
110 |
-
if ('search' === $tab) {
|
111 |
-
$tabs['search'] = __('Search Results');
|
112 |
-
}
|
113 |
-
if ($tab === 'beta' || false !== strpos(get_bloginfo('version'), '-')) {
|
114 |
-
$tabs['beta'] = _x('Beta Testing', 'Plugin Installer');
|
115 |
-
}
|
116 |
-
$tabs['featured'] = _x('Featured', 'Plugin Installer');
|
117 |
-
$tabs['popular'] = _x('Popular', 'Plugin Installer');
|
118 |
-
$tabs['recommended'] = _x('Recommended', 'Plugin Installer');
|
119 |
-
$tabs['favorites'] = _x('Favorites', 'Plugin Installer');
|
120 |
-
|
121 |
-
$nonmenu_tabs = array('plugin-information'); // Valid actions to perform which do not have a Menu item.
|
122 |
-
|
123 |
-
$tabs = apply_filters('install_plugins_tabs', $tabs);
|
124 |
-
|
125 |
-
$nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
|
126 |
-
|
127 |
-
// If a non-valid menu tab has been selected, And it's not a non-menu action.
|
128 |
-
if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs) )) {
|
129 |
-
$tab = key($tabs);
|
130 |
-
}
|
131 |
-
|
132 |
-
$this->items = $this->get_plugins();
|
133 |
-
|
134 |
-
|
135 |
-
wp_localize_script('updates', '_wpUpdatesItemCounts', array(
|
136 |
-
'totals' => wp_get_update_data())
|
137 |
-
);
|
138 |
-
}
|
139 |
-
|
140 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php' );
|
4 |
+
|
5 |
+
class WOOCCM_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
|
6 |
+
|
7 |
+
public $promote = array(
|
8 |
+
'woocommerce-direct-checkout',
|
9 |
+
'perfect-woocommerce-brands',
|
10 |
+
'wp-whatsapp-chat',
|
11 |
+
'wp-tiktok-feed',
|
12 |
+
'insta-gallery',
|
13 |
+
'quadmenu',
|
14 |
+
);
|
15 |
+
|
16 |
+
private function remove_plugins($plugins) {
|
17 |
+
|
18 |
+
$promote = array();
|
19 |
+
|
20 |
+
foreach ($this->promote as $order => $slug) {
|
21 |
+
|
22 |
+
if ($id = @max(array_keys(array_column($plugins, 'slug'), $slug))) {
|
23 |
+
|
24 |
+
$promote[] = $plugins[$id];
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
return $promote;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function self_admin_url($url, $path) {
|
32 |
+
|
33 |
+
if (strpos($url, 'tab=plugin-information') !== false) {
|
34 |
+
$url = network_admin_url($path);
|
35 |
+
}
|
36 |
+
|
37 |
+
return $url;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function network_admin_url($url, $path) {
|
41 |
+
|
42 |
+
if (strpos($url, 'plugins.php') !== false) {
|
43 |
+
$url = self_admin_url($path);
|
44 |
+
}
|
45 |
+
|
46 |
+
return $url;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function display_rows() {
|
50 |
+
add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
|
51 |
+
add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
|
52 |
+
parent::display_rows();
|
53 |
+
}
|
54 |
+
|
55 |
+
public function is_connected() {
|
56 |
+
|
57 |
+
global $wp_version;
|
58 |
+
|
59 |
+
$http_args = array(
|
60 |
+
'timeout' => 15,
|
61 |
+
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
|
62 |
+
);
|
63 |
+
|
64 |
+
return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
|
65 |
+
}
|
66 |
+
|
67 |
+
public function get_plugins() {
|
68 |
+
|
69 |
+
$tk = WOOCCM_PREFIX . '_suggestions_plugins';
|
70 |
+
|
71 |
+
$plugins = get_transient($tk);
|
72 |
+
|
73 |
+
if ($plugins === false) {
|
74 |
+
|
75 |
+
$args = array(
|
76 |
+
'per_page' => 36,
|
77 |
+
'author' => 'quadlayers',
|
78 |
+
'locale' => get_user_locale(),
|
79 |
+
);
|
80 |
+
|
81 |
+
$api = plugins_api('query_plugins', $args);
|
82 |
+
|
83 |
+
if (!is_wp_error($api)) {
|
84 |
+
|
85 |
+
$plugins = $this->remove_plugins($api->plugins);
|
86 |
+
|
87 |
+
set_transient($tk, $plugins, 24 * HOUR_IN_SECONDS);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
return $plugins;
|
92 |
+
}
|
93 |
+
|
94 |
+
public function prepare_items() {
|
95 |
+
|
96 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
|
97 |
+
|
98 |
+
global $tabs, $tab;
|
99 |
+
|
100 |
+
wp_enqueue_style('thickbox');
|
101 |
+
wp_enqueue_script('plugin-install');
|
102 |
+
wp_enqueue_script('thickbox');
|
103 |
+
wp_enqueue_script('updates');
|
104 |
+
wp_localize_script('updates', 'pagenow', 'plugin-install-network');
|
105 |
+
|
106 |
+
wp_reset_vars(array('tab'));
|
107 |
+
|
108 |
+
$tabs = array();
|
109 |
+
|
110 |
+
if ('search' === $tab) {
|
111 |
+
$tabs['search'] = __('Search Results');
|
112 |
+
}
|
113 |
+
if ($tab === 'beta' || false !== strpos(get_bloginfo('version'), '-')) {
|
114 |
+
$tabs['beta'] = _x('Beta Testing', 'Plugin Installer');
|
115 |
+
}
|
116 |
+
$tabs['featured'] = _x('Featured', 'Plugin Installer');
|
117 |
+
$tabs['popular'] = _x('Popular', 'Plugin Installer');
|
118 |
+
$tabs['recommended'] = _x('Recommended', 'Plugin Installer');
|
119 |
+
$tabs['favorites'] = _x('Favorites', 'Plugin Installer');
|
120 |
+
|
121 |
+
$nonmenu_tabs = array('plugin-information'); // Valid actions to perform which do not have a Menu item.
|
122 |
+
|
123 |
+
$tabs = apply_filters('install_plugins_tabs', $tabs);
|
124 |
+
|
125 |
+
$nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
|
126 |
+
|
127 |
+
// If a non-valid menu tab has been selected, And it's not a non-menu action.
|
128 |
+
if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs) )) {
|
129 |
+
$tab = key($tabs);
|
130 |
+
}
|
131 |
+
|
132 |
+
$this->items = $this->get_plugins();
|
133 |
+
|
134 |
+
|
135 |
+
wp_localize_script('updates', '_wpUpdatesItemCounts', array(
|
136 |
+
'totals' => wp_get_update_data())
|
137 |
+
);
|
138 |
+
}
|
139 |
+
|
140 |
+
}
|
includes/class-wooccm-upload.php
CHANGED
@@ -1,159 +1,159 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Upload {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
protected function process_uploads($files, $key, $post_id = 0) {
|
19 |
-
|
20 |
-
if (!function_exists('media_handle_upload')) {
|
21 |
-
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
22 |
-
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
23 |
-
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
24 |
-
}
|
25 |
-
|
26 |
-
$attachment_ids = array();
|
27 |
-
|
28 |
-
add_filter('upload_dir', function( $param ) {
|
29 |
-
$param['path'] = sprintf('%s/wooccm_uploads', $param['basedir']);
|
30 |
-
$param['url'] = sprintf('%s/wooccm_uploads', $param['baseurl']);
|
31 |
-
return $param;
|
32 |
-
}, 10);
|
33 |
-
|
34 |
-
foreach ($files['name'] as $id => $value) {
|
35 |
-
|
36 |
-
if ($files['name'][$id]) {
|
37 |
-
|
38 |
-
$_FILES[$key] = array(
|
39 |
-
'name' => $files['name'][$id],
|
40 |
-
'type' => $files['type'][$id],
|
41 |
-
'tmp_name' => $files['tmp_name'][$id],
|
42 |
-
'error' => $files['error'][$id],
|
43 |
-
'size' => $files['size'][$id]
|
44 |
-
);
|
45 |
-
|
46 |
-
if (!is_wp_error($attachment_id = media_handle_upload($key, $post_id))) {
|
47 |
-
$attachment_ids[] = $attachment_id;
|
48 |
-
} else {
|
49 |
-
wc_add_notice($attachment_id->get_error_message(), 'error');
|
50 |
-
wp_send_json_error($attachment_id->get_error_message());
|
51 |
-
}
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
return $attachment_ids;
|
56 |
-
}
|
57 |
-
|
58 |
-
public function ajax_delete_attachment() {
|
59 |
-
|
60 |
-
if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
|
61 |
-
|
62 |
-
$array1 = explode(',', sanitize_text_field(isset($_REQUEST['all_attachments_ids']) ? $_REQUEST['all_attachments_ids'] : '' ));
|
63 |
-
$array2 = explode(',', sanitize_text_field(isset($_REQUEST['delete_attachments_ids']) ? $_REQUEST['delete_attachments_ids'] : '' ));
|
64 |
-
|
65 |
-
if (empty($array1) || empty($array2)) {
|
66 |
-
wp_send_json_error(esc_html__('No attachment selected.', 'woocommerce-checkout-manager'));
|
67 |
-
}
|
68 |
-
|
69 |
-
$attachment_ids = array_diff($array1, $array2);
|
70 |
-
|
71 |
-
if (!empty($attachment_ids)) {
|
72 |
-
|
73 |
-
foreach ($attachment_ids as $key => $attachtoremove) {
|
74 |
-
|
75 |
-
// Check the Attachment exists...
|
76 |
-
if (get_post_status($attachtoremove) == false)
|
77 |
-
continue;
|
78 |
-
|
79 |
-
// Check the Attachment is associated with an Order
|
80 |
-
$post_parent = get_post_field('post_parent', $attachtoremove);
|
81 |
-
|
82 |
-
if (empty($post_parent)) {
|
83 |
-
continue;
|
84 |
-
} else {
|
85 |
-
if (get_post_type($post_parent) <> 'shop_order')
|
86 |
-
continue;
|
87 |
-
}
|
88 |
-
wp_delete_attachment($attachtoremove);
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
wp_send_json_success('Deleted successfully.', 'woocommerce-checkout-manager');
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
public function ajax_checkout_attachment_upload() {
|
97 |
-
|
98 |
-
if (check_admin_referer('wooccm_upload', 'nonce') && isset($_FILES['wooccm_checkout_attachment_upload'])) {
|
99 |
-
|
100 |
-
$files = $_FILES['wooccm_checkout_attachment_upload'];
|
101 |
-
|
102 |
-
if (empty($files)) {
|
103 |
-
wc_add_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
|
104 |
-
wp_send_json_error();
|
105 |
-
}
|
106 |
-
|
107 |
-
if (count($attachment_ids = $this->process_uploads($files, 'wooccm_checkout_attachment_upload'))) {
|
108 |
-
wp_send_json_success($attachment_ids);
|
109 |
-
}
|
110 |
-
wc_add_notice(esc_html__('Unknow error.', 'woocommerce-checkout-manager'), 'error');
|
111 |
-
wp_send_json_error();
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
public function update_attachment_ids($order_id = 0) {
|
116 |
-
|
117 |
-
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
118 |
-
|
119 |
-
if (count($checkout = WC()->checkout->get_checkout_fields())) {
|
120 |
-
|
121 |
-
foreach ($checkout as $field_type => $fields) {
|
122 |
-
|
123 |
-
foreach ($fields as $key => $field) {
|
124 |
-
|
125 |
-
if ($field['type'] == 'file') {
|
126 |
-
|
127 |
-
if ($attachments = get_post_meta($order_id, sprintf('_%s', $key), true)) {
|
128 |
-
|
129 |
-
if ($attachments = (array) explode(',', $attachments)) {
|
130 |
-
|
131 |
-
foreach ($attachments as $image_id) {
|
132 |
-
|
133 |
-
wp_update_post(array('ID' => $image_id, 'post_parent' => $order_id));
|
134 |
-
|
135 |
-
wp_update_attachment_metadata($image_id, wp_generate_attachment_metadata($image_id, get_attached_file($image_id)));
|
136 |
-
}
|
137 |
-
}
|
138 |
-
}
|
139 |
-
}
|
140 |
-
}
|
141 |
-
}
|
142 |
-
}
|
143 |
-
}
|
144 |
-
|
145 |
-
public function init() {
|
146 |
-
add_action('wp_ajax_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
|
147 |
-
add_action('wp_ajax_nopriv_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
|
148 |
-
|
149 |
-
// Checkout
|
150 |
-
// -----------------------------------------------------------------------
|
151 |
-
add_action('wp_ajax_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
|
152 |
-
add_action('wp_ajax_nopriv_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
|
153 |
-
add_action('woocommerce_checkout_update_order_meta', array($this, 'update_attachment_ids'), 99);
|
154 |
-
// }
|
155 |
-
}
|
156 |
-
|
157 |
-
}
|
158 |
-
|
159 |
-
WOOCCM_Upload::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Upload {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
protected function process_uploads($files, $key, $post_id = 0) {
|
19 |
+
|
20 |
+
if (!function_exists('media_handle_upload')) {
|
21 |
+
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
22 |
+
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
23 |
+
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
24 |
+
}
|
25 |
+
|
26 |
+
$attachment_ids = array();
|
27 |
+
|
28 |
+
add_filter('upload_dir', function( $param ) {
|
29 |
+
$param['path'] = sprintf('%s/wooccm_uploads', $param['basedir']);
|
30 |
+
$param['url'] = sprintf('%s/wooccm_uploads', $param['baseurl']);
|
31 |
+
return $param;
|
32 |
+
}, 10);
|
33 |
+
|
34 |
+
foreach ($files['name'] as $id => $value) {
|
35 |
+
|
36 |
+
if ($files['name'][$id]) {
|
37 |
+
|
38 |
+
$_FILES[$key] = array(
|
39 |
+
'name' => $files['name'][$id],
|
40 |
+
'type' => $files['type'][$id],
|
41 |
+
'tmp_name' => $files['tmp_name'][$id],
|
42 |
+
'error' => $files['error'][$id],
|
43 |
+
'size' => $files['size'][$id]
|
44 |
+
);
|
45 |
+
|
46 |
+
if (!is_wp_error($attachment_id = media_handle_upload($key, $post_id))) {
|
47 |
+
$attachment_ids[] = $attachment_id;
|
48 |
+
} else {
|
49 |
+
wc_add_notice($attachment_id->get_error_message(), 'error');
|
50 |
+
wp_send_json_error($attachment_id->get_error_message());
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
return $attachment_ids;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function ajax_delete_attachment() {
|
59 |
+
|
60 |
+
if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
|
61 |
+
|
62 |
+
$array1 = explode(',', sanitize_text_field(isset($_REQUEST['all_attachments_ids']) ? $_REQUEST['all_attachments_ids'] : '' ));
|
63 |
+
$array2 = explode(',', sanitize_text_field(isset($_REQUEST['delete_attachments_ids']) ? $_REQUEST['delete_attachments_ids'] : '' ));
|
64 |
+
|
65 |
+
if (empty($array1) || empty($array2)) {
|
66 |
+
wp_send_json_error(esc_html__('No attachment selected.', 'woocommerce-checkout-manager'));
|
67 |
+
}
|
68 |
+
|
69 |
+
$attachment_ids = array_diff($array1, $array2);
|
70 |
+
|
71 |
+
if (!empty($attachment_ids)) {
|
72 |
+
|
73 |
+
foreach ($attachment_ids as $key => $attachtoremove) {
|
74 |
+
|
75 |
+
// Check the Attachment exists...
|
76 |
+
if (get_post_status($attachtoremove) == false)
|
77 |
+
continue;
|
78 |
+
|
79 |
+
// Check the Attachment is associated with an Order
|
80 |
+
$post_parent = get_post_field('post_parent', $attachtoremove);
|
81 |
+
|
82 |
+
if (empty($post_parent)) {
|
83 |
+
continue;
|
84 |
+
} else {
|
85 |
+
if (get_post_type($post_parent) <> 'shop_order')
|
86 |
+
continue;
|
87 |
+
}
|
88 |
+
wp_delete_attachment($attachtoremove);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
wp_send_json_success('Deleted successfully.', 'woocommerce-checkout-manager');
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
public function ajax_checkout_attachment_upload() {
|
97 |
+
|
98 |
+
if (check_admin_referer('wooccm_upload', 'nonce') && isset($_FILES['wooccm_checkout_attachment_upload'])) {
|
99 |
+
|
100 |
+
$files = $_FILES['wooccm_checkout_attachment_upload'];
|
101 |
+
|
102 |
+
if (empty($files)) {
|
103 |
+
wc_add_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
|
104 |
+
wp_send_json_error();
|
105 |
+
}
|
106 |
+
|
107 |
+
if (count($attachment_ids = $this->process_uploads($files, 'wooccm_checkout_attachment_upload'))) {
|
108 |
+
wp_send_json_success($attachment_ids);
|
109 |
+
}
|
110 |
+
wc_add_notice(esc_html__('Unknow error.', 'woocommerce-checkout-manager'), 'error');
|
111 |
+
wp_send_json_error();
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
public function update_attachment_ids($order_id = 0) {
|
116 |
+
|
117 |
+
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
118 |
+
|
119 |
+
if (count($checkout = WC()->checkout->get_checkout_fields())) {
|
120 |
+
|
121 |
+
foreach ($checkout as $field_type => $fields) {
|
122 |
+
|
123 |
+
foreach ($fields as $key => $field) {
|
124 |
+
|
125 |
+
if ($field['type'] == 'file') {
|
126 |
+
|
127 |
+
if ($attachments = get_post_meta($order_id, sprintf('_%s', $key), true)) {
|
128 |
+
|
129 |
+
if ($attachments = (array) explode(',', $attachments)) {
|
130 |
+
|
131 |
+
foreach ($attachments as $image_id) {
|
132 |
+
|
133 |
+
wp_update_post(array('ID' => $image_id, 'post_parent' => $order_id));
|
134 |
+
|
135 |
+
wp_update_attachment_metadata($image_id, wp_generate_attachment_metadata($image_id, get_attached_file($image_id)));
|
136 |
+
}
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
public function init() {
|
146 |
+
add_action('wp_ajax_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
|
147 |
+
add_action('wp_ajax_nopriv_wooccm_order_attachment_update', array($this, 'ajax_delete_attachment'));
|
148 |
+
|
149 |
+
// Checkout
|
150 |
+
// -----------------------------------------------------------------------
|
151 |
+
add_action('wp_ajax_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
|
152 |
+
add_action('wp_ajax_nopriv_wooccm_checkout_attachment_upload', array($this, 'ajax_checkout_attachment_upload'));
|
153 |
+
add_action('woocommerce_checkout_update_order_meta', array($this, 'update_attachment_ids'), 99);
|
154 |
+
// }
|
155 |
+
}
|
156 |
+
|
157 |
+
}
|
158 |
+
|
159 |
+
WOOCCM_Upload::instance();
|
includes/class-wooccm.php
CHANGED
@@ -1,140 +1,140 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
final class WOOCCM {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
|
9 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-install.php' );
|
10 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-notices.php' );
|
11 |
-
|
12 |
-
register_activation_hook(WOOCCM_PLUGIN_FILE, array('WOOCCM_Install', 'install'));
|
13 |
-
|
14 |
-
load_plugin_textdomain('woocommerce-checkout-manager', false, dirname(plugin_basename(__FILE__)) . '/languages/');
|
15 |
-
|
16 |
-
add_action('woocommerce_init', array($this, 'init_session'));
|
17 |
-
add_action('woocommerce_init', array($this, 'includes'));
|
18 |
-
add_action('woocommerce_init', array($this, 'field'));
|
19 |
-
add_action('woocommerce_checkout_order_processed', array($this, 'clear_session'), 150);
|
20 |
-
}
|
21 |
-
|
22 |
-
public static function instance() {
|
23 |
-
if (is_null(self::$_instance)) {
|
24 |
-
self::$_instance = new self();
|
25 |
-
}
|
26 |
-
return self::$_instance;
|
27 |
-
}
|
28 |
-
|
29 |
-
public function field() {
|
30 |
-
|
31 |
-
$this->billing = WOOCCM_Field_Billing::instance();
|
32 |
-
$this->shipping = WOOCCM_Field_Shipping::instance();
|
33 |
-
$this->additional = WOOCCM_Field_Additional::instance();
|
34 |
-
|
35 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-compatibility.php' );
|
36 |
-
}
|
37 |
-
|
38 |
-
public function includes() {
|
39 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-admin.php' );
|
40 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-upload.php' );
|
41 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-checkout.php' );
|
42 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field.php' );
|
43 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-order.php' );
|
44 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-email.php' );
|
45 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-advanced.php' );
|
46 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-premium.php' );
|
47 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-suggestions.php' );
|
48 |
-
}
|
49 |
-
|
50 |
-
public function register_scripts() {
|
51 |
-
|
52 |
-
global $wp_version;
|
53 |
-
|
54 |
-
// Frontend
|
55 |
-
// -----------------------------------------------------------------------
|
56 |
-
wp_register_style('wooccm', plugins_url('assets/frontend/css/wooccm.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION, 'all');
|
57 |
-
|
58 |
-
wp_register_script('wooccm-checkout', plugins_url('assets/frontend/js/wooccm-checkout.js', WOOCCM_PLUGIN_FILE), array('jquery', 'selectWoo'), WOOCCM_PLUGIN_VERSION, true);
|
59 |
-
|
60 |
-
wp_localize_script('wooccm-checkout', 'wooccm_upload', array(
|
61 |
-
'ajax_url' => admin_url('admin-ajax.php'),
|
62 |
-
'nonce' => wp_create_nonce('wooccm_upload'),
|
63 |
-
'limit' => array(
|
64 |
-
'max_file_size' => wp_max_upload_size(),
|
65 |
-
'max_files' => 4,
|
66 |
-
//'mime_types' => $this->get_mime_types(),
|
67 |
-
),
|
68 |
-
'icons' => array(
|
69 |
-
'interactive' => site_url('wp-includes/images/media/interactive.png'),
|
70 |
-
'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
|
71 |
-
'archive' => site_url('wp-includes/images/media/archive.png'),
|
72 |
-
'audio' => site_url('wp-includes/images/media/audio.png'),
|
73 |
-
'text' => site_url('wp-includes/images/media/text.png'),
|
74 |
-
'video' => site_url('wp-includes/images/media/video.png')
|
75 |
-
),
|
76 |
-
'message' => array(
|
77 |
-
'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
|
78 |
-
'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
|
79 |
-
'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
|
80 |
-
'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
|
81 |
-
)
|
82 |
-
));
|
83 |
-
|
84 |
-
// Colorpicker
|
85 |
-
// ---------------------------------------------------------------------
|
86 |
-
wp_register_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), $wp_version);
|
87 |
-
|
88 |
-
wp_register_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), $wp_version);
|
89 |
-
|
90 |
-
wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
|
91 |
-
'clear' => __('Clear'),
|
92 |
-
'defaultString' => __('Default'),
|
93 |
-
'pick' => __('Select Color'),
|
94 |
-
'current' => __('Current Color'),
|
95 |
-
));
|
96 |
-
|
97 |
-
wp_register_script('farbtastic', admin_url('js/farbtastic.js'), array('jquery'), $wp_version);
|
98 |
-
|
99 |
-
// Admin
|
100 |
-
// -------------------------------------------------------------------------
|
101 |
-
|
102 |
-
wp_register_script('wooccm-order-upload', plugins_url('assets/frontend/js/wooccm-order-upload.js', WOOCCM_PLUGIN_FILE), array(), WOOCCM_PLUGIN_VERSION, true);
|
103 |
-
|
104 |
-
wp_localize_script('wooccm-order-upload', 'wooccm_upload', array(
|
105 |
-
'ajax_url' => admin_url('admin-ajax.php?metabox=' . is_admin()),
|
106 |
-
'nonce' => wp_create_nonce('wooccm_upload'),
|
107 |
-
'message' => array(
|
108 |
-
'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
|
109 |
-
'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
|
110 |
-
'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
|
111 |
-
'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
|
112 |
-
),
|
113 |
-
'icons' => array(
|
114 |
-
'interactive' => site_url('wp-includes/images/media/interactive.png'),
|
115 |
-
'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
|
116 |
-
'archive' => site_url('wp-includes/images/media/archive.png'),
|
117 |
-
'audio' => site_url('wp-includes/images/media/audio.png'),
|
118 |
-
'text' => site_url('wp-includes/images/media/text.png'),
|
119 |
-
'video' => site_url('wp-includes/images/media/video.png')
|
120 |
-
)
|
121 |
-
));
|
122 |
-
}
|
123 |
-
|
124 |
-
public function clear_session() {
|
125 |
-
unset(WC()->session->wooccm);
|
126 |
-
}
|
127 |
-
|
128 |
-
public function init_session() {
|
129 |
-
|
130 |
-
if (isset(WC()->session) && !WC()->session->wooccm) {
|
131 |
-
|
132 |
-
WC()->session->wooccm = array(
|
133 |
-
'fields' => array(),
|
134 |
-
'fees' => array(),
|
135 |
-
'files' => array(),
|
136 |
-
);
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
final class WOOCCM {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
|
9 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-install.php' );
|
10 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-notices.php' );
|
11 |
+
|
12 |
+
register_activation_hook(WOOCCM_PLUGIN_FILE, array('WOOCCM_Install', 'install'));
|
13 |
+
|
14 |
+
load_plugin_textdomain('woocommerce-checkout-manager', false, dirname(plugin_basename(__FILE__)) . '/languages/');
|
15 |
+
|
16 |
+
add_action('woocommerce_init', array($this, 'init_session'));
|
17 |
+
add_action('woocommerce_init', array($this, 'includes'));
|
18 |
+
add_action('woocommerce_init', array($this, 'field'));
|
19 |
+
add_action('woocommerce_checkout_order_processed', array($this, 'clear_session'), 150);
|
20 |
+
}
|
21 |
+
|
22 |
+
public static function instance() {
|
23 |
+
if (is_null(self::$_instance)) {
|
24 |
+
self::$_instance = new self();
|
25 |
+
}
|
26 |
+
return self::$_instance;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function field() {
|
30 |
+
|
31 |
+
$this->billing = WOOCCM_Field_Billing::instance();
|
32 |
+
$this->shipping = WOOCCM_Field_Shipping::instance();
|
33 |
+
$this->additional = WOOCCM_Field_Additional::instance();
|
34 |
+
|
35 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-compatibility.php' );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function includes() {
|
39 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-admin.php' );
|
40 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-upload.php' );
|
41 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-checkout.php' );
|
42 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field.php' );
|
43 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-order.php' );
|
44 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-email.php' );
|
45 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-advanced.php' );
|
46 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-premium.php' );
|
47 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-suggestions.php' );
|
48 |
+
}
|
49 |
+
|
50 |
+
public function register_scripts() {
|
51 |
+
|
52 |
+
global $wp_version;
|
53 |
+
|
54 |
+
// Frontend
|
55 |
+
// -----------------------------------------------------------------------
|
56 |
+
wp_register_style('wooccm', plugins_url('assets/frontend/css/wooccm.css', WOOCCM_PLUGIN_FILE), false, WOOCCM_PLUGIN_VERSION, 'all');
|
57 |
+
|
58 |
+
wp_register_script('wooccm-checkout', plugins_url('assets/frontend/js/wooccm-checkout.js', WOOCCM_PLUGIN_FILE), array('jquery', 'selectWoo'), WOOCCM_PLUGIN_VERSION, true);
|
59 |
+
|
60 |
+
wp_localize_script('wooccm-checkout', 'wooccm_upload', array(
|
61 |
+
'ajax_url' => admin_url('admin-ajax.php'),
|
62 |
+
'nonce' => wp_create_nonce('wooccm_upload'),
|
63 |
+
'limit' => array(
|
64 |
+
'max_file_size' => wp_max_upload_size(),
|
65 |
+
'max_files' => 4,
|
66 |
+
//'mime_types' => $this->get_mime_types(),
|
67 |
+
),
|
68 |
+
'icons' => array(
|
69 |
+
'interactive' => site_url('wp-includes/images/media/interactive.png'),
|
70 |
+
'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
|
71 |
+
'archive' => site_url('wp-includes/images/media/archive.png'),
|
72 |
+
'audio' => site_url('wp-includes/images/media/audio.png'),
|
73 |
+
'text' => site_url('wp-includes/images/media/text.png'),
|
74 |
+
'video' => site_url('wp-includes/images/media/video.png')
|
75 |
+
),
|
76 |
+
'message' => array(
|
77 |
+
'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
|
78 |
+
'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
|
79 |
+
'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
|
80 |
+
'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
|
81 |
+
)
|
82 |
+
));
|
83 |
+
|
84 |
+
// Colorpicker
|
85 |
+
// ---------------------------------------------------------------------
|
86 |
+
wp_register_script('iris', admin_url('js/iris.min.js'), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch'), $wp_version);
|
87 |
+
|
88 |
+
wp_register_script('wp-color-picker', admin_url('js/color-picker.min.js'), array('iris'), $wp_version);
|
89 |
+
|
90 |
+
wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array(
|
91 |
+
'clear' => __('Clear'),
|
92 |
+
'defaultString' => __('Default'),
|
93 |
+
'pick' => __('Select Color'),
|
94 |
+
'current' => __('Current Color'),
|
95 |
+
));
|
96 |
+
|
97 |
+
wp_register_script('farbtastic', admin_url('js/farbtastic.js'), array('jquery'), $wp_version);
|
98 |
+
|
99 |
+
// Admin
|
100 |
+
// -------------------------------------------------------------------------
|
101 |
+
|
102 |
+
wp_register_script('wooccm-order-upload', plugins_url('assets/frontend/js/wooccm-order-upload.js', WOOCCM_PLUGIN_FILE), array(), WOOCCM_PLUGIN_VERSION, true);
|
103 |
+
|
104 |
+
wp_localize_script('wooccm-order-upload', 'wooccm_upload', array(
|
105 |
+
'ajax_url' => admin_url('admin-ajax.php?metabox=' . is_admin()),
|
106 |
+
'nonce' => wp_create_nonce('wooccm_upload'),
|
107 |
+
'message' => array(
|
108 |
+
'uploading' => esc_html__('Uploading, please wait...', 'woocommerce-checkout-manager'),
|
109 |
+
'saving' => esc_html__('Saving, please wait...', 'woocommerce-checkout-manager'),
|
110 |
+
'success' => esc_html__('Files uploaded successfully.', 'woocommerce-checkout-manager'),
|
111 |
+
'deleted' => esc_html__('Deleted successfully.', 'woocommerce-checkout-manager'),
|
112 |
+
),
|
113 |
+
'icons' => array(
|
114 |
+
'interactive' => site_url('wp-includes/images/media/interactive.png'),
|
115 |
+
'spreadsheet' => site_url('wp-includes/images/media/spreadsheet.png'),
|
116 |
+
'archive' => site_url('wp-includes/images/media/archive.png'),
|
117 |
+
'audio' => site_url('wp-includes/images/media/audio.png'),
|
118 |
+
'text' => site_url('wp-includes/images/media/text.png'),
|
119 |
+
'video' => site_url('wp-includes/images/media/video.png')
|
120 |
+
)
|
121 |
+
));
|
122 |
+
}
|
123 |
+
|
124 |
+
public function clear_session() {
|
125 |
+
unset(WC()->session->wooccm);
|
126 |
+
}
|
127 |
+
|
128 |
+
public function init_session() {
|
129 |
+
|
130 |
+
if (isset(WC()->session) && !WC()->session->wooccm) {
|
131 |
+
|
132 |
+
WC()->session->wooccm = array(
|
133 |
+
'fields' => array(),
|
134 |
+
'fees' => array(),
|
135 |
+
'files' => array(),
|
136 |
+
);
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
}
|
includes/controller/class-wooccm-advanced.php
CHANGED
@@ -1,135 +1,135 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Checkout_Advanced_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
public function add_inline_scripts() {
|
19 |
-
|
20 |
-
if ($css = get_option('wooccm_advanced_custom_css', false)) {
|
21 |
-
?>
|
22 |
-
<style>
|
23 |
-
<?php echo $css; ?>
|
24 |
-
</style>
|
25 |
-
<?php
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
public function get_settings() {
|
30 |
-
|
31 |
-
return array(
|
32 |
-
array(
|
33 |
-
'type' => 'title',
|
34 |
-
'id' => 'section_title'
|
35 |
-
),
|
36 |
-
//array(
|
37 |
-
// 'name' => esc_html__('Allow custom field names', 'woocommerce-checkout-manager'),
|
38 |
-
// 'desc_tip' => esc_html__('Show the selected fields in the thankyou page.', 'woocommerce-checkout-manager'),
|
39 |
-
// 'id' => 'wooccm_allow_custom_field_names',
|
40 |
-
// 'type' => 'select',
|
41 |
-
// 'class' => 'chosen_select',
|
42 |
-
// 'options' => array(
|
43 |
-
// 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
44 |
-
// 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
45 |
-
// ),
|
46 |
-
// 'default' => 'no',
|
47 |
-
// ),
|
48 |
-
array(
|
49 |
-
'name' => esc_html__('Export custom fields', 'woocommerce-checkout-manager'),
|
50 |
-
'desc_tip' => esc_html__('Include custom fields in CSV export files generated by WooCommerce Customer / Order / Coupon Export.', 'woocommerce-checkout-manager'),
|
51 |
-
'id' => 'wooccm_export_custom_fields',
|
52 |
-
'type' => 'select',
|
53 |
-
'class' => 'chosen_select wooccm-premium-field',
|
54 |
-
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
55 |
-
'options' => array(
|
56 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
57 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
58 |
-
),
|
59 |
-
'default' => 'yes',
|
60 |
-
),
|
61 |
-
array(
|
62 |
-
'name' => esc_html__('Custom CSS', 'woocommerce-checkout-manager'),
|
63 |
-
'desc_tip' => esc_html__('Add custom stylesheets to the checkout page.', 'woocommerce-checkout-manager'),
|
64 |
-
'id' => 'wooccm_advanced_custom_css',
|
65 |
-
'type' => 'textarea',
|
66 |
-
'placeholder' => ''
|
67 |
-
),
|
68 |
-
array(
|
69 |
-
'type' => 'sectionend',
|
70 |
-
'id' => 'section_end'
|
71 |
-
)
|
72 |
-
);
|
73 |
-
}
|
74 |
-
|
75 |
-
// Admin
|
76 |
-
// -------------------------------------------------------------------------
|
77 |
-
|
78 |
-
public function add_header() {
|
79 |
-
global $current_section;
|
80 |
-
?>
|
81 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=advanced'); ?>" class="<?php echo ( $current_section == 'advanced' ? 'current' : '' ); ?>"><?php esc_html_e('Advanced', 'woocommerce-checkout-manager'); ?></a> | </li>
|
82 |
-
<?php
|
83 |
-
}
|
84 |
-
|
85 |
-
public function add_section() {
|
86 |
-
|
87 |
-
global $current_section;
|
88 |
-
|
89 |
-
if ('advanced' == $current_section) {
|
90 |
-
|
91 |
-
$settings = $this->get_settings();
|
92 |
-
|
93 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/advanced.php' );
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
public function save_settings() {
|
98 |
-
|
99 |
-
global $current_section;
|
100 |
-
|
101 |
-
if ('advanced' == $current_section) {
|
102 |
-
woocommerce_update_options($this->get_settings());
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
public function custom_css_w($value) {
|
107 |
-
|
108 |
-
$options = get_option('wccs_settings');
|
109 |
-
|
110 |
-
if ($css = @$options['checkness']['custom_css_w']) {
|
111 |
-
return $css;
|
112 |
-
}
|
113 |
-
|
114 |
-
return $value;
|
115 |
-
}
|
116 |
-
|
117 |
-
public function init() {
|
118 |
-
|
119 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
120 |
-
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'));
|
121 |
-
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
122 |
-
|
123 |
-
// Frontend
|
124 |
-
// -------------------------------------------------------------------------
|
125 |
-
add_action('woocommerce_before_checkout_form', array($this, 'add_inline_scripts'));
|
126 |
-
|
127 |
-
// Compatibility
|
128 |
-
// -------------------------------------------------------------------------
|
129 |
-
add_filter('default_option_wooccm_advanced_custom_css', array($this, 'custom_css_w'));
|
130 |
-
}
|
131 |
-
|
132 |
-
}
|
133 |
-
|
134 |
-
WOOCCM_Checkout_Advanced_Controller::instance();
|
135 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Checkout_Advanced_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function add_inline_scripts() {
|
19 |
+
|
20 |
+
if ($css = get_option('wooccm_advanced_custom_css', false)) {
|
21 |
+
?>
|
22 |
+
<style>
|
23 |
+
<?php echo $css; ?>
|
24 |
+
</style>
|
25 |
+
<?php
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
public function get_settings() {
|
30 |
+
|
31 |
+
return array(
|
32 |
+
array(
|
33 |
+
'type' => 'title',
|
34 |
+
'id' => 'section_title'
|
35 |
+
),
|
36 |
+
//array(
|
37 |
+
// 'name' => esc_html__('Allow custom field names', 'woocommerce-checkout-manager'),
|
38 |
+
// 'desc_tip' => esc_html__('Show the selected fields in the thankyou page.', 'woocommerce-checkout-manager'),
|
39 |
+
// 'id' => 'wooccm_allow_custom_field_names',
|
40 |
+
// 'type' => 'select',
|
41 |
+
// 'class' => 'chosen_select',
|
42 |
+
// 'options' => array(
|
43 |
+
// 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
44 |
+
// 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
45 |
+
// ),
|
46 |
+
// 'default' => 'no',
|
47 |
+
// ),
|
48 |
+
array(
|
49 |
+
'name' => esc_html__('Export custom fields', 'woocommerce-checkout-manager'),
|
50 |
+
'desc_tip' => esc_html__('Include custom fields in CSV export files generated by WooCommerce Customer / Order / Coupon Export.', 'woocommerce-checkout-manager'),
|
51 |
+
'id' => 'wooccm_export_custom_fields',
|
52 |
+
'type' => 'select',
|
53 |
+
'class' => 'chosen_select wooccm-premium-field',
|
54 |
+
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
55 |
+
'options' => array(
|
56 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
57 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
58 |
+
),
|
59 |
+
'default' => 'yes',
|
60 |
+
),
|
61 |
+
array(
|
62 |
+
'name' => esc_html__('Custom CSS', 'woocommerce-checkout-manager'),
|
63 |
+
'desc_tip' => esc_html__('Add custom stylesheets to the checkout page.', 'woocommerce-checkout-manager'),
|
64 |
+
'id' => 'wooccm_advanced_custom_css',
|
65 |
+
'type' => 'textarea',
|
66 |
+
'placeholder' => ''
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'type' => 'sectionend',
|
70 |
+
'id' => 'section_end'
|
71 |
+
)
|
72 |
+
);
|
73 |
+
}
|
74 |
+
|
75 |
+
// Admin
|
76 |
+
// -------------------------------------------------------------------------
|
77 |
+
|
78 |
+
public function add_header() {
|
79 |
+
global $current_section;
|
80 |
+
?>
|
81 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=advanced'); ?>" class="<?php echo ( $current_section == 'advanced' ? 'current' : '' ); ?>"><?php esc_html_e('Advanced', 'woocommerce-checkout-manager'); ?></a> | </li>
|
82 |
+
<?php
|
83 |
+
}
|
84 |
+
|
85 |
+
public function add_section() {
|
86 |
+
|
87 |
+
global $current_section;
|
88 |
+
|
89 |
+
if ('advanced' == $current_section) {
|
90 |
+
|
91 |
+
$settings = $this->get_settings();
|
92 |
+
|
93 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/advanced.php' );
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
public function save_settings() {
|
98 |
+
|
99 |
+
global $current_section;
|
100 |
+
|
101 |
+
if ('advanced' == $current_section) {
|
102 |
+
woocommerce_update_options($this->get_settings());
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
public function custom_css_w($value) {
|
107 |
+
|
108 |
+
$options = get_option('wccs_settings');
|
109 |
+
|
110 |
+
if ($css = @$options['checkness']['custom_css_w']) {
|
111 |
+
return $css;
|
112 |
+
}
|
113 |
+
|
114 |
+
return $value;
|
115 |
+
}
|
116 |
+
|
117 |
+
public function init() {
|
118 |
+
|
119 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
120 |
+
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'));
|
121 |
+
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
122 |
+
|
123 |
+
// Frontend
|
124 |
+
// -------------------------------------------------------------------------
|
125 |
+
add_action('woocommerce_before_checkout_form', array($this, 'add_inline_scripts'));
|
126 |
+
|
127 |
+
// Compatibility
|
128 |
+
// -------------------------------------------------------------------------
|
129 |
+
add_filter('default_option_wooccm_advanced_custom_css', array($this, 'custom_css_w'));
|
130 |
+
}
|
131 |
+
|
132 |
+
}
|
133 |
+
|
134 |
+
WOOCCM_Checkout_Advanced_Controller::instance();
|
135 |
+
|
includes/controller/class-wooccm-checkout.php
CHANGED
@@ -1,393 +1,393 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Checkout_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
public function enqueue_scripts() {
|
19 |
-
|
20 |
-
if (is_checkout()) {
|
21 |
-
|
22 |
-
WOOCCM()->register_scripts();
|
23 |
-
|
24 |
-
$i18n = substr(get_user_locale(), 0, 2);
|
25 |
-
|
26 |
-
wp_enqueue_style('wooccm');
|
27 |
-
|
28 |
-
// Colorpicker
|
29 |
-
// ---------------------------------------------------------------------
|
30 |
-
wp_enqueue_style('wp-color-picker');
|
31 |
-
wp_enqueue_script('wp-color-picker');
|
32 |
-
|
33 |
-
// Farbtastic
|
34 |
-
// ---------------------------------------------------------------------
|
35 |
-
wp_enqueue_style('farbtastic');
|
36 |
-
wp_enqueue_script('farbtastic');
|
37 |
-
|
38 |
-
// Dashicons
|
39 |
-
// ---------------------------------------------------------------------
|
40 |
-
wp_enqueue_style('dashicons');
|
41 |
-
|
42 |
-
|
43 |
-
// Checkout
|
44 |
-
// ---------------------------------------------------------------------
|
45 |
-
wp_enqueue_script('wooccm-checkout');
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
public function add_inline_scripts() {
|
50 |
-
|
51 |
-
if (get_option('wooccm_checkout_force_shipping_address', 'no') == 'yes') {
|
52 |
-
?>
|
53 |
-
<style>
|
54 |
-
.woocommerce-shipping-fields h3:first-child input {
|
55 |
-
display: none!important;
|
56 |
-
}
|
57 |
-
.woocommerce-shipping-fields .shipping_address {
|
58 |
-
display: block !important;
|
59 |
-
}
|
60 |
-
</style>
|
61 |
-
<?php
|
62 |
-
}
|
63 |
-
|
64 |
-
if (get_option('wooccm_checkout_force_create_account', 'no') == 'yes') {
|
65 |
-
?>
|
66 |
-
<style>
|
67 |
-
div.create-account {
|
68 |
-
display: block!important;
|
69 |
-
}
|
70 |
-
p.create-account {
|
71 |
-
display: none!important;
|
72 |
-
}
|
73 |
-
</style>
|
74 |
-
<script>
|
75 |
-
jQuery(document).ready(function (e) {
|
76 |
-
jQuery("input#createaccount").prop('checked', 'checked');
|
77 |
-
});
|
78 |
-
</script>
|
79 |
-
<?php
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
// Frontend
|
84 |
-
// -------------------------------------------------------------------------
|
85 |
-
public function order_notes($fields) {
|
86 |
-
|
87 |
-
$options = get_option('wccs_settings');
|
88 |
-
|
89 |
-
if ($label = get_option('wooccm_checkout_order_notes_label', false)) {
|
90 |
-
$fields['order']['order_comments']['label'] = $label;
|
91 |
-
}
|
92 |
-
|
93 |
-
if ($placeholder = get_option('wooccm_checkout_order_notes_placeholder', false)) {
|
94 |
-
$fields['order']['order_comments']['placeholder'] = $placeholder;
|
95 |
-
}
|
96 |
-
|
97 |
-
if (get_option('wooccm_checkout_remove_order_notes', 'no') === 'yes') {
|
98 |
-
unset($fields['order']['order_comments']);
|
99 |
-
}
|
100 |
-
|
101 |
-
return $fields;
|
102 |
-
}
|
103 |
-
|
104 |
-
public function remove_order_notes($value) {
|
105 |
-
|
106 |
-
if (get_option('wooccm_checkout_remove_order_notes', 'no') === 'yes') {
|
107 |
-
return false;
|
108 |
-
}
|
109 |
-
|
110 |
-
return $value;
|
111 |
-
}
|
112 |
-
|
113 |
-
function add_checkout_form_before_message($param) {
|
114 |
-
|
115 |
-
if ($text = get_option('wooccm_checkout_checkout_form_before_message', false)) {
|
116 |
-
|
117 |
-
wc_get_template('notices/notice.php', array(
|
118 |
-
'messages' => array_filter((array) $text),
|
119 |
-
));
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
function add_checkout_form_after_message($param) {
|
124 |
-
|
125 |
-
if ($text = get_option('wooccm_checkout_checkout_form_after_message', false)) {
|
126 |
-
|
127 |
-
wc_get_template('notices/notice.php', array(
|
128 |
-
'messages' => array_filter((array) $text),
|
129 |
-
));
|
130 |
-
}
|
131 |
-
}
|
132 |
-
|
133 |
-
// Admin
|
134 |
-
// ---------------------------------------------------------------------------
|
135 |
-
|
136 |
-
public function get_settings() {
|
137 |
-
|
138 |
-
return array(
|
139 |
-
array(
|
140 |
-
'type' => 'title',
|
141 |
-
'id' => 'section_title'
|
142 |
-
),
|
143 |
-
array(
|
144 |
-
'name' => esc_html__('Force shipping address', 'woocommerce-checkout-manager'),
|
145 |
-
'desc_tip' => esc_html__('Force show shipping checkout fields.', 'woocommerce-checkout-manager'),
|
146 |
-
'id' => 'wooccm_checkout_force_shipping_address',
|
147 |
-
'type' => 'select',
|
148 |
-
'class' => 'chosen_select',
|
149 |
-
'options' => array(
|
150 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
151 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
152 |
-
),
|
153 |
-
'default' => 'no',
|
154 |
-
),
|
155 |
-
array(
|
156 |
-
'name' => esc_html__('Force create an account', 'woocommerce-checkout-manager'),
|
157 |
-
'desc_tip' => esc_html__('Force create an account for guests users.', 'woocommerce-checkout-manager'),
|
158 |
-
'id' => 'wooccm_checkout_force_create_account',
|
159 |
-
'type' => 'select',
|
160 |
-
'class' => 'chosen_select',
|
161 |
-
'options' => array(
|
162 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
163 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
164 |
-
),
|
165 |
-
'default' => 'no',
|
166 |
-
),
|
167 |
-
array(
|
168 |
-
'name' => esc_html__('Remove order notes', 'woocommerce-checkout-manager'),
|
169 |
-
'desc_tip' => esc_html__('Remove order notes from checkout page.', 'woocommerce-checkout-manager'),
|
170 |
-
'id' => 'wooccm_checkout_remove_order_notes',
|
171 |
-
'type' => 'select',
|
172 |
-
'class' => 'chosen_select',
|
173 |
-
'options' => array(
|
174 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
175 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
176 |
-
),
|
177 |
-
'default' => 'no',
|
178 |
-
),
|
179 |
-
array(
|
180 |
-
'name' => esc_html__('Order notes label', 'woocommerce-checkout-manager'),
|
181 |
-
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
182 |
-
'id' => 'wooccm_checkout_order_notes_label',
|
183 |
-
'type' => 'text',
|
184 |
-
'placeholder' => esc_attr__('Order notes', 'woocommerce-checkout-manager'),
|
185 |
-
),
|
186 |
-
array(
|
187 |
-
'name' => esc_html__('Order notes placeholder', 'woocommerce-checkout-manager'),
|
188 |
-
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
189 |
-
'id' => 'wooccm_checkout_order_notes_placeholder',
|
190 |
-
'type' => 'text',
|
191 |
-
'placeholder' => esc_attr__('Notes about your order, e.g. special notes for delivery.', 'woocommerce-checkout-manager'),
|
192 |
-
),
|
193 |
-
array(
|
194 |
-
'name' => esc_html__('Add message before checkout', 'woocommerce-checkout-manager'),
|
195 |
-
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
196 |
-
'id' => 'wooccm_checkout_checkout_form_before_message',
|
197 |
-
'type' => 'textarea',
|
198 |
-
'placeholder' => ''
|
199 |
-
),
|
200 |
-
array(
|
201 |
-
'name' => esc_html__('Add message after checkout', 'woocommerce-checkout-manager'),
|
202 |
-
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
203 |
-
'id' => 'wooccm_checkout_checkout_form_after_message',
|
204 |
-
'type' => 'textarea',
|
205 |
-
'placeholder' => ''
|
206 |
-
),
|
207 |
-
// thankyou
|
208 |
-
// -------------------------------------------------------------------------
|
209 |
-
//array(
|
210 |
-
// 'name' => esc_html__('Add thankyou custom fields', 'woocommerce-checkout-manager'),
|
211 |
-
// 'desc_tip' => esc_html__('Show the selected fields in the thankyou page.', 'woocommerce-checkout-manager'),
|
212 |
-
// 'id' => 'wooccm_checkout_thankyou_custom_fields',
|
213 |
-
// 'type' => 'select',
|
214 |
-
// 'class' => 'chosen_select',
|
215 |
-
// 'options' => array(
|
216 |
-
// 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
217 |
-
// 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
218 |
-
// ),
|
219 |
-
// 'default' => 'no',
|
220 |
-
// ),
|
221 |
-
//array(
|
222 |
-
// 'name' => esc_html__('Add thankyou custom fields title', 'woocommerce-checkout-manager'),
|
223 |
-
// 'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
224 |
-
// 'id' => 'wooccm_checkout_thankyou_custom_fields_text',
|
225 |
-
// 'type' => 'text',
|
226 |
-
// 'placeholder' => esc_html__('Checkout extra', 'woocommerce-checkout-manager')
|
227 |
-
// ),
|
228 |
-
// upload
|
229 |
-
// -------------------------------------------------------------------------
|
230 |
-
//array(
|
231 |
-
// 'name' => esc_html__('Add upload files limit', 'woocommerce-checkout-manager'),
|
232 |
-
// 'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
233 |
-
// 'id' => 'wooccm_checkout_upload_files_limit',
|
234 |
-
// 'type' => 'number',
|
235 |
-
// 'placeholder' => 4
|
236 |
-
// ),
|
237 |
-
//array(
|
238 |
-
// 'name' => esc_html__('Add upload files types', 'woocommerce-checkout-manager'),
|
239 |
-
// 'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
240 |
-
// 'id' => 'wooccm_checkout_upload_files_types',
|
241 |
-
// 'type' => 'text',
|
242 |
-
// 'placeholder' => 'jpg,gif,png'
|
243 |
-
// ),
|
244 |
-
array(
|
245 |
-
'type' => 'sectionend',
|
246 |
-
'id' => 'section_end'
|
247 |
-
)
|
248 |
-
);
|
249 |
-
}
|
250 |
-
|
251 |
-
public function add_header() {
|
252 |
-
global $current_section;
|
253 |
-
?>
|
254 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion'); ?>" class="<?php echo ( $current_section == '' ? 'current' : '' ); ?>"><?php esc_html_e('Checkout', 'woocommerce-checkout-manager'); ?></a> | </li>
|
255 |
-
<?php
|
256 |
-
}
|
257 |
-
|
258 |
-
public function add_section() {
|
259 |
-
|
260 |
-
global $current_section;
|
261 |
-
|
262 |
-
if ('' == $current_section) {
|
263 |
-
|
264 |
-
$settings = $this->get_settings();
|
265 |
-
|
266 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/checkout.php' );
|
267 |
-
}
|
268 |
-
}
|
269 |
-
|
270 |
-
public function save_settings() {
|
271 |
-
|
272 |
-
global $current_section;
|
273 |
-
|
274 |
-
if ('' == $current_section) {
|
275 |
-
|
276 |
-
woocommerce_update_options($this->get_settings());
|
277 |
-
}
|
278 |
-
}
|
279 |
-
|
280 |
-
// Compatibility
|
281 |
-
// ---------------------------------------------------------------------------
|
282 |
-
|
283 |
-
public function additional_info($value) {
|
284 |
-
|
285 |
-
$options = get_option('wccs_settings');
|
286 |
-
|
287 |
-
if (!empty($options['checkness']['additional_info'])) {
|
288 |
-
return 'yes';
|
289 |
-
}
|
290 |
-
|
291 |
-
if (!empty($options['checkness']['show_shipping_fields'])) {
|
292 |
-
return 'yes';
|
293 |
-
}
|
294 |
-
|
295 |
-
return $value;
|
296 |
-
}
|
297 |
-
|
298 |
-
public function auto_create_wccm_account($value) {
|
299 |
-
|
300 |
-
$options = get_option('wccs_settings');
|
301 |
-
|
302 |
-
if (!empty($options['checkness']['auto_create_wccm_account'])) {
|
303 |
-
return 'yes';
|
304 |
-
}
|
305 |
-
|
306 |
-
return $value;
|
307 |
-
}
|
308 |
-
|
309 |
-
public function notesenable($value) {
|
310 |
-
|
311 |
-
$options = get_option('wccs_settings');
|
312 |
-
|
313 |
-
if (!empty($options['checkness']['notesenable'])) {
|
314 |
-
return 'yes';
|
315 |
-
}
|
316 |
-
|
317 |
-
return $value;
|
318 |
-
}
|
319 |
-
|
320 |
-
public function noteslabel($value) {
|
321 |
-
|
322 |
-
$options = get_option('wccs_settings');
|
323 |
-
|
324 |
-
if ($text = @$options['checkness']['noteslabel']) {
|
325 |
-
return $text;
|
326 |
-
}
|
327 |
-
|
328 |
-
return $value;
|
329 |
-
}
|
330 |
-
|
331 |
-
public function notesplaceholder($value) {
|
332 |
-
|
333 |
-
$options = get_option('wccs_settings');
|
334 |
-
|
335 |
-
if ($text = @$options['checkness']['notesplaceholder']) {
|
336 |
-
return $text;
|
337 |
-
}
|
338 |
-
|
339 |
-
return $value;
|
340 |
-
}
|
341 |
-
|
342 |
-
public function text1($value) {
|
343 |
-
|
344 |
-
$options = get_option('wccs_settings');
|
345 |
-
|
346 |
-
if ($text = @$options['checkness']['text1']) {
|
347 |
-
return $text;
|
348 |
-
}
|
349 |
-
|
350 |
-
return $value;
|
351 |
-
}
|
352 |
-
|
353 |
-
public function text2($value) {
|
354 |
-
|
355 |
-
$options = get_option('wccs_settings');
|
356 |
-
|
357 |
-
if ($text = @$options['checkness']['text2']) {
|
358 |
-
return $text;
|
359 |
-
}
|
360 |
-
|
361 |
-
return $value;
|
362 |
-
}
|
363 |
-
|
364 |
-
public function init() {
|
365 |
-
|
366 |
-
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
|
367 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
368 |
-
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
369 |
-
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
370 |
-
|
371 |
-
// Frontend
|
372 |
-
// -----------------------------------------------------------------------
|
373 |
-
add_action('woocommerce_before_checkout_form', array($this, 'add_inline_scripts'));
|
374 |
-
add_action('woocommerce_checkout_fields', array($this, 'order_notes'));
|
375 |
-
add_action('woocommerce_before_checkout_form', array($this, 'add_checkout_form_before_message'));
|
376 |
-
add_action('woocommerce_after_checkout_form', array($this, 'add_checkout_form_after_message'));
|
377 |
-
add_action('woocommerce_enable_order_notes_field', array($this, 'remove_order_notes'));
|
378 |
-
|
379 |
-
// Compatibility
|
380 |
-
// -----------------------------------------------------------------------
|
381 |
-
add_filter('default_option_wooccm_checkout_force_shipping_address', array($this, 'additional_info'));
|
382 |
-
add_filter('default_option_wooccm_checkout_force_create_account', array($this, 'auto_create_wccm_account'));
|
383 |
-
add_filter('default_option_wooccm_checkout_remove_order_notes', array($this, 'notesenable'));
|
384 |
-
add_filter('default_option_wooccm_checkout_order_notes_label', array($this, 'noteslabel'));
|
385 |
-
add_filter('default_option_wooccm_checkout_order_notes_placeholder', array($this, 'notesplaceholder'));
|
386 |
-
add_filter('default_option_wooccm_checkout_checkout_form_before_message', array($this, 'text1'));
|
387 |
-
add_filter('default_option_wooccm_checkout_checkout_form_after_message', array($this, 'text2'));
|
388 |
-
}
|
389 |
-
|
390 |
-
}
|
391 |
-
|
392 |
-
WOOCCM_Checkout_Controller::instance();
|
393 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Checkout_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function enqueue_scripts() {
|
19 |
+
|
20 |
+
if (is_checkout()) {
|
21 |
+
|
22 |
+
WOOCCM()->register_scripts();
|
23 |
+
|
24 |
+
$i18n = substr(get_user_locale(), 0, 2);
|
25 |
+
|
26 |
+
wp_enqueue_style('wooccm');
|
27 |
+
|
28 |
+
// Colorpicker
|
29 |
+
// ---------------------------------------------------------------------
|
30 |
+
wp_enqueue_style('wp-color-picker');
|
31 |
+
wp_enqueue_script('wp-color-picker');
|
32 |
+
|
33 |
+
// Farbtastic
|
34 |
+
// ---------------------------------------------------------------------
|
35 |
+
wp_enqueue_style('farbtastic');
|
36 |
+
wp_enqueue_script('farbtastic');
|
37 |
+
|
38 |
+
// Dashicons
|
39 |
+
// ---------------------------------------------------------------------
|
40 |
+
wp_enqueue_style('dashicons');
|
41 |
+
|
42 |
+
|
43 |
+
// Checkout
|
44 |
+
// ---------------------------------------------------------------------
|
45 |
+
wp_enqueue_script('wooccm-checkout');
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function add_inline_scripts() {
|
50 |
+
|
51 |
+
if (get_option('wooccm_checkout_force_shipping_address', 'no') == 'yes') {
|
52 |
+
?>
|
53 |
+
<style>
|
54 |
+
.woocommerce-shipping-fields h3:first-child input {
|
55 |
+
display: none!important;
|
56 |
+
}
|
57 |
+
.woocommerce-shipping-fields .shipping_address {
|
58 |
+
display: block !important;
|
59 |
+
}
|
60 |
+
</style>
|
61 |
+
<?php
|
62 |
+
}
|
63 |
+
|
64 |
+
if (get_option('wooccm_checkout_force_create_account', 'no') == 'yes') {
|
65 |
+
?>
|
66 |
+
<style>
|
67 |
+
div.create-account {
|
68 |
+
display: block!important;
|
69 |
+
}
|
70 |
+
p.create-account {
|
71 |
+
display: none!important;
|
72 |
+
}
|
73 |
+
</style>
|
74 |
+
<script>
|
75 |
+
jQuery(document).ready(function (e) {
|
76 |
+
jQuery("input#createaccount").prop('checked', 'checked');
|
77 |
+
});
|
78 |
+
</script>
|
79 |
+
<?php
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
// Frontend
|
84 |
+
// -------------------------------------------------------------------------
|
85 |
+
public function order_notes($fields) {
|
86 |
+
|
87 |
+
$options = get_option('wccs_settings');
|
88 |
+
|
89 |
+
if ($label = get_option('wooccm_checkout_order_notes_label', false)) {
|
90 |
+
$fields['order']['order_comments']['label'] = $label;
|
91 |
+
}
|
92 |
+
|
93 |
+
if ($placeholder = get_option('wooccm_checkout_order_notes_placeholder', false)) {
|
94 |
+
$fields['order']['order_comments']['placeholder'] = $placeholder;
|
95 |
+
}
|
96 |
+
|
97 |
+
if (get_option('wooccm_checkout_remove_order_notes', 'no') === 'yes') {
|
98 |
+
unset($fields['order']['order_comments']);
|
99 |
+
}
|
100 |
+
|
101 |
+
return $fields;
|
102 |
+
}
|
103 |
+
|
104 |
+
public function remove_order_notes($value) {
|
105 |
+
|
106 |
+
if (get_option('wooccm_checkout_remove_order_notes', 'no') === 'yes') {
|
107 |
+
return false;
|
108 |
+
}
|
109 |
+
|
110 |
+
return $value;
|
111 |
+
}
|
112 |
+
|
113 |
+
function add_checkout_form_before_message($param) {
|
114 |
+
|
115 |
+
if ($text = get_option('wooccm_checkout_checkout_form_before_message', false)) {
|
116 |
+
|
117 |
+
wc_get_template('notices/notice.php', array(
|
118 |
+
'messages' => array_filter((array) $text),
|
119 |
+
));
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
function add_checkout_form_after_message($param) {
|
124 |
+
|
125 |
+
if ($text = get_option('wooccm_checkout_checkout_form_after_message', false)) {
|
126 |
+
|
127 |
+
wc_get_template('notices/notice.php', array(
|
128 |
+
'messages' => array_filter((array) $text),
|
129 |
+
));
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
// Admin
|
134 |
+
// ---------------------------------------------------------------------------
|
135 |
+
|
136 |
+
public function get_settings() {
|
137 |
+
|
138 |
+
return array(
|
139 |
+
array(
|
140 |
+
'type' => 'title',
|
141 |
+
'id' => 'section_title'
|
142 |
+
),
|
143 |
+
array(
|
144 |
+
'name' => esc_html__('Force shipping address', 'woocommerce-checkout-manager'),
|
145 |
+
'desc_tip' => esc_html__('Force show shipping checkout fields.', 'woocommerce-checkout-manager'),
|
146 |
+
'id' => 'wooccm_checkout_force_shipping_address',
|
147 |
+
'type' => 'select',
|
148 |
+
'class' => 'chosen_select',
|
149 |
+
'options' => array(
|
150 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
151 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
152 |
+
),
|
153 |
+
'default' => 'no',
|
154 |
+
),
|
155 |
+
array(
|
156 |
+
'name' => esc_html__('Force create an account', 'woocommerce-checkout-manager'),
|
157 |
+
'desc_tip' => esc_html__('Force create an account for guests users.', 'woocommerce-checkout-manager'),
|
158 |
+
'id' => 'wooccm_checkout_force_create_account',
|
159 |
+
'type' => 'select',
|
160 |
+
'class' => 'chosen_select',
|
161 |
+
'options' => array(
|
162 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
163 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
164 |
+
),
|
165 |
+
'default' => 'no',
|
166 |
+
),
|
167 |
+
array(
|
168 |
+
'name' => esc_html__('Remove order notes', 'woocommerce-checkout-manager'),
|
169 |
+
'desc_tip' => esc_html__('Remove order notes from checkout page.', 'woocommerce-checkout-manager'),
|
170 |
+
'id' => 'wooccm_checkout_remove_order_notes',
|
171 |
+
'type' => 'select',
|
172 |
+
'class' => 'chosen_select',
|
173 |
+
'options' => array(
|
174 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
175 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
176 |
+
),
|
177 |
+
'default' => 'no',
|
178 |
+
),
|
179 |
+
array(
|
180 |
+
'name' => esc_html__('Order notes label', 'woocommerce-checkout-manager'),
|
181 |
+
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
182 |
+
'id' => 'wooccm_checkout_order_notes_label',
|
183 |
+
'type' => 'text',
|
184 |
+
'placeholder' => esc_attr__('Order notes', 'woocommerce-checkout-manager'),
|
185 |
+
),
|
186 |
+
array(
|
187 |
+
'name' => esc_html__('Order notes placeholder', 'woocommerce-checkout-manager'),
|
188 |
+
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
189 |
+
'id' => 'wooccm_checkout_order_notes_placeholder',
|
190 |
+
'type' => 'text',
|
191 |
+
'placeholder' => esc_attr__('Notes about your order, e.g. special notes for delivery.', 'woocommerce-checkout-manager'),
|
192 |
+
),
|
193 |
+
array(
|
194 |
+
'name' => esc_html__('Add message before checkout', 'woocommerce-checkout-manager'),
|
195 |
+
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
196 |
+
'id' => 'wooccm_checkout_checkout_form_before_message',
|
197 |
+
'type' => 'textarea',
|
198 |
+
'placeholder' => ''
|
199 |
+
),
|
200 |
+
array(
|
201 |
+
'name' => esc_html__('Add message after checkout', 'woocommerce-checkout-manager'),
|
202 |
+
'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
203 |
+
'id' => 'wooccm_checkout_checkout_form_after_message',
|
204 |
+
'type' => 'textarea',
|
205 |
+
'placeholder' => ''
|
206 |
+
),
|
207 |
+
// thankyou
|
208 |
+
// -------------------------------------------------------------------------
|
209 |
+
//array(
|
210 |
+
// 'name' => esc_html__('Add thankyou custom fields', 'woocommerce-checkout-manager'),
|
211 |
+
// 'desc_tip' => esc_html__('Show the selected fields in the thankyou page.', 'woocommerce-checkout-manager'),
|
212 |
+
// 'id' => 'wooccm_checkout_thankyou_custom_fields',
|
213 |
+
// 'type' => 'select',
|
214 |
+
// 'class' => 'chosen_select',
|
215 |
+
// 'options' => array(
|
216 |
+
// 'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
217 |
+
// 'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
218 |
+
// ),
|
219 |
+
// 'default' => 'no',
|
220 |
+
// ),
|
221 |
+
//array(
|
222 |
+
// 'name' => esc_html__('Add thankyou custom fields title', 'woocommerce-checkout-manager'),
|
223 |
+
// 'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
224 |
+
// 'id' => 'wooccm_checkout_thankyou_custom_fields_text',
|
225 |
+
// 'type' => 'text',
|
226 |
+
// 'placeholder' => esc_html__('Checkout extra', 'woocommerce-checkout-manager')
|
227 |
+
// ),
|
228 |
+
// upload
|
229 |
+
// -------------------------------------------------------------------------
|
230 |
+
//array(
|
231 |
+
// 'name' => esc_html__('Add upload files limit', 'woocommerce-checkout-manager'),
|
232 |
+
// 'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
233 |
+
// 'id' => 'wooccm_checkout_upload_files_limit',
|
234 |
+
// 'type' => 'number',
|
235 |
+
// 'placeholder' => 4
|
236 |
+
// ),
|
237 |
+
//array(
|
238 |
+
// 'name' => esc_html__('Add upload files types', 'woocommerce-checkout-manager'),
|
239 |
+
// 'desc_tip' => esc_html__('Add custom title for the custom fields table in the thankyou page.', 'woocommerce-checkout-manager'),
|
240 |
+
// 'id' => 'wooccm_checkout_upload_files_types',
|
241 |
+
// 'type' => 'text',
|
242 |
+
// 'placeholder' => 'jpg,gif,png'
|
243 |
+
// ),
|
244 |
+
array(
|
245 |
+
'type' => 'sectionend',
|
246 |
+
'id' => 'section_end'
|
247 |
+
)
|
248 |
+
);
|
249 |
+
}
|
250 |
+
|
251 |
+
public function add_header() {
|
252 |
+
global $current_section;
|
253 |
+
?>
|
254 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion'); ?>" class="<?php echo ( $current_section == '' ? 'current' : '' ); ?>"><?php esc_html_e('Checkout', 'woocommerce-checkout-manager'); ?></a> | </li>
|
255 |
+
<?php
|
256 |
+
}
|
257 |
+
|
258 |
+
public function add_section() {
|
259 |
+
|
260 |
+
global $current_section;
|
261 |
+
|
262 |
+
if ('' == $current_section) {
|
263 |
+
|
264 |
+
$settings = $this->get_settings();
|
265 |
+
|
266 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/checkout.php' );
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
public function save_settings() {
|
271 |
+
|
272 |
+
global $current_section;
|
273 |
+
|
274 |
+
if ('' == $current_section) {
|
275 |
+
|
276 |
+
woocommerce_update_options($this->get_settings());
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
// Compatibility
|
281 |
+
// ---------------------------------------------------------------------------
|
282 |
+
|
283 |
+
public function additional_info($value) {
|
284 |
+
|
285 |
+
$options = get_option('wccs_settings');
|
286 |
+
|
287 |
+
if (!empty($options['checkness']['additional_info'])) {
|
288 |
+
return 'yes';
|
289 |
+
}
|
290 |
+
|
291 |
+
if (!empty($options['checkness']['show_shipping_fields'])) {
|
292 |
+
return 'yes';
|
293 |
+
}
|
294 |
+
|
295 |
+
return $value;
|
296 |
+
}
|
297 |
+
|
298 |
+
public function auto_create_wccm_account($value) {
|
299 |
+
|
300 |
+
$options = get_option('wccs_settings');
|
301 |
+
|
302 |
+
if (!empty($options['checkness']['auto_create_wccm_account'])) {
|
303 |
+
return 'yes';
|
304 |
+
}
|
305 |
+
|
306 |
+
return $value;
|
307 |
+
}
|
308 |
+
|
309 |
+
public function notesenable($value) {
|
310 |
+
|
311 |
+
$options = get_option('wccs_settings');
|
312 |
+
|
313 |
+
if (!empty($options['checkness']['notesenable'])) {
|
314 |
+
return 'yes';
|
315 |
+
}
|
316 |
+
|
317 |
+
return $value;
|
318 |
+
}
|
319 |
+
|
320 |
+
public function noteslabel($value) {
|
321 |
+
|
322 |
+
$options = get_option('wccs_settings');
|
323 |
+
|
324 |
+
if ($text = @$options['checkness']['noteslabel']) {
|
325 |
+
return $text;
|
326 |
+
}
|
327 |
+
|
328 |
+
return $value;
|
329 |
+
}
|
330 |
+
|
331 |
+
public function notesplaceholder($value) {
|
332 |
+
|
333 |
+
$options = get_option('wccs_settings');
|
334 |
+
|
335 |
+
if ($text = @$options['checkness']['notesplaceholder']) {
|
336 |
+
return $text;
|
337 |
+
}
|
338 |
+
|
339 |
+
return $value;
|
340 |
+
}
|
341 |
+
|
342 |
+
public function text1($value) {
|
343 |
+
|
344 |
+
$options = get_option('wccs_settings');
|
345 |
+
|
346 |
+
if ($text = @$options['checkness']['text1']) {
|
347 |
+
return $text;
|
348 |
+
}
|
349 |
+
|
350 |
+
return $value;
|
351 |
+
}
|
352 |
+
|
353 |
+
public function text2($value) {
|
354 |
+
|
355 |
+
$options = get_option('wccs_settings');
|
356 |
+
|
357 |
+
if ($text = @$options['checkness']['text2']) {
|
358 |
+
return $text;
|
359 |
+
}
|
360 |
+
|
361 |
+
return $value;
|
362 |
+
}
|
363 |
+
|
364 |
+
public function init() {
|
365 |
+
|
366 |
+
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
|
367 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
368 |
+
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
369 |
+
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
370 |
+
|
371 |
+
// Frontend
|
372 |
+
// -----------------------------------------------------------------------
|
373 |
+
add_action('woocommerce_before_checkout_form', array($this, 'add_inline_scripts'));
|
374 |
+
add_action('woocommerce_checkout_fields', array($this, 'order_notes'));
|
375 |
+
add_action('woocommerce_before_checkout_form', array($this, 'add_checkout_form_before_message'));
|
376 |
+
add_action('woocommerce_after_checkout_form', array($this, 'add_checkout_form_after_message'));
|
377 |
+
add_action('woocommerce_enable_order_notes_field', array($this, 'remove_order_notes'));
|
378 |
+
|
379 |
+
// Compatibility
|
380 |
+
// -----------------------------------------------------------------------
|
381 |
+
add_filter('default_option_wooccm_checkout_force_shipping_address', array($this, 'additional_info'));
|
382 |
+
add_filter('default_option_wooccm_checkout_force_create_account', array($this, 'auto_create_wccm_account'));
|
383 |
+
add_filter('default_option_wooccm_checkout_remove_order_notes', array($this, 'notesenable'));
|
384 |
+
add_filter('default_option_wooccm_checkout_order_notes_label', array($this, 'noteslabel'));
|
385 |
+
add_filter('default_option_wooccm_checkout_order_notes_placeholder', array($this, 'notesplaceholder'));
|
386 |
+
add_filter('default_option_wooccm_checkout_checkout_form_before_message', array($this, 'text1'));
|
387 |
+
add_filter('default_option_wooccm_checkout_checkout_form_after_message', array($this, 'text2'));
|
388 |
+
}
|
389 |
+
|
390 |
+
}
|
391 |
+
|
392 |
+
WOOCCM_Checkout_Controller::instance();
|
393 |
+
|
includes/controller/class-wooccm-email.php
CHANGED
@@ -1,129 +1,129 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Order_Email_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
// Admin
|
19 |
-
// -------------------------------------------------------------------------
|
20 |
-
|
21 |
-
public function get_settings() {
|
22 |
-
return array(
|
23 |
-
array(
|
24 |
-
'type' => 'title',
|
25 |
-
'id' => 'section_title'
|
26 |
-
),
|
27 |
-
array(
|
28 |
-
'name' => esc_html__('Add upload files', 'woocommerce-checkout-manager'),
|
29 |
-
'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager'),
|
30 |
-
'id' => 'wooccm_email_upload_files',
|
31 |
-
'type' => 'select',
|
32 |
-
'class' => 'chosen_select wooccm-premium-field',
|
33 |
-
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
34 |
-
'options' => array(
|
35 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
36 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
37 |
-
),
|
38 |
-
'default' => 'no',
|
39 |
-
),
|
40 |
-
array(
|
41 |
-
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
|
42 |
-
'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager'),
|
43 |
-
'id' => 'wooccm_email_upload_files_order_status',
|
44 |
-
'type' => 'multiselect',
|
45 |
-
'class' => 'chosen_select wooccm-premium-field',
|
46 |
-
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
47 |
-
'options' => wc_get_order_statuses(),
|
48 |
-
'default' => array_keys(wc_get_order_statuses()),
|
49 |
-
),
|
50 |
-
array(
|
51 |
-
'name' => esc_html__('Add upload files title', 'woocommerce-checkout-manager'),
|
52 |
-
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
|
53 |
-
'id' => 'wooccm_email_upload_files_title',
|
54 |
-
'class' => 'wooccm-premium-field',
|
55 |
-
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
56 |
-
'type' => 'text',
|
57 |
-
'placeholder' => esc_html__('Uploaded files', 'woocommerce-checkout-manager')
|
58 |
-
),
|
59 |
-
array(
|
60 |
-
'name' => esc_html__('Add custom fields', 'woocommerce-checkout-manager-pro'),
|
61 |
-
'desc_tip' => esc_html__('Show the selected fields in the email.', 'woocommerce-checkout-manager-pro'),
|
62 |
-
'id' => 'wooccm_email_custom_fields',
|
63 |
-
'type' => 'select',
|
64 |
-
'class' => 'chosen_select wooccm-premium-field',
|
65 |
-
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
66 |
-
'options' => array(
|
67 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager-pro'),
|
68 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager-pro'),
|
69 |
-
),
|
70 |
-
'default' => 'yes',
|
71 |
-
),
|
72 |
-
array(
|
73 |
-
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager-pro'),
|
74 |
-
'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager-pro'),
|
75 |
-
'id' => 'wooccm_email_custom_fields_status',
|
76 |
-
'type' => 'multiselect',
|
77 |
-
'class' => 'chosen_select wooccm-premium-field',
|
78 |
-
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
79 |
-
'options' => wc_get_order_statuses(),
|
80 |
-
'default' => array_keys(wc_get_order_statuses()),
|
81 |
-
),
|
82 |
-
array(
|
83 |
-
'name' => esc_html__('Add custom fields title', 'woocommerce-checkout-manager-pro'),
|
84 |
-
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager-pro'),
|
85 |
-
'id' => 'wooccm_email_custom_fields_title',
|
86 |
-
'type' => 'text',
|
87 |
-
'class' => 'wooccm-premium-field',
|
88 |
-
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
89 |
-
'placeholder' => esc_html__('Order extra', 'woocommerce-checkout-manager-pro')
|
90 |
-
),
|
91 |
-
array(
|
92 |
-
'type' => 'sectionend',
|
93 |
-
'id' => 'section_end'
|
94 |
-
)
|
95 |
-
);
|
96 |
-
}
|
97 |
-
|
98 |
-
public function add_header() {
|
99 |
-
global $current_section;
|
100 |
-
?>
|
101 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=email'); ?>" class="<?php echo ( $current_section == 'email' ? 'current' : '' ); ?>"><?php esc_html_e('Email', 'woocommerce-checkout-manager'); ?></a> | </li>
|
102 |
-
<?php
|
103 |
-
}
|
104 |
-
|
105 |
-
public function add_section() {
|
106 |
-
|
107 |
-
global $current_section;
|
108 |
-
|
109 |
-
if ('email' == $current_section) {
|
110 |
-
|
111 |
-
$settings = $this->get_settings();
|
112 |
-
|
113 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/email.php' );
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
public function save_settings() {
|
118 |
-
woocommerce_update_options($this->get_settings());
|
119 |
-
}
|
120 |
-
|
121 |
-
public function init() {
|
122 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
123 |
-
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'));
|
124 |
-
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
125 |
-
}
|
126 |
-
|
127 |
-
}
|
128 |
-
|
129 |
-
WOOCCM_Order_Email_Controller::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Order_Email_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
// Admin
|
19 |
+
// -------------------------------------------------------------------------
|
20 |
+
|
21 |
+
public function get_settings() {
|
22 |
+
return array(
|
23 |
+
array(
|
24 |
+
'type' => 'title',
|
25 |
+
'id' => 'section_title'
|
26 |
+
),
|
27 |
+
array(
|
28 |
+
'name' => esc_html__('Add upload files', 'woocommerce-checkout-manager'),
|
29 |
+
'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager'),
|
30 |
+
'id' => 'wooccm_email_upload_files',
|
31 |
+
'type' => 'select',
|
32 |
+
'class' => 'chosen_select wooccm-premium-field',
|
33 |
+
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
34 |
+
'options' => array(
|
35 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
36 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
37 |
+
),
|
38 |
+
'default' => 'no',
|
39 |
+
),
|
40 |
+
array(
|
41 |
+
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
|
42 |
+
'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager'),
|
43 |
+
'id' => 'wooccm_email_upload_files_order_status',
|
44 |
+
'type' => 'multiselect',
|
45 |
+
'class' => 'chosen_select wooccm-premium-field',
|
46 |
+
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
47 |
+
'options' => wc_get_order_statuses(),
|
48 |
+
'default' => array_keys(wc_get_order_statuses()),
|
49 |
+
),
|
50 |
+
array(
|
51 |
+
'name' => esc_html__('Add upload files title', 'woocommerce-checkout-manager'),
|
52 |
+
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
|
53 |
+
'id' => 'wooccm_email_upload_files_title',
|
54 |
+
'class' => 'wooccm-premium-field',
|
55 |
+
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
56 |
+
'type' => 'text',
|
57 |
+
'placeholder' => esc_html__('Uploaded files', 'woocommerce-checkout-manager')
|
58 |
+
),
|
59 |
+
array(
|
60 |
+
'name' => esc_html__('Add custom fields', 'woocommerce-checkout-manager-pro'),
|
61 |
+
'desc_tip' => esc_html__('Show the selected fields in the email.', 'woocommerce-checkout-manager-pro'),
|
62 |
+
'id' => 'wooccm_email_custom_fields',
|
63 |
+
'type' => 'select',
|
64 |
+
'class' => 'chosen_select wooccm-premium-field',
|
65 |
+
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
66 |
+
'options' => array(
|
67 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager-pro'),
|
68 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager-pro'),
|
69 |
+
),
|
70 |
+
'default' => 'yes',
|
71 |
+
),
|
72 |
+
array(
|
73 |
+
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager-pro'),
|
74 |
+
'desc_tip' => esc_html__('Allow customers to upload files in the email.', 'woocommerce-checkout-manager-pro'),
|
75 |
+
'id' => 'wooccm_email_custom_fields_status',
|
76 |
+
'type' => 'multiselect',
|
77 |
+
'class' => 'chosen_select wooccm-premium-field',
|
78 |
+
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
79 |
+
'options' => wc_get_order_statuses(),
|
80 |
+
'default' => array_keys(wc_get_order_statuses()),
|
81 |
+
),
|
82 |
+
array(
|
83 |
+
'name' => esc_html__('Add custom fields title', 'woocommerce-checkout-manager-pro'),
|
84 |
+
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager-pro'),
|
85 |
+
'id' => 'wooccm_email_custom_fields_title',
|
86 |
+
'type' => 'text',
|
87 |
+
'class' => 'wooccm-premium-field',
|
88 |
+
'desc' => esc_html__('This is a premium feature.', 'woocommerce-checkout-manager'),
|
89 |
+
'placeholder' => esc_html__('Order extra', 'woocommerce-checkout-manager-pro')
|
90 |
+
),
|
91 |
+
array(
|
92 |
+
'type' => 'sectionend',
|
93 |
+
'id' => 'section_end'
|
94 |
+
)
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
public function add_header() {
|
99 |
+
global $current_section;
|
100 |
+
?>
|
101 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=email'); ?>" class="<?php echo ( $current_section == 'email' ? 'current' : '' ); ?>"><?php esc_html_e('Email', 'woocommerce-checkout-manager'); ?></a> | </li>
|
102 |
+
<?php
|
103 |
+
}
|
104 |
+
|
105 |
+
public function add_section() {
|
106 |
+
|
107 |
+
global $current_section;
|
108 |
+
|
109 |
+
if ('email' == $current_section) {
|
110 |
+
|
111 |
+
$settings = $this->get_settings();
|
112 |
+
|
113 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/email.php' );
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
public function save_settings() {
|
118 |
+
woocommerce_update_options($this->get_settings());
|
119 |
+
}
|
120 |
+
|
121 |
+
public function init() {
|
122 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
123 |
+
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'));
|
124 |
+
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
125 |
+
}
|
126 |
+
|
127 |
+
}
|
128 |
+
|
129 |
+
WOOCCM_Order_Email_Controller::instance();
|
includes/controller/class-wooccm-field-additional.php
CHANGED
@@ -1,222 +1,222 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Field_Controller_Additional extends WOOCCM_Field_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
public $additional;
|
7 |
-
|
8 |
-
public function __construct() {
|
9 |
-
$this->includes();
|
10 |
-
$this->init();
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function instance() {
|
14 |
-
if (is_null(self::$_instance)) {
|
15 |
-
self::$_instance = new self();
|
16 |
-
}
|
17 |
-
return self::$_instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
function includes() {
|
21 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-additional.php' );
|
22 |
-
}
|
23 |
-
|
24 |
-
function init() {
|
25 |
-
add_action('woocommerce_admin_order_data_after_shipping_address', array($this, 'add_order_data'));
|
26 |
-
add_action('woocommerce_checkout_update_order_meta', array($this, 'save_order_data'), 10, 2);
|
27 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
28 |
-
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
29 |
-
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
30 |
-
}
|
31 |
-
|
32 |
-
function save_order_data($order_id, $data) {
|
33 |
-
|
34 |
-
if (count($fields = WOOCCM()->additional->get_fields())) {
|
35 |
-
|
36 |
-
foreach ($fields as $field_id => $field) {
|
37 |
-
|
38 |
-
$key = sprintf('_%s', $field['key']);
|
39 |
-
|
40 |
-
if (!empty($data[$field['key']])) {
|
41 |
-
|
42 |
-
$value = $data[$field['key']];
|
43 |
-
|
44 |
-
if ($field['type'] == 'textarea') {
|
45 |
-
update_post_meta($order_id, $key, wp_kses($value, false));
|
46 |
-
} else if (is_array($value)) {
|
47 |
-
update_post_meta($order_id, $key, implode(',', array_map('sanitize_text_field', $value)));
|
48 |
-
} else {
|
49 |
-
update_post_meta($order_id, $key, sanitize_text_field($value));
|
50 |
-
}
|
51 |
-
}
|
52 |
-
//
|
53 |
-
}
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
function save_settings() {
|
58 |
-
|
59 |
-
global $current_section;
|
60 |
-
|
61 |
-
if ('additional' == $current_section) {
|
62 |
-
woocommerce_update_options($this->get_settings());
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
function get_settings() {
|
67 |
-
|
68 |
-
return array(
|
69 |
-
array(
|
70 |
-
'desc_tip' => esc_html__('Select the position of the additional fields.', 'woocommerce-checkout-manager'),
|
71 |
-
'id' => 'wooccm_additional_position',
|
72 |
-
'type' => 'select',
|
73 |
-
//'class' => 'chosen_select',
|
74 |
-
'options' => array(
|
75 |
-
'before_billing_form' => esc_html__('Before billing form', 'woocommerce-checkout-manager'),
|
76 |
-
'after_billing_form' => esc_html__('After billing form', 'woocommerce-checkout-manager'),
|
77 |
-
'before_order_notes' => esc_html__('Before order notes', 'woocommerce-checkout-manager'),
|
78 |
-
'after_order_notes' => esc_html__('After order notes', 'woocommerce-checkout-manager'),
|
79 |
-
),
|
80 |
-
'default' => 'before_order_notes',
|
81 |
-
));
|
82 |
-
}
|
83 |
-
|
84 |
-
// Admin Order
|
85 |
-
// ---------------------------------------------------------------------------
|
86 |
-
|
87 |
-
function add_order_data($order) {
|
88 |
-
|
89 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-handler.php' );
|
90 |
-
|
91 |
-
if ($fields = WOOCCM()->additional->get_fields()) {
|
92 |
-
$template = WOOCCM()->additional->get_template_types();
|
93 |
-
$options = WOOCCM()->additional->get_option_types();
|
94 |
-
$multiple = WOOCCM()->additional->get_multiple_types();
|
95 |
-
?>
|
96 |
-
</div>
|
97 |
-
<style>
|
98 |
-
#order_data .order_data_column {
|
99 |
-
width: 23%;
|
100 |
-
}
|
101 |
-
#order_data .order_data_column_additional .form-field {
|
102 |
-
width: 100%;
|
103 |
-
clear: both;
|
104 |
-
}
|
105 |
-
</style>
|
106 |
-
<div class="order_data_column order_data_column_additional">
|
107 |
-
<h3>
|
108 |
-
<?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?>
|
109 |
-
<a href="#" class="edit_address"><?php esc_html_e('Edit', 'woocommerce-checkout-manager'); ?></a>
|
110 |
-
<span>
|
111 |
-
<a href="<?php echo esc_url(WOOCCM_PURCHASE_URL); ?>" class="load_customer_additional" target="_blank" style="display:none;font-size: 13px;font-weight: 400;">
|
112 |
-
<?php esc_html_e('This is a premium feature.', 'woocommerce-checkout-manager'); ?>
|
113 |
-
</a>
|
114 |
-
</span>
|
115 |
-
</h3>
|
116 |
-
<div class="address">
|
117 |
-
<?php
|
118 |
-
foreach ($fields as $field_id => $field) {
|
119 |
-
|
120 |
-
$key = sprintf('_%s', $field['key']);
|
121 |
-
|
122 |
-
if (!$value = get_post_meta($order->get_id(), $key, true)) {
|
123 |
-
|
124 |
-
$value = maybe_unserialize(get_post_meta($order->get_id(), sprintf('%s', $field['name']), true));
|
125 |
-
|
126 |
-
if (is_array($value)) {
|
127 |
-
$value = implode(',', $value);
|
128 |
-
}
|
129 |
-
|
130 |
-
update_post_meta($order->get_id(), $key, $value);
|
131 |
-
delete_post_meta($order->get_id(), sprintf('%s', $field['name']));
|
132 |
-
}
|
133 |
-
|
134 |
-
if ($value) {
|
135 |
-
?>
|
136 |
-
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
137 |
-
<strong title="<?php echo esc_attr(sprintf(__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, __('Generic', 'woocommerce-checkout-manager'))); ?>">
|
138 |
-
<?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?>
|
139 |
-
</strong>
|
140 |
-
<?php echo esc_html($value); ?>
|
141 |
-
</p>
|
142 |
-
<?php
|
143 |
-
}
|
144 |
-
}
|
145 |
-
?>
|
146 |
-
</div>
|
147 |
-
<div class="edit_address">
|
148 |
-
<?php
|
149 |
-
foreach ($fields as $field_id => $field) {
|
150 |
-
|
151 |
-
if (in_array($field['type'], $template)) {
|
152 |
-
continue;
|
153 |
-
}
|
154 |
-
|
155 |
-
$key = sprintf('_%s', $field['key']);
|
156 |
-
|
157 |
-
$field['id'] = sprintf('_%s', $field['key']);
|
158 |
-
$field['name'] = $field['key'];
|
159 |
-
$field['value'] = null;
|
160 |
-
$field['class'] = join(' ', $field['class']);
|
161 |
-
$field['wrapper_class'] = 'wooccm-premium';
|
162 |
-
|
163 |
-
if (!$field['value'] = get_post_meta($order->get_id(), $key, true)) {
|
164 |
-
|
165 |
-
$field['value'] = maybe_unserialize(get_post_meta($order->get_id(), sprintf('%s', $field['name']), true));
|
166 |
-
|
167 |
-
if (is_array($field['value'])) {
|
168 |
-
$field['value'] = implode(',', $field['value']);
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
switch ($field['type']) {
|
173 |
-
case 'textarea':
|
174 |
-
woocommerce_wp_textarea_input($field);
|
175 |
-
break;
|
176 |
-
default:
|
177 |
-
$field['type'] = 'text';
|
178 |
-
woocommerce_wp_text_input($field);
|
179 |
-
break;
|
180 |
-
}
|
181 |
-
}
|
182 |
-
?>
|
183 |
-
</div>
|
184 |
-
<?php
|
185 |
-
}
|
186 |
-
}
|
187 |
-
|
188 |
-
// Admin
|
189 |
-
// ---------------------------------------------------------------------------
|
190 |
-
|
191 |
-
public function add_header() {
|
192 |
-
global $current_section;
|
193 |
-
?>
|
194 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=additional'); ?>" class="<?php echo ( $current_section == 'additional' ? 'current' : '' ); ?>"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></a> | </li>
|
195 |
-
<?php
|
196 |
-
}
|
197 |
-
|
198 |
-
public function add_section() {
|
199 |
-
|
200 |
-
global $current_section, $wp_roles, $wp_locale;
|
201 |
-
|
202 |
-
if ('additional' == $current_section) {
|
203 |
-
|
204 |
-
$fields = WOOCCM()->additional->get_fields();
|
205 |
-
$defaults = WOOCCM()->additional->get_defaults();
|
206 |
-
$types = WOOCCM()->additional->get_types();
|
207 |
-
$conditionals = WOOCCM()->additional->get_conditional_types();
|
208 |
-
$option = WOOCCM()->additional->get_option_types();
|
209 |
-
$multiple = WOOCCM()->additional->get_multiple_types();
|
210 |
-
$template = WOOCCM()->additional->get_template_types();
|
211 |
-
$disabled = WOOCCM()->additional->get_disabled_types();
|
212 |
-
$product_categories = $this->get_product_categories();
|
213 |
-
$settings = $this->get_settings();
|
214 |
-
|
215 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/additional.php' );
|
216 |
-
}
|
217 |
-
}
|
218 |
-
|
219 |
-
}
|
220 |
-
|
221 |
-
WOOCCM_Field_Controller_Additional::instance();
|
222 |
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Field_Controller_Additional extends WOOCCM_Field_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
public $additional;
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
$this->includes();
|
10 |
+
$this->init();
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (is_null(self::$_instance)) {
|
15 |
+
self::$_instance = new self();
|
16 |
+
}
|
17 |
+
return self::$_instance;
|
18 |
+
}
|
19 |
+
|
20 |
+
function includes() {
|
21 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-additional.php' );
|
22 |
+
}
|
23 |
+
|
24 |
+
function init() {
|
25 |
+
add_action('woocommerce_admin_order_data_after_shipping_address', array($this, 'add_order_data'));
|
26 |
+
add_action('woocommerce_checkout_update_order_meta', array($this, 'save_order_data'), 10, 2);
|
27 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
28 |
+
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
29 |
+
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
30 |
+
}
|
31 |
+
|
32 |
+
function save_order_data($order_id, $data) {
|
33 |
+
|
34 |
+
if (count($fields = WOOCCM()->additional->get_fields())) {
|
35 |
+
|
36 |
+
foreach ($fields as $field_id => $field) {
|
37 |
+
|
38 |
+
$key = sprintf('_%s', $field['key']);
|
39 |
+
|
40 |
+
if (!empty($data[$field['key']])) {
|
41 |
+
|
42 |
+
$value = $data[$field['key']];
|
43 |
+
|
44 |
+
if ($field['type'] == 'textarea') {
|
45 |
+
update_post_meta($order_id, $key, wp_kses($value, false));
|
46 |
+
} else if (is_array($value)) {
|
47 |
+
update_post_meta($order_id, $key, implode(',', array_map('sanitize_text_field', $value)));
|
48 |
+
} else {
|
49 |
+
update_post_meta($order_id, $key, sanitize_text_field($value));
|
50 |
+
}
|
51 |
+
}
|
52 |
+
//
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
function save_settings() {
|
58 |
+
|
59 |
+
global $current_section;
|
60 |
+
|
61 |
+
if ('additional' == $current_section) {
|
62 |
+
woocommerce_update_options($this->get_settings());
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
function get_settings() {
|
67 |
+
|
68 |
+
return array(
|
69 |
+
array(
|
70 |
+
'desc_tip' => esc_html__('Select the position of the additional fields.', 'woocommerce-checkout-manager'),
|
71 |
+
'id' => 'wooccm_additional_position',
|
72 |
+
'type' => 'select',
|
73 |
+
//'class' => 'chosen_select',
|
74 |
+
'options' => array(
|
75 |
+
'before_billing_form' => esc_html__('Before billing form', 'woocommerce-checkout-manager'),
|
76 |
+
'after_billing_form' => esc_html__('After billing form', 'woocommerce-checkout-manager'),
|
77 |
+
'before_order_notes' => esc_html__('Before order notes', 'woocommerce-checkout-manager'),
|
78 |
+
'after_order_notes' => esc_html__('After order notes', 'woocommerce-checkout-manager'),
|
79 |
+
),
|
80 |
+
'default' => 'before_order_notes',
|
81 |
+
));
|
82 |
+
}
|
83 |
+
|
84 |
+
// Admin Order
|
85 |
+
// ---------------------------------------------------------------------------
|
86 |
+
|
87 |
+
function add_order_data($order) {
|
88 |
+
|
89 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-handler.php' );
|
90 |
+
|
91 |
+
if ($fields = WOOCCM()->additional->get_fields()) {
|
92 |
+
$template = WOOCCM()->additional->get_template_types();
|
93 |
+
$options = WOOCCM()->additional->get_option_types();
|
94 |
+
$multiple = WOOCCM()->additional->get_multiple_types();
|
95 |
+
?>
|
96 |
+
</div>
|
97 |
+
<style>
|
98 |
+
#order_data .order_data_column {
|
99 |
+
width: 23%;
|
100 |
+
}
|
101 |
+
#order_data .order_data_column_additional .form-field {
|
102 |
+
width: 100%;
|
103 |
+
clear: both;
|
104 |
+
}
|
105 |
+
</style>
|
106 |
+
<div class="order_data_column order_data_column_additional">
|
107 |
+
<h3>
|
108 |
+
<?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?>
|
109 |
+
<a href="#" class="edit_address"><?php esc_html_e('Edit', 'woocommerce-checkout-manager'); ?></a>
|
110 |
+
<span>
|
111 |
+
<a href="<?php echo esc_url(WOOCCM_PURCHASE_URL); ?>" class="load_customer_additional" target="_blank" style="display:none;font-size: 13px;font-weight: 400;">
|
112 |
+
<?php esc_html_e('This is a premium feature.', 'woocommerce-checkout-manager'); ?>
|
113 |
+
</a>
|
114 |
+
</span>
|
115 |
+
</h3>
|
116 |
+
<div class="address">
|
117 |
+
<?php
|
118 |
+
foreach ($fields as $field_id => $field) {
|
119 |
+
|
120 |
+
$key = sprintf('_%s', $field['key']);
|
121 |
+
|
122 |
+
if (!$value = get_post_meta($order->get_id(), $key, true)) {
|
123 |
+
|
124 |
+
$value = maybe_unserialize(get_post_meta($order->get_id(), sprintf('%s', $field['name']), true));
|
125 |
+
|
126 |
+
if (is_array($value)) {
|
127 |
+
$value = implode(',', $value);
|
128 |
+
}
|
129 |
+
|
130 |
+
update_post_meta($order->get_id(), $key, $value);
|
131 |
+
delete_post_meta($order->get_id(), sprintf('%s', $field['name']));
|
132 |
+
}
|
133 |
+
|
134 |
+
if ($value) {
|
135 |
+
?>
|
136 |
+
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
137 |
+
<strong title="<?php echo esc_attr(sprintf(__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, __('Generic', 'woocommerce-checkout-manager'))); ?>">
|
138 |
+
<?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?>
|
139 |
+
</strong>
|
140 |
+
<?php echo esc_html($value); ?>
|
141 |
+
</p>
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
}
|
145 |
+
?>
|
146 |
+
</div>
|
147 |
+
<div class="edit_address">
|
148 |
+
<?php
|
149 |
+
foreach ($fields as $field_id => $field) {
|
150 |
+
|
151 |
+
if (in_array($field['type'], $template)) {
|
152 |
+
continue;
|
153 |
+
}
|
154 |
+
|
155 |
+
$key = sprintf('_%s', $field['key']);
|
156 |
+
|
157 |
+
$field['id'] = sprintf('_%s', $field['key']);
|
158 |
+
$field['name'] = $field['key'];
|
159 |
+
$field['value'] = null;
|
160 |
+
$field['class'] = join(' ', $field['class']);
|
161 |
+
$field['wrapper_class'] = 'wooccm-premium';
|
162 |
+
|
163 |
+
if (!$field['value'] = get_post_meta($order->get_id(), $key, true)) {
|
164 |
+
|
165 |
+
$field['value'] = maybe_unserialize(get_post_meta($order->get_id(), sprintf('%s', $field['name']), true));
|
166 |
+
|
167 |
+
if (is_array($field['value'])) {
|
168 |
+
$field['value'] = implode(',', $field['value']);
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
switch ($field['type']) {
|
173 |
+
case 'textarea':
|
174 |
+
woocommerce_wp_textarea_input($field);
|
175 |
+
break;
|
176 |
+
default:
|
177 |
+
$field['type'] = 'text';
|
178 |
+
woocommerce_wp_text_input($field);
|
179 |
+
break;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
?>
|
183 |
+
</div>
|
184 |
+
<?php
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
+
// Admin
|
189 |
+
// ---------------------------------------------------------------------------
|
190 |
+
|
191 |
+
public function add_header() {
|
192 |
+
global $current_section;
|
193 |
+
?>
|
194 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=additional'); ?>" class="<?php echo ( $current_section == 'additional' ? 'current' : '' ); ?>"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></a> | </li>
|
195 |
+
<?php
|
196 |
+
}
|
197 |
+
|
198 |
+
public function add_section() {
|
199 |
+
|
200 |
+
global $current_section, $wp_roles, $wp_locale;
|
201 |
+
|
202 |
+
if ('additional' == $current_section) {
|
203 |
+
|
204 |
+
$fields = WOOCCM()->additional->get_fields();
|
205 |
+
$defaults = WOOCCM()->additional->get_defaults();
|
206 |
+
$types = WOOCCM()->additional->get_types();
|
207 |
+
$conditionals = WOOCCM()->additional->get_conditional_types();
|
208 |
+
$option = WOOCCM()->additional->get_option_types();
|
209 |
+
$multiple = WOOCCM()->additional->get_multiple_types();
|
210 |
+
$template = WOOCCM()->additional->get_template_types();
|
211 |
+
$disabled = WOOCCM()->additional->get_disabled_types();
|
212 |
+
$product_categories = $this->get_product_categories();
|
213 |
+
$settings = $this->get_settings();
|
214 |
+
|
215 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/additional.php' );
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
}
|
220 |
+
|
221 |
+
WOOCCM_Field_Controller_Additional::instance();
|
222 |
|
includes/controller/class-wooccm-field-billing.php
CHANGED
@@ -1,93 +1,93 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Field_Controller_Billing extends WOOCCM_Field_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
public $billing;
|
7 |
-
|
8 |
-
public function __construct() {
|
9 |
-
$this->includes();
|
10 |
-
$this->init();
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function instance() {
|
14 |
-
if (is_null(self::$_instance)) {
|
15 |
-
self::$_instance = new self();
|
16 |
-
}
|
17 |
-
return self::$_instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
function includes() {
|
21 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-billing.php' );
|
22 |
-
}
|
23 |
-
|
24 |
-
function init() {
|
25 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
26 |
-
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
27 |
-
add_action('woocommerce_admin_order_data_after_billing_address', array($this, 'add_order_data'));
|
28 |
-
}
|
29 |
-
|
30 |
-
// Admin
|
31 |
-
// ---------------------------------------------------------------------------
|
32 |
-
|
33 |
-
public function add_section() {
|
34 |
-
|
35 |
-
global $current_section, $wp_roles, $wp_locale;
|
36 |
-
|
37 |
-
if ('billing' == $current_section) {
|
38 |
-
|
39 |
-
$fields = WOOCCM()->billing->get_fields();
|
40 |
-
$defaults = WOOCCM()->billing->get_defaults();
|
41 |
-
$types = WOOCCM()->billing->get_types();
|
42 |
-
$conditionals = WOOCCM()->billing->get_conditional_types();
|
43 |
-
$option = WOOCCM()->billing->get_option_types();
|
44 |
-
$multiple = WOOCCM()->billing->get_multiple_types();
|
45 |
-
$template = WOOCCM()->billing->get_template_types();
|
46 |
-
$disabled = WOOCCM()->billing->get_disabled_types();
|
47 |
-
$product_categories = $this->get_product_categories();
|
48 |
-
|
49 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/billing.php' );
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
public function add_header() {
|
54 |
-
global $current_section;
|
55 |
-
?>
|
56 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=billing'); ?>" class="<?php echo ( $current_section == 'billing' ? 'current' : '' ); ?>"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></a> | </li>
|
57 |
-
<?php
|
58 |
-
}
|
59 |
-
|
60 |
-
// Admin Order
|
61 |
-
// ---------------------------------------------------------------------------
|
62 |
-
|
63 |
-
function add_order_data($order) {
|
64 |
-
|
65 |
-
if ($fields = WOOCCM()->billing->get_fields()) {
|
66 |
-
|
67 |
-
$defaults = WOOCCM()->billing->get_defaults();
|
68 |
-
|
69 |
-
foreach ($fields as $field_id => $field) {
|
70 |
-
|
71 |
-
if (!in_array($field['name'], $defaults)) {
|
72 |
-
|
73 |
-
$key = sprintf('_%s', $field['key']);
|
74 |
-
|
75 |
-
if ($value = get_post_meta($order->get_id(), $key, true)) {
|
76 |
-
?>
|
77 |
-
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
78 |
-
<strong title="<?php echo esc_attr(sprintf(__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, __('Generic', 'woocommerce-checkout-manager'))); ?>">
|
79 |
-
<?php echo esc_attr(trim($field['label'])); ?>:
|
80 |
-
</strong>
|
81 |
-
<br />
|
82 |
-
<?php echo esc_html($value); ?>
|
83 |
-
</p>
|
84 |
-
<?php
|
85 |
-
}
|
86 |
-
}
|
87 |
-
}
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
}
|
92 |
-
|
93 |
-
WOOCCM_Field_Controller_Billing::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Field_Controller_Billing extends WOOCCM_Field_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
public $billing;
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
$this->includes();
|
10 |
+
$this->init();
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (is_null(self::$_instance)) {
|
15 |
+
self::$_instance = new self();
|
16 |
+
}
|
17 |
+
return self::$_instance;
|
18 |
+
}
|
19 |
+
|
20 |
+
function includes() {
|
21 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-billing.php' );
|
22 |
+
}
|
23 |
+
|
24 |
+
function init() {
|
25 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
26 |
+
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
27 |
+
add_action('woocommerce_admin_order_data_after_billing_address', array($this, 'add_order_data'));
|
28 |
+
}
|
29 |
+
|
30 |
+
// Admin
|
31 |
+
// ---------------------------------------------------------------------------
|
32 |
+
|
33 |
+
public function add_section() {
|
34 |
+
|
35 |
+
global $current_section, $wp_roles, $wp_locale;
|
36 |
+
|
37 |
+
if ('billing' == $current_section) {
|
38 |
+
|
39 |
+
$fields = WOOCCM()->billing->get_fields();
|
40 |
+
$defaults = WOOCCM()->billing->get_defaults();
|
41 |
+
$types = WOOCCM()->billing->get_types();
|
42 |
+
$conditionals = WOOCCM()->billing->get_conditional_types();
|
43 |
+
$option = WOOCCM()->billing->get_option_types();
|
44 |
+
$multiple = WOOCCM()->billing->get_multiple_types();
|
45 |
+
$template = WOOCCM()->billing->get_template_types();
|
46 |
+
$disabled = WOOCCM()->billing->get_disabled_types();
|
47 |
+
$product_categories = $this->get_product_categories();
|
48 |
+
|
49 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/billing.php' );
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
public function add_header() {
|
54 |
+
global $current_section;
|
55 |
+
?>
|
56 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=billing'); ?>" class="<?php echo ( $current_section == 'billing' ? 'current' : '' ); ?>"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></a> | </li>
|
57 |
+
<?php
|
58 |
+
}
|
59 |
+
|
60 |
+
// Admin Order
|
61 |
+
// ---------------------------------------------------------------------------
|
62 |
+
|
63 |
+
function add_order_data($order) {
|
64 |
+
|
65 |
+
if ($fields = WOOCCM()->billing->get_fields()) {
|
66 |
+
|
67 |
+
$defaults = WOOCCM()->billing->get_defaults();
|
68 |
+
|
69 |
+
foreach ($fields as $field_id => $field) {
|
70 |
+
|
71 |
+
if (!in_array($field['name'], $defaults)) {
|
72 |
+
|
73 |
+
$key = sprintf('_%s', $field['key']);
|
74 |
+
|
75 |
+
if ($value = get_post_meta($order->get_id(), $key, true)) {
|
76 |
+
?>
|
77 |
+
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
78 |
+
<strong title="<?php echo esc_attr(sprintf(__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, __('Generic', 'woocommerce-checkout-manager'))); ?>">
|
79 |
+
<?php echo esc_attr(trim($field['label'])); ?>:
|
80 |
+
</strong>
|
81 |
+
<br />
|
82 |
+
<?php echo esc_html($value); ?>
|
83 |
+
</p>
|
84 |
+
<?php
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
92 |
+
|
93 |
+
WOOCCM_Field_Controller_Billing::instance();
|
includes/controller/class-wooccm-field-shipping.php
CHANGED
@@ -1,93 +1,93 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Field_Controller_Shipping extends WOOCCM_Field_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
public $shipping;
|
7 |
-
|
8 |
-
public function __construct() {
|
9 |
-
$this->includes();
|
10 |
-
$this->init();
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function instance() {
|
14 |
-
if (is_null(self::$_instance)) {
|
15 |
-
self::$_instance = new self();
|
16 |
-
}
|
17 |
-
return self::$_instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
function includes() {
|
21 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-shipping.php' );
|
22 |
-
}
|
23 |
-
|
24 |
-
function init() {
|
25 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
26 |
-
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
27 |
-
add_action('woocommerce_admin_order_data_after_shipping_address', array($this, 'add_order_data'));
|
28 |
-
}
|
29 |
-
|
30 |
-
// Admin
|
31 |
-
// ---------------------------------------------------------------------------
|
32 |
-
|
33 |
-
public function add_header() {
|
34 |
-
global $current_section;
|
35 |
-
?>
|
36 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=shipping'); ?>" class="<?php echo ( $current_section == 'shipping' ? 'current' : '' ); ?>"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></a> | </li>
|
37 |
-
<?php
|
38 |
-
}
|
39 |
-
|
40 |
-
public function add_section() {
|
41 |
-
|
42 |
-
global $current_section, $wp_roles, $wp_locale;
|
43 |
-
|
44 |
-
if ('shipping' == $current_section) {
|
45 |
-
|
46 |
-
$fields = WOOCCM()->shipping->get_fields();
|
47 |
-
$defaults = WOOCCM()->shipping->get_defaults();
|
48 |
-
$types = WOOCCM()->shipping->get_types();
|
49 |
-
$conditionals = WOOCCM()->shipping->get_conditional_types();
|
50 |
-
$option = WOOCCM()->billing->get_option_types();
|
51 |
-
$multiple = WOOCCM()->billing->get_multiple_types();
|
52 |
-
$template = WOOCCM()->billing->get_template_types();
|
53 |
-
$disabled = WOOCCM()->billing->get_disabled_types();
|
54 |
-
$product_categories = $this->get_product_categories();
|
55 |
-
|
56 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/shipping.php' );
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
// Admin Order
|
61 |
-
// ---------------------------------------------------------------------------
|
62 |
-
|
63 |
-
function add_order_data($order) {
|
64 |
-
|
65 |
-
if ($fields = WOOCCM()->shipping->get_fields()) {
|
66 |
-
|
67 |
-
$defaults = WOOCCM()->shipping->get_defaults();
|
68 |
-
|
69 |
-
foreach ($fields as $field_id => $field) {
|
70 |
-
|
71 |
-
if (!in_array($field['name'], $defaults)) {
|
72 |
-
|
73 |
-
$key = sprintf('_%s', $field['key']);
|
74 |
-
|
75 |
-
if ($value = get_post_meta($order->get_id(), $key, true)) {
|
76 |
-
?>
|
77 |
-
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
78 |
-
<strong title="<?php echo esc_attr(sprintf(__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, __('Generic', 'woocommerce-checkout-manager'))); ?>">
|
79 |
-
<?php echo esc_attr(trim($field['label'])); ?>:
|
80 |
-
</strong>
|
81 |
-
<br/>
|
82 |
-
<?php echo esc_html($value); ?>
|
83 |
-
</p>
|
84 |
-
<?php
|
85 |
-
}
|
86 |
-
}
|
87 |
-
}
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
}
|
92 |
-
|
93 |
-
WOOCCM_Field_Controller_Shipping::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Field_Controller_Shipping extends WOOCCM_Field_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
public $shipping;
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
$this->includes();
|
10 |
+
$this->init();
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (is_null(self::$_instance)) {
|
15 |
+
self::$_instance = new self();
|
16 |
+
}
|
17 |
+
return self::$_instance;
|
18 |
+
}
|
19 |
+
|
20 |
+
function includes() {
|
21 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/model/class-wooccm-field-shipping.php' );
|
22 |
+
}
|
23 |
+
|
24 |
+
function init() {
|
25 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
26 |
+
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
27 |
+
add_action('woocommerce_admin_order_data_after_shipping_address', array($this, 'add_order_data'));
|
28 |
+
}
|
29 |
+
|
30 |
+
// Admin
|
31 |
+
// ---------------------------------------------------------------------------
|
32 |
+
|
33 |
+
public function add_header() {
|
34 |
+
global $current_section;
|
35 |
+
?>
|
36 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=shipping'); ?>" class="<?php echo ( $current_section == 'shipping' ? 'current' : '' ); ?>"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></a> | </li>
|
37 |
+
<?php
|
38 |
+
}
|
39 |
+
|
40 |
+
public function add_section() {
|
41 |
+
|
42 |
+
global $current_section, $wp_roles, $wp_locale;
|
43 |
+
|
44 |
+
if ('shipping' == $current_section) {
|
45 |
+
|
46 |
+
$fields = WOOCCM()->shipping->get_fields();
|
47 |
+
$defaults = WOOCCM()->shipping->get_defaults();
|
48 |
+
$types = WOOCCM()->shipping->get_types();
|
49 |
+
$conditionals = WOOCCM()->shipping->get_conditional_types();
|
50 |
+
$option = WOOCCM()->billing->get_option_types();
|
51 |
+
$multiple = WOOCCM()->billing->get_multiple_types();
|
52 |
+
$template = WOOCCM()->billing->get_template_types();
|
53 |
+
$disabled = WOOCCM()->billing->get_disabled_types();
|
54 |
+
$product_categories = $this->get_product_categories();
|
55 |
+
|
56 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/shipping.php' );
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
// Admin Order
|
61 |
+
// ---------------------------------------------------------------------------
|
62 |
+
|
63 |
+
function add_order_data($order) {
|
64 |
+
|
65 |
+
if ($fields = WOOCCM()->shipping->get_fields()) {
|
66 |
+
|
67 |
+
$defaults = WOOCCM()->shipping->get_defaults();
|
68 |
+
|
69 |
+
foreach ($fields as $field_id => $field) {
|
70 |
+
|
71 |
+
if (!in_array($field['name'], $defaults)) {
|
72 |
+
|
73 |
+
$key = sprintf('_%s', $field['key']);
|
74 |
+
|
75 |
+
if ($value = get_post_meta($order->get_id(), $key, true)) {
|
76 |
+
?>
|
77 |
+
<p id="<?php echo esc_attr($field['key']); ?>" class="form-field form-field-wide form-field-type-<?php echo esc_attr($field['type']); ?>">
|
78 |
+
<strong title="<?php echo esc_attr(sprintf(__('ID: %s | Field Type: %s', 'woocommerce-checkout-manager'), $key, __('Generic', 'woocommerce-checkout-manager'))); ?>">
|
79 |
+
<?php echo esc_attr(trim($field['label'])); ?>:
|
80 |
+
</strong>
|
81 |
+
<br/>
|
82 |
+
<?php echo esc_html($value); ?>
|
83 |
+
</p>
|
84 |
+
<?php
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
92 |
+
|
93 |
+
WOOCCM_Field_Controller_Shipping::instance();
|
includes/controller/class-wooccm-field.php
CHANGED
@@ -1,387 +1,387 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Field_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
public $billing;
|
7 |
-
|
8 |
-
public function __construct() {
|
9 |
-
$this->includes();
|
10 |
-
$this->init();
|
11 |
-
}
|
12 |
-
|
13 |
-
public static function instance() {
|
14 |
-
if (is_null(self::$_instance)) {
|
15 |
-
self::$_instance = new self();
|
16 |
-
}
|
17 |
-
return self::$_instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
function enqueue_scripts() {
|
21 |
-
|
22 |
-
global $current_section;
|
23 |
-
|
24 |
-
wp_register_script('wooccm-admin-field', plugins_url('assets/backend/js/wooccm-admin-field.js', WOOCCM_PLUGIN_FILE), array('jquery', 'jquery-ui-datepicker', 'backbone', 'wp-util'), WOOCCM_PLUGIN_VERSION, true);
|
25 |
-
|
26 |
-
wp_localize_script('wooccm-admin-field', 'wooccm_field', array(
|
27 |
-
'ajax_url' => admin_url('admin-ajax.php?section=' . $current_section),
|
28 |
-
'nonce' => wp_create_nonce('wooccm_field'),
|
29 |
-
'args' => WOOCCM()->billing->get_args(),
|
30 |
-
'message' => array(
|
31 |
-
'remove' => esc_html__('Are you sure you want to remove this field?', 'woocommerce-checkout-manager'),
|
32 |
-
'reset' => esc_html__('Are you sure you want to reset this fields?', 'woocommerce-checkout-manager')
|
33 |
-
)
|
34 |
-
));
|
35 |
-
|
36 |
-
if (isset($_GET['tab']) && $_GET['tab'] === WOOCCM_PREFIX) {
|
37 |
-
wp_enqueue_style('media-views');
|
38 |
-
wp_enqueue_script('wooccm-admin-field');
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
public function get_product_categories() {
|
43 |
-
|
44 |
-
$args = array(
|
45 |
-
'taxonomy' => 'product_cat',
|
46 |
-
'orderby' => 'id',
|
47 |
-
'order' => 'ASC',
|
48 |
-
'hide_empty' => true,
|
49 |
-
'fields' => 'all');
|
50 |
-
|
51 |
-
return get_terms($args);
|
52 |
-
}
|
53 |
-
|
54 |
-
// Ajax
|
55 |
-
// ---------------------------------------------------------------------------
|
56 |
-
|
57 |
-
public function ajax_toggle_field_attribute() {
|
58 |
-
|
59 |
-
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id']) && isset($_REQUEST['field_attr'])) {
|
60 |
-
|
61 |
-
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
62 |
-
$attr = wc_clean(wp_unslash($_REQUEST['field_attr']));
|
63 |
-
|
64 |
-
$status = $this->toggle_field_attribute($field_id, $attr);
|
65 |
-
|
66 |
-
wp_send_json_success($status);
|
67 |
-
}
|
68 |
-
|
69 |
-
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
70 |
-
}
|
71 |
-
|
72 |
-
public function ajax_change_field_attribute() {
|
73 |
-
|
74 |
-
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id']) && isset($_REQUEST['field_attr']) && isset($_REQUEST['field_value'])) {
|
75 |
-
|
76 |
-
|
77 |
-
if (array_key_exists('section', $_REQUEST)) {
|
78 |
-
|
79 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
80 |
-
|
81 |
-
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
82 |
-
$attr = wc_clean(wp_unslash($_REQUEST['field_attr']));
|
83 |
-
$value = wc_clean(wp_unslash($_REQUEST['field_value']));
|
84 |
-
|
85 |
-
$field_data = array($attr => $value);
|
86 |
-
|
87 |
-
if (isset(WOOCCM()->$section)) {
|
88 |
-
|
89 |
-
$field = WOOCCM()->$section->update_field($field_id, $field_data);
|
90 |
-
|
91 |
-
wp_send_json_success($field);
|
92 |
-
}
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
97 |
-
}
|
98 |
-
|
99 |
-
public function ajax_save_field() {
|
100 |
-
|
101 |
-
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_data'])) {
|
102 |
-
|
103 |
-
$field_data = array(); //WOOCCM()->billing->get_args();
|
104 |
-
|
105 |
-
parse_str($_REQUEST['field_data'], $field_data);
|
106 |
-
|
107 |
-
if (array_key_exists('field_id', $_REQUEST)) {
|
108 |
-
|
109 |
-
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
110 |
-
|
111 |
-
if ($field = $this->save_modal_field($field_id, $field_data)) {
|
112 |
-
|
113 |
-
wp_send_json_success($field);
|
114 |
-
}
|
115 |
-
} else {
|
116 |
-
|
117 |
-
if ($field = $this->add_modal_field($field_data)) {
|
118 |
-
|
119 |
-
wp_send_json_success($field);
|
120 |
-
}
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
125 |
-
}
|
126 |
-
|
127 |
-
public function ajax_delete_field() {
|
128 |
-
|
129 |
-
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id'])) {
|
130 |
-
|
131 |
-
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
132 |
-
|
133 |
-
if ($this->delete_field($field_id)) {
|
134 |
-
|
135 |
-
wp_send_json_success($field_id);
|
136 |
-
}
|
137 |
-
}
|
138 |
-
|
139 |
-
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
140 |
-
}
|
141 |
-
|
142 |
-
public function ajax_reset_fields() {
|
143 |
-
|
144 |
-
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce')) {
|
145 |
-
|
146 |
-
if (array_key_exists('section', $_REQUEST)) {
|
147 |
-
|
148 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
149 |
-
|
150 |
-
if (isset(WOOCCM()->$section)) {
|
151 |
-
|
152 |
-
WOOCCM()->$section->delete_fields();
|
153 |
-
|
154 |
-
wp_send_json_success();
|
155 |
-
}
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
160 |
-
}
|
161 |
-
|
162 |
-
public function ajax_load_field() {
|
163 |
-
|
164 |
-
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id'])) {
|
165 |
-
|
166 |
-
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
167 |
-
|
168 |
-
if ($field = $this->get_modal_field($field_id)) {
|
169 |
-
wp_send_json_success($field);
|
170 |
-
}
|
171 |
-
|
172 |
-
wp_send_json_error(esc_html__('Undefined field id', 'woocommerce-checkout-manager'));
|
173 |
-
}
|
174 |
-
|
175 |
-
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
176 |
-
}
|
177 |
-
|
178 |
-
// Modal
|
179 |
-
// ---------------------------------------------------------------------------
|
180 |
-
|
181 |
-
public function get_modal_field($field_id) {
|
182 |
-
|
183 |
-
if (array_key_exists('section', $_REQUEST)) {
|
184 |
-
|
185 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
186 |
-
|
187 |
-
if (isset(WOOCCM()->$section)) {
|
188 |
-
|
189 |
-
if ($fields = WOOCCM()->$section->get_fields()) {
|
190 |
-
|
191 |
-
if (isset($fields[$field_id])) {
|
192 |
-
|
193 |
-
$field = $fields[$field_id];
|
194 |
-
|
195 |
-
if (!empty($field['show_product'])) {
|
196 |
-
$field['show_product_selected'] = array_filter(array_combine((array) $field['show_product'], array_map('get_the_title', (array) $field['show_product'])));
|
197 |
-
}
|
198 |
-
if (!empty($field['hide_product'])) {
|
199 |
-
$field['hide_product_selected'] = array_filter(array_combine((array) $field['hide_product'], array_map('get_the_title', (array) $field['hide_product'])));
|
200 |
-
}
|
201 |
-
|
202 |
-
if (!empty($field['conditional_parent_key']) && $field['conditional_parent_key'] != $field['key']) {
|
203 |
-
|
204 |
-
// $parent_id = @max(array_keys(array_column($fields, 'key'), $field['conditional_parent_key']));
|
205 |
-
$parent_id = WOOCCM()->$section->get_field_id($fields, 'key', $field['conditional_parent_key']);
|
206 |
-
|
207 |
-
if (isset($fields[$parent_id])) {
|
208 |
-
$field['parent'] = $fields[$parent_id];
|
209 |
-
}
|
210 |
-
}
|
211 |
-
|
212 |
-
//don't remove empty attr because previus data remain
|
213 |
-
//$field = array_filter($field);
|
214 |
-
|
215 |
-
return $field;
|
216 |
-
}
|
217 |
-
}
|
218 |
-
}
|
219 |
-
}
|
220 |
-
}
|
221 |
-
|
222 |
-
public function ajax_load_parent() {
|
223 |
-
|
224 |
-
if (!empty($_REQUEST['conditional_parent_key'])) {
|
225 |
-
|
226 |
-
$key = $_REQUEST['conditional_parent_key'];
|
227 |
-
|
228 |
-
if (array_key_exists('section', $_REQUEST)) {
|
229 |
-
|
230 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
231 |
-
|
232 |
-
if (isset(WOOCCM()->$section)) {
|
233 |
-
|
234 |
-
if ($fields = WOOCCM()->$section->get_fields()) {
|
235 |
-
|
236 |
-
$parent_id = WOOCCM()->$section->get_field_id($fields, 'key', $key);
|
237 |
-
|
238 |
-
if (isset($fields[$parent_id])) {
|
239 |
-
wp_send_json_success($fields[$parent_id]);
|
240 |
-
}
|
241 |
-
}
|
242 |
-
}
|
243 |
-
}
|
244 |
-
}
|
245 |
-
}
|
246 |
-
|
247 |
-
// Save
|
248 |
-
// ---------------------------------------------------------------------------
|
249 |
-
|
250 |
-
public function toggle_field_attribute($field_id, $attr) {
|
251 |
-
|
252 |
-
if (array_key_exists('section', $_REQUEST)) {
|
253 |
-
|
254 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
255 |
-
|
256 |
-
if (isset(WOOCCM()->$section)) {
|
257 |
-
|
258 |
-
if ($field = WOOCCM()->$section->get_field($field_id)) {
|
259 |
-
|
260 |
-
$field_data = array($attr => !(bool) @$field[$attr]);
|
261 |
-
|
262 |
-
$field = WOOCCM()->$section->update_field($field_id, $field_data);
|
263 |
-
|
264 |
-
return $field_data[$attr];
|
265 |
-
}
|
266 |
-
}
|
267 |
-
}
|
268 |
-
}
|
269 |
-
|
270 |
-
public function save_modal_field($field_id, $field_data) {
|
271 |
-
|
272 |
-
if (array_key_exists('section', $_REQUEST)) {
|
273 |
-
|
274 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
275 |
-
|
276 |
-
if (isset(WOOCCM()->$section)) {
|
277 |
-
|
278 |
-
// fix unchecked checkboxes
|
279 |
-
$field_data = wp_parse_args($field_data, WOOCCM()->$section->get_args());
|
280 |
-
|
281 |
-
// don't override
|
282 |
-
unset($field_data['order']);
|
283 |
-
unset($field_data['required']);
|
284 |
-
unset($field_data['position']);
|
285 |
-
unset($field_data['disabled']);
|
286 |
-
|
287 |
-
return WOOCCM()->$section->update_field($field_id, $field_data);
|
288 |
-
}
|
289 |
-
}
|
290 |
-
}
|
291 |
-
|
292 |
-
public function add_modal_field($field_data) {
|
293 |
-
|
294 |
-
if (array_key_exists('section', $_REQUEST)) {
|
295 |
-
|
296 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
297 |
-
|
298 |
-
if (isset(WOOCCM()->$section)) {
|
299 |
-
|
300 |
-
return WOOCCM()->$section->add_field($field_data);
|
301 |
-
}
|
302 |
-
}
|
303 |
-
}
|
304 |
-
|
305 |
-
public function delete_field($field_id) {
|
306 |
-
|
307 |
-
if (array_key_exists('section', $_REQUEST)) {
|
308 |
-
|
309 |
-
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
310 |
-
|
311 |
-
if (isset(WOOCCM()->$section)) {
|
312 |
-
|
313 |
-
return WOOCCM()->$section->delete_field($field_id);
|
314 |
-
}
|
315 |
-
}
|
316 |
-
}
|
317 |
-
|
318 |
-
function save_field_order() {
|
319 |
-
|
320 |
-
global $current_section;
|
321 |
-
|
322 |
-
if (in_array($current_section, array('billing', 'shipping', 'additional'))) {
|
323 |
-
|
324 |
-
$section = wc_clean(wp_unslash($current_section));
|
325 |
-
|
326 |
-
if (array_key_exists('field_order', $_POST)) {
|
327 |
-
|
328 |
-
$field_order = wc_clean(wp_unslash($_POST['field_order']));
|
329 |
-
|
330 |
-
if (is_array($field_order) && count($field_order) > 0) {
|
331 |
-
|
332 |
-
if (isset(WOOCCM()->$section)) {
|
333 |
-
|
334 |
-
$fields = WOOCCM()->$section->get_fields();
|
335 |
-
|
336 |
-
$loop = 1;
|
337 |
-
|
338 |
-
foreach ($field_order as $field_id) {
|
339 |
-
|
340 |
-
if (isset($fields[$field_id])) {
|
341 |
-
|
342 |
-
$fields[$field_id]['order'] = $loop;
|
343 |
-
|
344 |
-
$loop++;
|
345 |
-
}
|
346 |
-
}
|
347 |
-
|
348 |
-
WOOCCM()->$section->update_fields($fields);
|
349 |
-
}
|
350 |
-
}
|
351 |
-
}
|
352 |
-
}
|
353 |
-
}
|
354 |
-
|
355 |
-
function includes() {
|
356 |
-
|
357 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field-billing.php' );
|
358 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field-shipping.php' );
|
359 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field-additional.php' );
|
360 |
-
|
361 |
-
if (!is_admin()) {
|
362 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-register.php' );
|
363 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-additional.php' );
|
364 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-disable.php' );
|
365 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-conditional.php' );
|
366 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-handler.php' );
|
367 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-i18n.php' );
|
368 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-filters.php' );
|
369 |
-
}
|
370 |
-
}
|
371 |
-
|
372 |
-
function init() {
|
373 |
-
|
374 |
-
add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
|
375 |
-
add_action('wp_ajax_wooccm_load_parent', array($this, 'ajax_load_parent'));
|
376 |
-
add_action('wp_ajax_wooccm_load_field', array($this, 'ajax_load_field'));
|
377 |
-
add_action('wp_ajax_wooccm_save_field', array($this, 'ajax_save_field'));
|
378 |
-
add_action('wp_ajax_wooccm_delete_field', array($this, 'ajax_delete_field'));
|
379 |
-
add_action('wp_ajax_wooccm_reset_fields', array($this, 'ajax_reset_fields'));
|
380 |
-
add_action('wp_ajax_wooccm_change_field_attribute', array($this, 'ajax_change_field_attribute'));
|
381 |
-
add_action('wp_ajax_wooccm_toggle_field_attribute', array($this, 'ajax_toggle_field_attribute'));
|
382 |
-
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_field_order'));
|
383 |
-
}
|
384 |
-
|
385 |
-
}
|
386 |
-
|
387 |
-
WOOCCM_Field_Controller::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Field_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
public $billing;
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
$this->includes();
|
10 |
+
$this->init();
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (is_null(self::$_instance)) {
|
15 |
+
self::$_instance = new self();
|
16 |
+
}
|
17 |
+
return self::$_instance;
|
18 |
+
}
|
19 |
+
|
20 |
+
function enqueue_scripts() {
|
21 |
+
|
22 |
+
global $current_section;
|
23 |
+
|
24 |
+
wp_register_script('wooccm-admin-field', plugins_url('assets/backend/js/wooccm-admin-field.js', WOOCCM_PLUGIN_FILE), array('jquery', 'jquery-ui-datepicker', 'backbone', 'wp-util'), WOOCCM_PLUGIN_VERSION, true);
|
25 |
+
|
26 |
+
wp_localize_script('wooccm-admin-field', 'wooccm_field', array(
|
27 |
+
'ajax_url' => admin_url('admin-ajax.php?section=' . $current_section),
|
28 |
+
'nonce' => wp_create_nonce('wooccm_field'),
|
29 |
+
'args' => WOOCCM()->billing->get_args(),
|
30 |
+
'message' => array(
|
31 |
+
'remove' => esc_html__('Are you sure you want to remove this field?', 'woocommerce-checkout-manager'),
|
32 |
+
'reset' => esc_html__('Are you sure you want to reset this fields?', 'woocommerce-checkout-manager')
|
33 |
+
)
|
34 |
+
));
|
35 |
+
|
36 |
+
if (isset($_GET['tab']) && $_GET['tab'] === WOOCCM_PREFIX) {
|
37 |
+
wp_enqueue_style('media-views');
|
38 |
+
wp_enqueue_script('wooccm-admin-field');
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
public function get_product_categories() {
|
43 |
+
|
44 |
+
$args = array(
|
45 |
+
'taxonomy' => 'product_cat',
|
46 |
+
'orderby' => 'id',
|
47 |
+
'order' => 'ASC',
|
48 |
+
'hide_empty' => true,
|
49 |
+
'fields' => 'all');
|
50 |
+
|
51 |
+
return get_terms($args);
|
52 |
+
}
|
53 |
+
|
54 |
+
// Ajax
|
55 |
+
// ---------------------------------------------------------------------------
|
56 |
+
|
57 |
+
public function ajax_toggle_field_attribute() {
|
58 |
+
|
59 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id']) && isset($_REQUEST['field_attr'])) {
|
60 |
+
|
61 |
+
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
62 |
+
$attr = wc_clean(wp_unslash($_REQUEST['field_attr']));
|
63 |
+
|
64 |
+
$status = $this->toggle_field_attribute($field_id, $attr);
|
65 |
+
|
66 |
+
wp_send_json_success($status);
|
67 |
+
}
|
68 |
+
|
69 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
70 |
+
}
|
71 |
+
|
72 |
+
public function ajax_change_field_attribute() {
|
73 |
+
|
74 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id']) && isset($_REQUEST['field_attr']) && isset($_REQUEST['field_value'])) {
|
75 |
+
|
76 |
+
|
77 |
+
if (array_key_exists('section', $_REQUEST)) {
|
78 |
+
|
79 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
80 |
+
|
81 |
+
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
82 |
+
$attr = wc_clean(wp_unslash($_REQUEST['field_attr']));
|
83 |
+
$value = wc_clean(wp_unslash($_REQUEST['field_value']));
|
84 |
+
|
85 |
+
$field_data = array($attr => $value);
|
86 |
+
|
87 |
+
if (isset(WOOCCM()->$section)) {
|
88 |
+
|
89 |
+
$field = WOOCCM()->$section->update_field($field_id, $field_data);
|
90 |
+
|
91 |
+
wp_send_json_success($field);
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
97 |
+
}
|
98 |
+
|
99 |
+
public function ajax_save_field() {
|
100 |
+
|
101 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_data'])) {
|
102 |
+
|
103 |
+
$field_data = array(); //WOOCCM()->billing->get_args();
|
104 |
+
|
105 |
+
parse_str($_REQUEST['field_data'], $field_data);
|
106 |
+
|
107 |
+
if (array_key_exists('field_id', $_REQUEST)) {
|
108 |
+
|
109 |
+
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
110 |
+
|
111 |
+
if ($field = $this->save_modal_field($field_id, $field_data)) {
|
112 |
+
|
113 |
+
wp_send_json_success($field);
|
114 |
+
}
|
115 |
+
} else {
|
116 |
+
|
117 |
+
if ($field = $this->add_modal_field($field_data)) {
|
118 |
+
|
119 |
+
wp_send_json_success($field);
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
125 |
+
}
|
126 |
+
|
127 |
+
public function ajax_delete_field() {
|
128 |
+
|
129 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id'])) {
|
130 |
+
|
131 |
+
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
132 |
+
|
133 |
+
if ($this->delete_field($field_id)) {
|
134 |
+
|
135 |
+
wp_send_json_success($field_id);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
140 |
+
}
|
141 |
+
|
142 |
+
public function ajax_reset_fields() {
|
143 |
+
|
144 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce')) {
|
145 |
+
|
146 |
+
if (array_key_exists('section', $_REQUEST)) {
|
147 |
+
|
148 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
149 |
+
|
150 |
+
if (isset(WOOCCM()->$section)) {
|
151 |
+
|
152 |
+
WOOCCM()->$section->delete_fields();
|
153 |
+
|
154 |
+
wp_send_json_success();
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
160 |
+
}
|
161 |
+
|
162 |
+
public function ajax_load_field() {
|
163 |
+
|
164 |
+
if (current_user_can('manage_woocommerce') && check_ajax_referer('wooccm_field', 'nonce') && isset($_REQUEST['field_id'])) {
|
165 |
+
|
166 |
+
$field_id = wc_clean(wp_unslash($_REQUEST['field_id']));
|
167 |
+
|
168 |
+
if ($field = $this->get_modal_field($field_id)) {
|
169 |
+
wp_send_json_success($field);
|
170 |
+
}
|
171 |
+
|
172 |
+
wp_send_json_error(esc_html__('Undefined field id', 'woocommerce-checkout-manager'));
|
173 |
+
}
|
174 |
+
|
175 |
+
wp_send_json_error(esc_html__('Unknow error', 'woocommerce-checkout-manager'));
|
176 |
+
}
|
177 |
+
|
178 |
+
// Modal
|
179 |
+
// ---------------------------------------------------------------------------
|
180 |
+
|
181 |
+
public function get_modal_field($field_id) {
|
182 |
+
|
183 |
+
if (array_key_exists('section', $_REQUEST)) {
|
184 |
+
|
185 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
186 |
+
|
187 |
+
if (isset(WOOCCM()->$section)) {
|
188 |
+
|
189 |
+
if ($fields = WOOCCM()->$section->get_fields()) {
|
190 |
+
|
191 |
+
if (isset($fields[$field_id])) {
|
192 |
+
|
193 |
+
$field = $fields[$field_id];
|
194 |
+
|
195 |
+
if (!empty($field['show_product'])) {
|
196 |
+
$field['show_product_selected'] = array_filter(array_combine((array) $field['show_product'], array_map('get_the_title', (array) $field['show_product'])));
|
197 |
+
}
|
198 |
+
if (!empty($field['hide_product'])) {
|
199 |
+
$field['hide_product_selected'] = array_filter(array_combine((array) $field['hide_product'], array_map('get_the_title', (array) $field['hide_product'])));
|
200 |
+
}
|
201 |
+
|
202 |
+
if (!empty($field['conditional_parent_key']) && $field['conditional_parent_key'] != $field['key']) {
|
203 |
+
|
204 |
+
// $parent_id = @max(array_keys(array_column($fields, 'key'), $field['conditional_parent_key']));
|
205 |
+
$parent_id = WOOCCM()->$section->get_field_id($fields, 'key', $field['conditional_parent_key']);
|
206 |
+
|
207 |
+
if (isset($fields[$parent_id])) {
|
208 |
+
$field['parent'] = $fields[$parent_id];
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
//don't remove empty attr because previus data remain
|
213 |
+
//$field = array_filter($field);
|
214 |
+
|
215 |
+
return $field;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
}
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
public function ajax_load_parent() {
|
223 |
+
|
224 |
+
if (!empty($_REQUEST['conditional_parent_key'])) {
|
225 |
+
|
226 |
+
$key = $_REQUEST['conditional_parent_key'];
|
227 |
+
|
228 |
+
if (array_key_exists('section', $_REQUEST)) {
|
229 |
+
|
230 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
231 |
+
|
232 |
+
if (isset(WOOCCM()->$section)) {
|
233 |
+
|
234 |
+
if ($fields = WOOCCM()->$section->get_fields()) {
|
235 |
+
|
236 |
+
$parent_id = WOOCCM()->$section->get_field_id($fields, 'key', $key);
|
237 |
+
|
238 |
+
if (isset($fields[$parent_id])) {
|
239 |
+
wp_send_json_success($fields[$parent_id]);
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
// Save
|
248 |
+
// ---------------------------------------------------------------------------
|
249 |
+
|
250 |
+
public function toggle_field_attribute($field_id, $attr) {
|
251 |
+
|
252 |
+
if (array_key_exists('section', $_REQUEST)) {
|
253 |
+
|
254 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
255 |
+
|
256 |
+
if (isset(WOOCCM()->$section)) {
|
257 |
+
|
258 |
+
if ($field = WOOCCM()->$section->get_field($field_id)) {
|
259 |
+
|
260 |
+
$field_data = array($attr => !(bool) @$field[$attr]);
|
261 |
+
|
262 |
+
$field = WOOCCM()->$section->update_field($field_id, $field_data);
|
263 |
+
|
264 |
+
return $field_data[$attr];
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
public function save_modal_field($field_id, $field_data) {
|
271 |
+
|
272 |
+
if (array_key_exists('section', $_REQUEST)) {
|
273 |
+
|
274 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
275 |
+
|
276 |
+
if (isset(WOOCCM()->$section)) {
|
277 |
+
|
278 |
+
// fix unchecked checkboxes
|
279 |
+
$field_data = wp_parse_args($field_data, WOOCCM()->$section->get_args());
|
280 |
+
|
281 |
+
// don't override
|
282 |
+
unset($field_data['order']);
|
283 |
+
unset($field_data['required']);
|
284 |
+
unset($field_data['position']);
|
285 |
+
unset($field_data['disabled']);
|
286 |
+
|
287 |
+
return WOOCCM()->$section->update_field($field_id, $field_data);
|
288 |
+
}
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
public function add_modal_field($field_data) {
|
293 |
+
|
294 |
+
if (array_key_exists('section', $_REQUEST)) {
|
295 |
+
|
296 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
297 |
+
|
298 |
+
if (isset(WOOCCM()->$section)) {
|
299 |
+
|
300 |
+
return WOOCCM()->$section->add_field($field_data);
|
301 |
+
}
|
302 |
+
}
|
303 |
+
}
|
304 |
+
|
305 |
+
public function delete_field($field_id) {
|
306 |
+
|
307 |
+
if (array_key_exists('section', $_REQUEST)) {
|
308 |
+
|
309 |
+
$section = wc_clean(wp_unslash($_REQUEST['section']));
|
310 |
+
|
311 |
+
if (isset(WOOCCM()->$section)) {
|
312 |
+
|
313 |
+
return WOOCCM()->$section->delete_field($field_id);
|
314 |
+
}
|
315 |
+
}
|
316 |
+
}
|
317 |
+
|
318 |
+
function save_field_order() {
|
319 |
+
|
320 |
+
global $current_section;
|
321 |
+
|
322 |
+
if (in_array($current_section, array('billing', 'shipping', 'additional'))) {
|
323 |
+
|
324 |
+
$section = wc_clean(wp_unslash($current_section));
|
325 |
+
|
326 |
+
if (array_key_exists('field_order', $_POST)) {
|
327 |
+
|
328 |
+
$field_order = wc_clean(wp_unslash($_POST['field_order']));
|
329 |
+
|
330 |
+
if (is_array($field_order) && count($field_order) > 0) {
|
331 |
+
|
332 |
+
if (isset(WOOCCM()->$section)) {
|
333 |
+
|
334 |
+
$fields = WOOCCM()->$section->get_fields();
|
335 |
+
|
336 |
+
$loop = 1;
|
337 |
+
|
338 |
+
foreach ($field_order as $field_id) {
|
339 |
+
|
340 |
+
if (isset($fields[$field_id])) {
|
341 |
+
|
342 |
+
$fields[$field_id]['order'] = $loop;
|
343 |
+
|
344 |
+
$loop++;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
|
348 |
+
WOOCCM()->$section->update_fields($fields);
|
349 |
+
}
|
350 |
+
}
|
351 |
+
}
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
function includes() {
|
356 |
+
|
357 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field-billing.php' );
|
358 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field-shipping.php' );
|
359 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/controller/class-wooccm-field-additional.php' );
|
360 |
+
|
361 |
+
if (!is_admin()) {
|
362 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-register.php' );
|
363 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-additional.php' );
|
364 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-disable.php' );
|
365 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-conditional.php' );
|
366 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-handler.php' );
|
367 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-i18n.php' );
|
368 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/frontend/class-wooccm-fields-filters.php' );
|
369 |
+
}
|
370 |
+
}
|
371 |
+
|
372 |
+
function init() {
|
373 |
+
|
374 |
+
add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
|
375 |
+
add_action('wp_ajax_wooccm_load_parent', array($this, 'ajax_load_parent'));
|
376 |
+
add_action('wp_ajax_wooccm_load_field', array($this, 'ajax_load_field'));
|
377 |
+
add_action('wp_ajax_wooccm_save_field', array($this, 'ajax_save_field'));
|
378 |
+
add_action('wp_ajax_wooccm_delete_field', array($this, 'ajax_delete_field'));
|
379 |
+
add_action('wp_ajax_wooccm_reset_fields', array($this, 'ajax_reset_fields'));
|
380 |
+
add_action('wp_ajax_wooccm_change_field_attribute', array($this, 'ajax_change_field_attribute'));
|
381 |
+
add_action('wp_ajax_wooccm_toggle_field_attribute', array($this, 'ajax_toggle_field_attribute'));
|
382 |
+
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_field_order'));
|
383 |
+
}
|
384 |
+
|
385 |
+
}
|
386 |
+
|
387 |
+
WOOCCM_Field_Controller::instance();
|
includes/controller/class-wooccm-order.php
CHANGED
@@ -1,310 +1,310 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Order_Controller extends WOOCCM_Upload {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
public function frontend_scripts() {
|
19 |
-
|
20 |
-
if (is_account_page()) {
|
21 |
-
|
22 |
-
WOOCCM()->register_scripts();
|
23 |
-
|
24 |
-
wp_enqueue_style('wooccm');
|
25 |
-
wp_enqueue_style('dashicons');
|
26 |
-
wp_enqueue_script('wooccm-order-upload');
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
public function admin_scripts() {
|
31 |
-
|
32 |
-
if (is_admin() && $screen = get_current_screen()) {
|
33 |
-
|
34 |
-
if (in_array($screen->id, array(/* 'product', 'edit-product', */'shop_order', 'edit-shop_order'))) {
|
35 |
-
|
36 |
-
WOOCCM()->register_scripts();
|
37 |
-
|
38 |
-
wp_enqueue_script('wooccm-order-upload');
|
39 |
-
}
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
public function ajax_order_attachment_upload() {
|
44 |
-
|
45 |
-
if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
|
46 |
-
|
47 |
-
$files = ( isset($_FILES['wooccm_order_attachment_upload']) ? $_FILES['wooccm_order_attachment_upload'] : false );
|
48 |
-
|
49 |
-
if (empty($files)) {
|
50 |
-
//wc_order_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
|
51 |
-
wp_send_json_error(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
|
52 |
-
}
|
53 |
-
|
54 |
-
$order_id = ( isset($_REQUEST['order_id']) ? absint($_REQUEST['order_id']) : false );
|
55 |
-
|
56 |
-
if (empty($order_id)) {
|
57 |
-
wp_send_json_error(esc_html__('Empty order id.', 'woocommerce-checkout-manager'));
|
58 |
-
}
|
59 |
-
|
60 |
-
if (!$post = get_post($order_id)) {
|
61 |
-
wp_send_json_error(esc_html__('Invalid order id.', 'woocommerce-checkout-manager'));
|
62 |
-
}
|
63 |
-
|
64 |
-
if (count($attachment_ids = $this->process_uploads($files, 'wooccm_order_attachment_upload', $order_id))) {
|
65 |
-
|
66 |
-
ob_start();
|
67 |
-
|
68 |
-
if (!empty($_REQUEST['metabox'])) {
|
69 |
-
$this->add_metabox_content($post);
|
70 |
-
} else {
|
71 |
-
$this->add_upload_files($post->ID);
|
72 |
-
}
|
73 |
-
|
74 |
-
wp_send_json_success(ob_get_clean());
|
75 |
-
|
76 |
-
}
|
77 |
-
wp_send_json_error(esc_html__('Unknow error.', 'woocommerce-checkout-manager'));
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
public function add_upload_files($order_id) {
|
82 |
-
|
83 |
-
if (get_option('wooccm_order_upload_files', 'no') === 'yes') {
|
84 |
-
|
85 |
-
if ($order = wc_get_order($order_id)) {
|
86 |
-
|
87 |
-
if (in_array("wc-{$order->get_status()}", array_values(get_option('wooccm_order_upload_files_order_status', array())))) {
|
88 |
-
|
89 |
-
$attachments = get_posts(array(
|
90 |
-
'fields' => 'ids',
|
91 |
-
'post_type' => 'attachment',
|
92 |
-
'numberposts' => -1,
|
93 |
-
'post_status' => null,
|
94 |
-
'post_parent' => $order->get_id())
|
95 |
-
);
|
96 |
-
|
97 |
-
wc_get_template('templates/order/order-upload-files.php', array('order' => $order, 'attachments' => $attachments), '', WOOCCM_PLUGIN_DIR);
|
98 |
-
}
|
99 |
-
}
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
public function add_custom_fields($order_id) {
|
104 |
-
|
105 |
-
if (get_option('wooccm_order_custom_fields', 'no') === 'yes') {
|
106 |
-
|
107 |
-
if ($order = wc_get_order($order_id)) {
|
108 |
-
|
109 |
-
if (in_array("wc-{$order->get_status()}", array_values(get_option('wooccm_order_custom_fields_status', array())))) {
|
110 |
-
|
111 |
-
wc_get_template('templates/order/order-custom-fields.php', array('order_id' => $order_id), '', WOOCCM_PLUGIN_DIR);
|
112 |
-
}
|
113 |
-
}
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
public function add_metabox_content($post) {
|
118 |
-
|
119 |
-
if ($order = wc_get_order($post->ID)) {
|
120 |
-
|
121 |
-
$attachments = get_posts(array(
|
122 |
-
'fields' => 'ids',
|
123 |
-
'post_type' => 'attachment',
|
124 |
-
'numberposts' => -1,
|
125 |
-
'post_status' => null,
|
126 |
-
'post_parent' => $order->get_id()
|
127 |
-
));
|
128 |
-
include WOOCCM_PLUGIN_DIR . 'includes/view/backend/meta-boxes/html-order-uploads.php';
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
// Admin
|
133 |
-
// -------------------------------------------------------------------------
|
134 |
-
|
135 |
-
public function add_metabox() {
|
136 |
-
add_meta_box('wooccm-order-files', esc_html__('Order Files', 'woocommerce-checkout-manager'), array($this, 'add_metabox_content'), 'shop_order', 'normal', 'default');
|
137 |
-
}
|
138 |
-
|
139 |
-
// Panel
|
140 |
-
// ---------------------------------------------------------------------------
|
141 |
-
|
142 |
-
public function get_settings() {
|
143 |
-
return array(
|
144 |
-
array(
|
145 |
-
'type' => 'title',
|
146 |
-
'id' => 'section_title'
|
147 |
-
),
|
148 |
-
array(
|
149 |
-
'name' => esc_html__('Add upload files', 'woocommerce-checkout-manager'),
|
150 |
-
'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
|
151 |
-
'id' => 'wooccm_order_upload_files',
|
152 |
-
'type' => 'select',
|
153 |
-
'class' => 'chosen_select',
|
154 |
-
'options' => array(
|
155 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
156 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
157 |
-
),
|
158 |
-
'default' => 'no',
|
159 |
-
),
|
160 |
-
array(
|
161 |
-
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
|
162 |
-
'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
|
163 |
-
'id' => 'wooccm_order_upload_files_order_status',
|
164 |
-
'type' => 'multiselect',
|
165 |
-
'class' => 'chosen_select',
|
166 |
-
'options' => wc_get_order_statuses(),
|
167 |
-
'default' => array_keys(wc_get_order_statuses()),
|
168 |
-
),
|
169 |
-
array(
|
170 |
-
'name' => esc_html__('Add upload files title', 'woocommerce-checkout-manager'),
|
171 |
-
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
|
172 |
-
'id' => 'wooccm_order_upload_files_title',
|
173 |
-
'type' => 'text',
|
174 |
-
'placeholder' => esc_html__('Uploaded files', 'woocommerce-checkout-manager')
|
175 |
-
),
|
176 |
-
array(
|
177 |
-
'name' => esc_html__('Add custom fields', 'woocommerce-checkout-manager'),
|
178 |
-
'desc_tip' => esc_html__('Show the selected fields in the order.', 'woocommerce-checkout-manager'),
|
179 |
-
'id' => 'wooccm_order_custom_fields',
|
180 |
-
'type' => 'select',
|
181 |
-
'class' => 'chosen_select',
|
182 |
-
'options' => array(
|
183 |
-
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
184 |
-
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
185 |
-
),
|
186 |
-
'default' => 'no',
|
187 |
-
),
|
188 |
-
array(
|
189 |
-
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
|
190 |
-
'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
|
191 |
-
'id' => 'wooccm_order_custom_fields_status',
|
192 |
-
'type' => 'multiselect',
|
193 |
-
'class' => 'chosen_select',
|
194 |
-
'options' => wc_get_order_statuses(),
|
195 |
-
'default' => array_keys(wc_get_order_statuses()),
|
196 |
-
),
|
197 |
-
array(
|
198 |
-
'name' => esc_html__('Add custom fields title', 'woocommerce-checkout-manager'),
|
199 |
-
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
|
200 |
-
'id' => 'wooccm_order_custom_fields_title',
|
201 |
-
'type' => 'text',
|
202 |
-
'placeholder' => esc_html__('Order extra', 'woocommerce-checkout-manager')
|
203 |
-
),
|
204 |
-
array(
|
205 |
-
'type' => 'sectionend',
|
206 |
-
'id' => 'section_end'
|
207 |
-
)
|
208 |
-
);
|
209 |
-
}
|
210 |
-
|
211 |
-
public function add_header() {
|
212 |
-
global $current_section;
|
213 |
-
?>
|
214 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=order'); ?>" class="<?php echo ( $current_section == 'order' ? 'current' : '' ); ?>"><?php esc_html_e('Order', 'woocommerce-checkout-manager'); ?></a> | </li>
|
215 |
-
<?php
|
216 |
-
}
|
217 |
-
|
218 |
-
public function add_section() {
|
219 |
-
|
220 |
-
global $current_section;
|
221 |
-
|
222 |
-
if ('order' == $current_section) {
|
223 |
-
|
224 |
-
$settings = $this->get_settings();
|
225 |
-
|
226 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/order.php' );
|
227 |
-
}
|
228 |
-
}
|
229 |
-
|
230 |
-
public function save_settings() {
|
231 |
-
|
232 |
-
global $current_section;
|
233 |
-
|
234 |
-
if ('order' == $current_section) {
|
235 |
-
woocommerce_update_options($this->get_settings());
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
// Compatibility
|
240 |
-
// -------------------------------------------------------------------------
|
241 |
-
|
242 |
-
public function enable_file_upload($value) {
|
243 |
-
|
244 |
-
$options = get_option('wccs_settings');
|
245 |
-
|
246 |
-
if (!empty($options['checkness']['enable_file_upload'])) {
|
247 |
-
return 'yes';
|
248 |
-
}
|
249 |
-
|
250 |
-
return $value;
|
251 |
-
}
|
252 |
-
|
253 |
-
public function upload_os($value) {
|
254 |
-
|
255 |
-
$options = get_option('wccs_settings');
|
256 |
-
|
257 |
-
if (!empty($options['checkness']['upload_os'])) {
|
258 |
-
return (array) @implode(',', $options['checkness']['upload_os']);
|
259 |
-
}
|
260 |
-
|
261 |
-
return $value;
|
262 |
-
}
|
263 |
-
|
264 |
-
public function upload_title($value) {
|
265 |
-
|
266 |
-
$options = get_option('wccs_settings');
|
267 |
-
|
268 |
-
if (!empty($options['checkness']['upload_title'])) {
|
269 |
-
return $options['checkness']['upload_title'];
|
270 |
-
}
|
271 |
-
|
272 |
-
return $value;
|
273 |
-
}
|
274 |
-
|
275 |
-
function init() {
|
276 |
-
add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
|
277 |
-
add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
|
278 |
-
add_action('wp_ajax_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
|
279 |
-
add_action('wp_ajax_nopriv_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
|
280 |
-
|
281 |
-
// Order
|
282 |
-
//--------------------------------------------------------------------------
|
283 |
-
add_action('add_meta_boxes', array($this, 'add_metabox'));
|
284 |
-
|
285 |
-
// Panel
|
286 |
-
// -------------------------------------------------------------------------
|
287 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
288 |
-
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
289 |
-
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
290 |
-
|
291 |
-
// Frontend
|
292 |
-
// -------------------------------------------------------------------------
|
293 |
-
|
294 |
-
add_action('woocommerce_thankyou', array($this, 'add_upload_files'));
|
295 |
-
add_action('woocommerce_view_order', array($this, 'add_upload_files'));
|
296 |
-
|
297 |
-
add_action('woocommerce_thankyou', array($this, 'add_custom_fields'));
|
298 |
-
add_action('woocommerce_view_order', array($this, 'add_custom_fields'));
|
299 |
-
|
300 |
-
// Compatibility
|
301 |
-
// -------------------------------------------------------------------------
|
302 |
-
|
303 |
-
add_filter('default_option_wooccm_order_upload_files', array($this, 'enable_file_upload'));
|
304 |
-
add_filter('default_option_wooccm_order_upload_files_order_status', array($this, 'upload_os'));
|
305 |
-
add_filter('default_option_wooccm_order_upload_files_title', array($this, 'upload_title'));
|
306 |
-
}
|
307 |
-
|
308 |
-
}
|
309 |
-
|
310 |
-
WOOCCM_Order_Controller::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Order_Controller extends WOOCCM_Upload {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function frontend_scripts() {
|
19 |
+
|
20 |
+
if (is_account_page()) {
|
21 |
+
|
22 |
+
WOOCCM()->register_scripts();
|
23 |
+
|
24 |
+
wp_enqueue_style('wooccm');
|
25 |
+
wp_enqueue_style('dashicons');
|
26 |
+
wp_enqueue_script('wooccm-order-upload');
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
public function admin_scripts() {
|
31 |
+
|
32 |
+
if (is_admin() && $screen = get_current_screen()) {
|
33 |
+
|
34 |
+
if (in_array($screen->id, array(/* 'product', 'edit-product', */'shop_order', 'edit-shop_order'))) {
|
35 |
+
|
36 |
+
WOOCCM()->register_scripts();
|
37 |
+
|
38 |
+
wp_enqueue_script('wooccm-order-upload');
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
public function ajax_order_attachment_upload() {
|
44 |
+
|
45 |
+
if (!empty($_REQUEST) && check_admin_referer('wooccm_upload', 'nonce')) {
|
46 |
+
|
47 |
+
$files = ( isset($_FILES['wooccm_order_attachment_upload']) ? $_FILES['wooccm_order_attachment_upload'] : false );
|
48 |
+
|
49 |
+
if (empty($files)) {
|
50 |
+
//wc_order_notice(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
|
51 |
+
wp_send_json_error(esc_html__('No uploads were recognised. Files were not uploaded.', 'woocommerce-checkout-manager'), 'error');
|
52 |
+
}
|
53 |
+
|
54 |
+
$order_id = ( isset($_REQUEST['order_id']) ? absint($_REQUEST['order_id']) : false );
|
55 |
+
|
56 |
+
if (empty($order_id)) {
|
57 |
+
wp_send_json_error(esc_html__('Empty order id.', 'woocommerce-checkout-manager'));
|
58 |
+
}
|
59 |
+
|
60 |
+
if (!$post = get_post($order_id)) {
|
61 |
+
wp_send_json_error(esc_html__('Invalid order id.', 'woocommerce-checkout-manager'));
|
62 |
+
}
|
63 |
+
|
64 |
+
if (count($attachment_ids = $this->process_uploads($files, 'wooccm_order_attachment_upload', $order_id))) {
|
65 |
+
|
66 |
+
ob_start();
|
67 |
+
|
68 |
+
if (!empty($_REQUEST['metabox'])) {
|
69 |
+
$this->add_metabox_content($post);
|
70 |
+
} else {
|
71 |
+
$this->add_upload_files($post->ID);
|
72 |
+
}
|
73 |
+
|
74 |
+
wp_send_json_success(ob_get_clean());
|
75 |
+
|
76 |
+
}
|
77 |
+
wp_send_json_error(esc_html__('Unknow error.', 'woocommerce-checkout-manager'));
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
public function add_upload_files($order_id) {
|
82 |
+
|
83 |
+
if (get_option('wooccm_order_upload_files', 'no') === 'yes') {
|
84 |
+
|
85 |
+
if ($order = wc_get_order($order_id)) {
|
86 |
+
|
87 |
+
if (in_array("wc-{$order->get_status()}", array_values(get_option('wooccm_order_upload_files_order_status', array())))) {
|
88 |
+
|
89 |
+
$attachments = get_posts(array(
|
90 |
+
'fields' => 'ids',
|
91 |
+
'post_type' => 'attachment',
|
92 |
+
'numberposts' => -1,
|
93 |
+
'post_status' => null,
|
94 |
+
'post_parent' => $order->get_id())
|
95 |
+
);
|
96 |
+
|
97 |
+
wc_get_template('templates/order/order-upload-files.php', array('order' => $order, 'attachments' => $attachments), '', WOOCCM_PLUGIN_DIR);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
public function add_custom_fields($order_id) {
|
104 |
+
|
105 |
+
if (get_option('wooccm_order_custom_fields', 'no') === 'yes') {
|
106 |
+
|
107 |
+
if ($order = wc_get_order($order_id)) {
|
108 |
+
|
109 |
+
if (in_array("wc-{$order->get_status()}", array_values(get_option('wooccm_order_custom_fields_status', array())))) {
|
110 |
+
|
111 |
+
wc_get_template('templates/order/order-custom-fields.php', array('order_id' => $order_id), '', WOOCCM_PLUGIN_DIR);
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
public function add_metabox_content($post) {
|
118 |
+
|
119 |
+
if ($order = wc_get_order($post->ID)) {
|
120 |
+
|
121 |
+
$attachments = get_posts(array(
|
122 |
+
'fields' => 'ids',
|
123 |
+
'post_type' => 'attachment',
|
124 |
+
'numberposts' => -1,
|
125 |
+
'post_status' => null,
|
126 |
+
'post_parent' => $order->get_id()
|
127 |
+
));
|
128 |
+
include WOOCCM_PLUGIN_DIR . 'includes/view/backend/meta-boxes/html-order-uploads.php';
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
// Admin
|
133 |
+
// -------------------------------------------------------------------------
|
134 |
+
|
135 |
+
public function add_metabox() {
|
136 |
+
add_meta_box('wooccm-order-files', esc_html__('Order Files', 'woocommerce-checkout-manager'), array($this, 'add_metabox_content'), 'shop_order', 'normal', 'default');
|
137 |
+
}
|
138 |
+
|
139 |
+
// Panel
|
140 |
+
// ---------------------------------------------------------------------------
|
141 |
+
|
142 |
+
public function get_settings() {
|
143 |
+
return array(
|
144 |
+
array(
|
145 |
+
'type' => 'title',
|
146 |
+
'id' => 'section_title'
|
147 |
+
),
|
148 |
+
array(
|
149 |
+
'name' => esc_html__('Add upload files', 'woocommerce-checkout-manager'),
|
150 |
+
'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
|
151 |
+
'id' => 'wooccm_order_upload_files',
|
152 |
+
'type' => 'select',
|
153 |
+
'class' => 'chosen_select',
|
154 |
+
'options' => array(
|
155 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
156 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
157 |
+
),
|
158 |
+
'default' => 'no',
|
159 |
+
),
|
160 |
+
array(
|
161 |
+
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
|
162 |
+
'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
|
163 |
+
'id' => 'wooccm_order_upload_files_order_status',
|
164 |
+
'type' => 'multiselect',
|
165 |
+
'class' => 'chosen_select',
|
166 |
+
'options' => wc_get_order_statuses(),
|
167 |
+
'default' => array_keys(wc_get_order_statuses()),
|
168 |
+
),
|
169 |
+
array(
|
170 |
+
'name' => esc_html__('Add upload files title', 'woocommerce-checkout-manager'),
|
171 |
+
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
|
172 |
+
'id' => 'wooccm_order_upload_files_title',
|
173 |
+
'type' => 'text',
|
174 |
+
'placeholder' => esc_html__('Uploaded files', 'woocommerce-checkout-manager')
|
175 |
+
),
|
176 |
+
array(
|
177 |
+
'name' => esc_html__('Add custom fields', 'woocommerce-checkout-manager'),
|
178 |
+
'desc_tip' => esc_html__('Show the selected fields in the order.', 'woocommerce-checkout-manager'),
|
179 |
+
'id' => 'wooccm_order_custom_fields',
|
180 |
+
'type' => 'select',
|
181 |
+
'class' => 'chosen_select',
|
182 |
+
'options' => array(
|
183 |
+
'yes' => esc_html__('Yes', 'woocommerce-checkout-manager'),
|
184 |
+
'no' => esc_html__('No', 'woocommerce-checkout-manager'),
|
185 |
+
),
|
186 |
+
'default' => 'no',
|
187 |
+
),
|
188 |
+
array(
|
189 |
+
'name' => esc_html__('Add for this order status', 'woocommerce-checkout-manager'),
|
190 |
+
'desc_tip' => esc_html__('Allow customers to upload files in the order.', 'woocommerce-checkout-manager'),
|
191 |
+
'id' => 'wooccm_order_custom_fields_status',
|
192 |
+
'type' => 'multiselect',
|
193 |
+
'class' => 'chosen_select',
|
194 |
+
'options' => wc_get_order_statuses(),
|
195 |
+
'default' => array_keys(wc_get_order_statuses()),
|
196 |
+
),
|
197 |
+
array(
|
198 |
+
'name' => esc_html__('Add custom fields title', 'woocommerce-checkout-manager'),
|
199 |
+
'desc_tip' => esc_html__('Add custom title for the uploads files table.', 'woocommerce-checkout-manager'),
|
200 |
+
'id' => 'wooccm_order_custom_fields_title',
|
201 |
+
'type' => 'text',
|
202 |
+
'placeholder' => esc_html__('Order extra', 'woocommerce-checkout-manager')
|
203 |
+
),
|
204 |
+
array(
|
205 |
+
'type' => 'sectionend',
|
206 |
+
'id' => 'section_end'
|
207 |
+
)
|
208 |
+
);
|
209 |
+
}
|
210 |
+
|
211 |
+
public function add_header() {
|
212 |
+
global $current_section;
|
213 |
+
?>
|
214 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=wooccm§ion=order'); ?>" class="<?php echo ( $current_section == 'order' ? 'current' : '' ); ?>"><?php esc_html_e('Order', 'woocommerce-checkout-manager'); ?></a> | </li>
|
215 |
+
<?php
|
216 |
+
}
|
217 |
+
|
218 |
+
public function add_section() {
|
219 |
+
|
220 |
+
global $current_section;
|
221 |
+
|
222 |
+
if ('order' == $current_section) {
|
223 |
+
|
224 |
+
$settings = $this->get_settings();
|
225 |
+
|
226 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/order.php' );
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
public function save_settings() {
|
231 |
+
|
232 |
+
global $current_section;
|
233 |
+
|
234 |
+
if ('order' == $current_section) {
|
235 |
+
woocommerce_update_options($this->get_settings());
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
// Compatibility
|
240 |
+
// -------------------------------------------------------------------------
|
241 |
+
|
242 |
+
public function enable_file_upload($value) {
|
243 |
+
|
244 |
+
$options = get_option('wccs_settings');
|
245 |
+
|
246 |
+
if (!empty($options['checkness']['enable_file_upload'])) {
|
247 |
+
return 'yes';
|
248 |
+
}
|
249 |
+
|
250 |
+
return $value;
|
251 |
+
}
|
252 |
+
|
253 |
+
public function upload_os($value) {
|
254 |
+
|
255 |
+
$options = get_option('wccs_settings');
|
256 |
+
|
257 |
+
if (!empty($options['checkness']['upload_os'])) {
|
258 |
+
return (array) @implode(',', $options['checkness']['upload_os']);
|
259 |
+
}
|
260 |
+
|
261 |
+
return $value;
|
262 |
+
}
|
263 |
+
|
264 |
+
public function upload_title($value) {
|
265 |
+
|
266 |
+
$options = get_option('wccs_settings');
|
267 |
+
|
268 |
+
if (!empty($options['checkness']['upload_title'])) {
|
269 |
+
return $options['checkness']['upload_title'];
|
270 |
+
}
|
271 |
+
|
272 |
+
return $value;
|
273 |
+
}
|
274 |
+
|
275 |
+
function init() {
|
276 |
+
add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
|
277 |
+
add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
|
278 |
+
add_action('wp_ajax_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
|
279 |
+
add_action('wp_ajax_nopriv_wooccm_order_attachment_upload', array($this, 'ajax_order_attachment_upload'));
|
280 |
+
|
281 |
+
// Order
|
282 |
+
//--------------------------------------------------------------------------
|
283 |
+
add_action('add_meta_boxes', array($this, 'add_metabox'));
|
284 |
+
|
285 |
+
// Panel
|
286 |
+
// -------------------------------------------------------------------------
|
287 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
288 |
+
add_action('woocommerce_sections_' . WOOCCM_PREFIX, array($this, 'add_section'), 99);
|
289 |
+
add_action('woocommerce_settings_save_' . WOOCCM_PREFIX, array($this, 'save_settings'));
|
290 |
+
|
291 |
+
// Frontend
|
292 |
+
// -------------------------------------------------------------------------
|
293 |
+
|
294 |
+
add_action('woocommerce_thankyou', array($this, 'add_upload_files'));
|
295 |
+
add_action('woocommerce_view_order', array($this, 'add_upload_files'));
|
296 |
+
|
297 |
+
add_action('woocommerce_thankyou', array($this, 'add_custom_fields'));
|
298 |
+
add_action('woocommerce_view_order', array($this, 'add_custom_fields'));
|
299 |
+
|
300 |
+
// Compatibility
|
301 |
+
// -------------------------------------------------------------------------
|
302 |
+
|
303 |
+
add_filter('default_option_wooccm_order_upload_files', array($this, 'enable_file_upload'));
|
304 |
+
add_filter('default_option_wooccm_order_upload_files_order_status', array($this, 'upload_os'));
|
305 |
+
add_filter('default_option_wooccm_order_upload_files_title', array($this, 'upload_title'));
|
306 |
+
}
|
307 |
+
|
308 |
+
}
|
309 |
+
|
310 |
+
WOOCCM_Order_Controller::instance();
|
includes/controller/class-wooccm-premium.php
CHANGED
@@ -1,57 +1,57 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Checkout_Premium_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
function remove_menu() {
|
19 |
-
?>
|
20 |
-
<style>
|
21 |
-
|
22 |
-
li.toplevel_page_wooccm {
|
23 |
-
display:none;
|
24 |
-
}
|
25 |
-
|
26 |
-
</style>
|
27 |
-
<?php
|
28 |
-
}
|
29 |
-
|
30 |
-
// Admin
|
31 |
-
// -------------------------------------------------------------------------
|
32 |
-
|
33 |
-
function add_page() {
|
34 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/premium.php' );
|
35 |
-
}
|
36 |
-
|
37 |
-
function add_header() {
|
38 |
-
?>
|
39 |
-
<li><a href="<?php echo admin_url('admin.php?page=' . WOOCCM_PREFIX); ?>"><?php echo esc_html__('Premium', 'woocommerce-checkout-manager'); ?></a></li> |
|
40 |
-
<?php
|
41 |
-
}
|
42 |
-
|
43 |
-
function add_menu() {
|
44 |
-
add_menu_page(WOOCCM_PLUGIN_NAME, WOOCCM_PLUGIN_NAME, 'manage_woocommerce', WOOCCM_PREFIX, array($this, 'add_page'));
|
45 |
-
add_submenu_page(WOOCCM_PREFIX, esc_html__('Premium', 'woocommerce-checkout-manager'), esc_html__('Premium', 'woocommerce-checkout-manager'), 'manage_woocommerce', WOOCCM_PREFIX, array($this, 'add_page'));
|
46 |
-
}
|
47 |
-
|
48 |
-
public function init() {
|
49 |
-
add_action('wooccm_sections_header', array($this, 'add_header'));
|
50 |
-
add_action('admin_menu', array($this, 'add_menu'));
|
51 |
-
add_action('admin_head', array($this, 'remove_menu'));
|
52 |
-
}
|
53 |
-
|
54 |
-
}
|
55 |
-
|
56 |
-
WOOCCM_Checkout_Premium_Controller::instance();
|
57 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Checkout_Premium_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
function remove_menu() {
|
19 |
+
?>
|
20 |
+
<style>
|
21 |
+
|
22 |
+
li.toplevel_page_wooccm {
|
23 |
+
display:none;
|
24 |
+
}
|
25 |
+
|
26 |
+
</style>
|
27 |
+
<?php
|
28 |
+
}
|
29 |
+
|
30 |
+
// Admin
|
31 |
+
// -------------------------------------------------------------------------
|
32 |
+
|
33 |
+
function add_page() {
|
34 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/premium.php' );
|
35 |
+
}
|
36 |
+
|
37 |
+
function add_header() {
|
38 |
+
?>
|
39 |
+
<li><a href="<?php echo admin_url('admin.php?page=' . WOOCCM_PREFIX); ?>"><?php echo esc_html__('Premium', 'woocommerce-checkout-manager'); ?></a></li> |
|
40 |
+
<?php
|
41 |
+
}
|
42 |
+
|
43 |
+
function add_menu() {
|
44 |
+
add_menu_page(WOOCCM_PLUGIN_NAME, WOOCCM_PLUGIN_NAME, 'manage_woocommerce', WOOCCM_PREFIX, array($this, 'add_page'));
|
45 |
+
add_submenu_page(WOOCCM_PREFIX, esc_html__('Premium', 'woocommerce-checkout-manager'), esc_html__('Premium', 'woocommerce-checkout-manager'), 'manage_woocommerce', WOOCCM_PREFIX, array($this, 'add_page'));
|
46 |
+
}
|
47 |
+
|
48 |
+
public function init() {
|
49 |
+
add_action('wooccm_sections_header', array($this, 'add_header'));
|
50 |
+
add_action('admin_menu', array($this, 'add_menu'));
|
51 |
+
add_action('admin_head', array($this, 'remove_menu'));
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
WOOCCM_Checkout_Premium_Controller::instance();
|
57 |
+
|
includes/controller/class-wooccm-suggestions.php
CHANGED
@@ -1,62 +1,62 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Checkout_Suggestions_Controller {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
// Admin
|
19 |
-
// -------------------------------------------------------------------------
|
20 |
-
|
21 |
-
public function add_page() {
|
22 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-suggestions-list-table.php' );
|
23 |
-
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/suggestions.php' );
|
24 |
-
}
|
25 |
-
|
26 |
-
public function add_menu() {
|
27 |
-
add_submenu_page(WOOCCM_PREFIX, __('Suggestions', 'woocommerce-checkout-manager'), __('Suggestions', 'woocommerce-checkout-manager'), 'manage_woocommerce', WOOCCM_PREFIX . '_suggestions', array($this, 'add_page'));
|
28 |
-
}
|
29 |
-
|
30 |
-
// fix for activateUrl on install now button
|
31 |
-
public function network_admin_url($url, $path) {
|
32 |
-
|
33 |
-
if (wp_doing_ajax() && !is_network_admin()) {
|
34 |
-
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
|
35 |
-
if (strpos($url, 'plugins.php') !== false) {
|
36 |
-
$url = self_admin_url($path);
|
37 |
-
}
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
return $url;
|
42 |
-
}
|
43 |
-
|
44 |
-
public function add_redirect() {
|
45 |
-
|
46 |
-
if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
|
47 |
-
if (wp_get_referer() == admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions')) {
|
48 |
-
wp_redirect(admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions'));
|
49 |
-
}
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
public function init() {
|
54 |
-
add_action('admin_menu', array($this, 'add_menu'));
|
55 |
-
add_action('admin_init', array($this, 'add_redirect'));
|
56 |
-
add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
|
57 |
-
}
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
WOOCCM_Checkout_Suggestions_Controller::instance();
|
62 |
-
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Checkout_Suggestions_Controller {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
// Admin
|
19 |
+
// -------------------------------------------------------------------------
|
20 |
+
|
21 |
+
public function add_page() {
|
22 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/class-wooccm-suggestions-list-table.php' );
|
23 |
+
include_once( WOOCCM_PLUGIN_DIR . 'includes/view/backend/pages/suggestions.php' );
|
24 |
+
}
|
25 |
+
|
26 |
+
public function add_menu() {
|
27 |
+
add_submenu_page(WOOCCM_PREFIX, __('Suggestions', 'woocommerce-checkout-manager'), __('Suggestions', 'woocommerce-checkout-manager'), 'manage_woocommerce', WOOCCM_PREFIX . '_suggestions', array($this, 'add_page'));
|
28 |
+
}
|
29 |
+
|
30 |
+
// fix for activateUrl on install now button
|
31 |
+
public function network_admin_url($url, $path) {
|
32 |
+
|
33 |
+
if (wp_doing_ajax() && !is_network_admin()) {
|
34 |
+
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
|
35 |
+
if (strpos($url, 'plugins.php') !== false) {
|
36 |
+
$url = self_admin_url($path);
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
return $url;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function add_redirect() {
|
45 |
+
|
46 |
+
if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
|
47 |
+
if (wp_get_referer() == admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions')) {
|
48 |
+
wp_redirect(admin_url('admin.php?page=' . WOOCCM_PREFIX . '_suggestions'));
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
public function init() {
|
54 |
+
add_action('admin_menu', array($this, 'add_menu'));
|
55 |
+
add_action('admin_init', array($this, 'add_redirect'));
|
56 |
+
add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
WOOCCM_Checkout_Suggestions_Controller::instance();
|
62 |
+
|
includes/view/backend/meta-boxes/html-order-uploads.php
CHANGED
@@ -1,61 +1,61 @@
|
|
1 |
-
<div class="wooccm_order_attachments_wrapper" class="wc-metaboxes-wrapper">
|
2 |
-
<table cellpadding="0" cellspacing="0" class="wooccm_order_attachments">
|
3 |
-
<thead>
|
4 |
-
<tr>
|
5 |
-
<th><?php _e('Image', 'woocommerce-checkout-manager'); ?></th>
|
6 |
-
<th><?php _e('Filename', 'woocommerce-checkout-manager'); ?></th>
|
7 |
-
<th><?php _e('Dimensions', 'woocommerce-checkout-manager'); ?></th>
|
8 |
-
<th><?php _e('Extension', ' woocommerce-checkout-manager'); ?></th>
|
9 |
-
<th class="column-actions"></th>
|
10 |
-
</tr>
|
11 |
-
</thead>
|
12 |
-
<tbody class="product_images">
|
13 |
-
<?php
|
14 |
-
if (!empty($attachments)) :
|
15 |
-
foreach ($attachments as $attachment_id) :
|
16 |
-
$image_attributes = wp_get_attachment_url($attachment_id);
|
17 |
-
$image_attributes2 = wp_get_attachment_image_src($attachment_id);
|
18 |
-
$filename = basename($image_attributes);
|
19 |
-
$wp_filetype = wp_check_filetype($filename);
|
20 |
-
?>
|
21 |
-
<tr class="image">
|
22 |
-
<td class="thumb">
|
23 |
-
<div class="wc-order-item-thumbnail">
|
24 |
-
<?php echo wp_get_attachment_link($attachment_id, '', false, false, wp_get_attachment_image($attachment_id, array(38, 38), false)); ?>
|
25 |
-
</div>
|
26 |
-
</td>
|
27 |
-
<td><?php echo wp_get_attachment_link($attachment_id, '', false, false, preg_replace('/\.[^.]+$/', '', $filename)); ?></td>
|
28 |
-
<td>
|
29 |
-
<?php
|
30 |
-
if ($image_attributes2[1] == '') {
|
31 |
-
echo '-';
|
32 |
-
} else {
|
33 |
-
echo $image_attributes2[1] . ' x ' . $image_attributes2[2];
|
34 |
-
}
|
35 |
-
?>
|
36 |
-
</td>
|
37 |
-
<td><?php echo strtoupper($wp_filetype['ext']); ?></td>
|
38 |
-
<td class="column-actions" nowrap>
|
39 |
-
<!--<a href="<?php echo esc_url($image_attributes2[0]); ?>" target="_blank" class="button"><?php esc_html_e('Download', 'woocommerce-checkout-manager'); ?></a>-->
|
40 |
-
<a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr($attachment_id); ?>" data-tip="<?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></a>
|
41 |
-
</td>
|
42 |
-
</tr>
|
43 |
-
<?php endforeach; ?>
|
44 |
-
<?php else: ?>
|
45 |
-
<tr>
|
46 |
-
<td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
|
47 |
-
</tr>
|
48 |
-
<?php endif; ?>
|
49 |
-
</tbody>
|
50 |
-
</table>
|
51 |
-
<div class="wc-order-data-row wc-order-bulk-actions wc-order-data-row-toggle">
|
52 |
-
<input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
53 |
-
<input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
54 |
-
<a class="button button-primary fileinput-button">
|
55 |
-
<span><?php _e('Upload Files', 'woocommerce-checkout-manager'); ?></span>
|
56 |
-
<input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
|
57 |
-
</a>
|
58 |
-
<input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php _e('Save Changes', 'woocommerce-checkout-manager'); ?>" disabled="disabled">
|
59 |
-
<div class="wooccm_upload_results"></div>
|
60 |
-
</div>
|
61 |
</div>
|
1 |
+
<div class="wooccm_order_attachments_wrapper" class="wc-metaboxes-wrapper">
|
2 |
+
<table cellpadding="0" cellspacing="0" class="wooccm_order_attachments">
|
3 |
+
<thead>
|
4 |
+
<tr>
|
5 |
+
<th><?php _e('Image', 'woocommerce-checkout-manager'); ?></th>
|
6 |
+
<th><?php _e('Filename', 'woocommerce-checkout-manager'); ?></th>
|
7 |
+
<th><?php _e('Dimensions', 'woocommerce-checkout-manager'); ?></th>
|
8 |
+
<th><?php _e('Extension', ' woocommerce-checkout-manager'); ?></th>
|
9 |
+
<th class="column-actions"></th>
|
10 |
+
</tr>
|
11 |
+
</thead>
|
12 |
+
<tbody class="product_images">
|
13 |
+
<?php
|
14 |
+
if (!empty($attachments)) :
|
15 |
+
foreach ($attachments as $attachment_id) :
|
16 |
+
$image_attributes = wp_get_attachment_url($attachment_id);
|
17 |
+
$image_attributes2 = wp_get_attachment_image_src($attachment_id);
|
18 |
+
$filename = basename($image_attributes);
|
19 |
+
$wp_filetype = wp_check_filetype($filename);
|
20 |
+
?>
|
21 |
+
<tr class="image">
|
22 |
+
<td class="thumb">
|
23 |
+
<div class="wc-order-item-thumbnail">
|
24 |
+
<?php echo wp_get_attachment_link($attachment_id, '', false, false, wp_get_attachment_image($attachment_id, array(38, 38), false)); ?>
|
25 |
+
</div>
|
26 |
+
</td>
|
27 |
+
<td><?php echo wp_get_attachment_link($attachment_id, '', false, false, preg_replace('/\.[^.]+$/', '', $filename)); ?></td>
|
28 |
+
<td>
|
29 |
+
<?php
|
30 |
+
if ($image_attributes2[1] == '') {
|
31 |
+
echo '-';
|
32 |
+
} else {
|
33 |
+
echo $image_attributes2[1] . ' x ' . $image_attributes2[2];
|
34 |
+
}
|
35 |
+
?>
|
36 |
+
</td>
|
37 |
+
<td><?php echo strtoupper($wp_filetype['ext']); ?></td>
|
38 |
+
<td class="column-actions" nowrap>
|
39 |
+
<!--<a href="<?php echo esc_url($image_attributes2[0]); ?>" target="_blank" class="button"><?php esc_html_e('Download', 'woocommerce-checkout-manager'); ?></a>-->
|
40 |
+
<a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr($attachment_id); ?>" data-tip="<?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></a>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<?php endforeach; ?>
|
44 |
+
<?php else: ?>
|
45 |
+
<tr>
|
46 |
+
<td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
|
47 |
+
</tr>
|
48 |
+
<?php endif; ?>
|
49 |
+
</tbody>
|
50 |
+
</table>
|
51 |
+
<div class="wc-order-data-row wc-order-bulk-actions wc-order-data-row-toggle">
|
52 |
+
<input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
53 |
+
<input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
54 |
+
<a class="button button-primary fileinput-button">
|
55 |
+
<span><?php _e('Upload Files', 'woocommerce-checkout-manager'); ?></span>
|
56 |
+
<input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
|
57 |
+
</a>
|
58 |
+
<input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php _e('Save Changes', 'woocommerce-checkout-manager'); ?>" disabled="disabled">
|
59 |
+
<div class="wooccm_upload_results"></div>
|
60 |
+
</div>
|
61 |
</div>
|
includes/view/backend/pages/additional.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php include_once( 'parts/tabs.php' ); ?>
|
2 |
-
<h1 class="screen-reader-text"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></h1>
|
3 |
-
<h2><?php esc_html_e('Additional fields', 'woocommerce-checkout-manager'); ?></h2>
|
4 |
-
<div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
5 |
-
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
-
</div>
|
7 |
-
<?php include_once( 'parts/actions.php' ); ?>
|
8 |
-
<?php include_once( 'parts/loop.php' ); ?>
|
9 |
<?php include_once( 'modals/field.php' ); ?>
|
1 |
+
<?php include_once( 'parts/tabs.php' ); ?>
|
2 |
+
<h1 class="screen-reader-text"><?php esc_html_e('Additional', 'woocommerce-checkout-manager'); ?></h1>
|
3 |
+
<h2><?php esc_html_e('Additional fields', 'woocommerce-checkout-manager'); ?></h2>
|
4 |
+
<div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
5 |
+
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
+
</div>
|
7 |
+
<?php include_once( 'parts/actions.php' ); ?>
|
8 |
+
<?php include_once( 'parts/loop.php' ); ?>
|
9 |
<?php include_once( 'modals/field.php' ); ?>
|
includes/view/backend/pages/billing.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php include_once( 'parts/tabs.php' ); ?>
|
2 |
-
<h1 class="screen-reader-text"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></h1>
|
3 |
-
<h2><?php esc_html_e('Billing fields', 'woocommerce-checkout-manager'); ?></h2>
|
4 |
-
<div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
5 |
-
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
-
</div>
|
7 |
-
<?php include_once( 'parts/actions.php' ); ?>
|
8 |
-
<?php include_once( 'parts/loop.php' ); ?>
|
9 |
-
<?php include_once( 'modals/field.php' ); ?>
|
1 |
+
<?php include_once( 'parts/tabs.php' ); ?>
|
2 |
+
<h1 class="screen-reader-text"><?php esc_html_e('Billing', 'woocommerce-checkout-manager'); ?></h1>
|
3 |
+
<h2><?php esc_html_e('Billing fields', 'woocommerce-checkout-manager'); ?></h2>
|
4 |
+
<div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
5 |
+
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
+
</div>
|
7 |
+
<?php include_once( 'parts/actions.php' ); ?>
|
8 |
+
<?php include_once( 'parts/loop.php' ); ?>
|
9 |
+
<?php include_once( 'modals/field.php' ); ?>
|
includes/view/backend/pages/modals/field.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
<script type="text/html" id='tmpl-wooccm-modal-main'>
|
2 |
-
<?php include_once( 'parts/main.php' ); ?>
|
3 |
-
</script>
|
4 |
-
<script type="text/html" id='tmpl-wooccm-modal-tabs'>
|
5 |
-
<?php include_once( 'parts/tabs.php' ); ?>
|
6 |
-
</script>
|
7 |
-
<script type="text/html" id='tmpl-wooccm-modal-panels'>
|
8 |
-
<?php include_once( 'parts/panel-general.php' ); ?>
|
9 |
-
<?php include_once( 'parts/panel-select2.php' ); ?>
|
10 |
-
<?php include_once( 'parts/panel-options.php' ); ?>
|
11 |
-
<?php include_once( 'parts/panel-filter.php' ); ?>
|
12 |
-
<?php include_once( 'parts/panel-display.php' ); ?>
|
13 |
-
<?php include_once( 'parts/panel-price.php' ); ?>
|
14 |
-
<?php include_once( 'parts/panel-datepicker.php' ); ?>
|
15 |
-
<?php include_once( 'parts/panel-timepicker.php' ); ?>
|
16 |
-
<?php include_once( 'parts/panel-admin.php' ); ?>
|
17 |
-
</script>
|
18 |
-
<script type="text/html" id='tmpl-wooccm-modal-info'>
|
19 |
-
<?php include_once( 'parts/info.php' ); ?>
|
20 |
</script>
|
1 |
+
<script type="text/html" id='tmpl-wooccm-modal-main'>
|
2 |
+
<?php include_once( 'parts/main.php' ); ?>
|
3 |
+
</script>
|
4 |
+
<script type="text/html" id='tmpl-wooccm-modal-tabs'>
|
5 |
+
<?php include_once( 'parts/tabs.php' ); ?>
|
6 |
+
</script>
|
7 |
+
<script type="text/html" id='tmpl-wooccm-modal-panels'>
|
8 |
+
<?php include_once( 'parts/panel-general.php' ); ?>
|
9 |
+
<?php include_once( 'parts/panel-select2.php' ); ?>
|
10 |
+
<?php include_once( 'parts/panel-options.php' ); ?>
|
11 |
+
<?php include_once( 'parts/panel-filter.php' ); ?>
|
12 |
+
<?php include_once( 'parts/panel-display.php' ); ?>
|
13 |
+
<?php include_once( 'parts/panel-price.php' ); ?>
|
14 |
+
<?php include_once( 'parts/panel-datepicker.php' ); ?>
|
15 |
+
<?php include_once( 'parts/panel-timepicker.php' ); ?>
|
16 |
+
<?php include_once( 'parts/panel-admin.php' ); ?>
|
17 |
+
</script>
|
18 |
+
<script type="text/html" id='tmpl-wooccm-modal-info'>
|
19 |
+
<?php include_once( 'parts/info.php' ); ?>
|
20 |
</script>
|
includes/view/backend/pages/modals/parts/info.php
CHANGED
@@ -1,77 +1,77 @@
|
|
1 |
-
<span class="settings-save-status">
|
2 |
-
<span class="spinner"></span>
|
3 |
-
<span class="saved"><?php esc_html_e('Saved.'); ?></span>
|
4 |
-
</span>
|
5 |
-
|
6 |
-
<div class="details">
|
7 |
-
<div class="filename"><strong><?php esc_html_e('Field id', 'woocommerce-checkout-manager'); ?>:</strong> {{data.id}}</div>
|
8 |
-
<div class="filename"><strong><?php esc_html_e('Field key', 'woocommerce-checkout-manager'); ?>:</strong> #{{data.key}}</div>
|
9 |
-
<# if (data.parent != undefined) { #>
|
10 |
-
<div class="filename"><strong><?php esc_html_e('Parent type', 'woocommerce-checkout-manager'); ?>:</strong> {{data.parent.type}}</div>
|
11 |
-
<# } #>
|
12 |
-
</div>
|
13 |
-
|
14 |
-
<div class="panel woocommerce_options_panel">
|
15 |
-
<div class="settings">
|
16 |
-
<p class="form-field">
|
17 |
-
<label><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></label>
|
18 |
-
<input <# if (data.conditional) { #>checked="checked"<# } #> type="checkbox" name="conditional" value="1">
|
19 |
-
<span class="description"><?php esc_html_e('Activate conditional field requirement.', 'woocommerce-checkout-manager'); ?></span>
|
20 |
-
</p>
|
21 |
-
</div>
|
22 |
-
<div class="settings">
|
23 |
-
<p class="form-field">
|
24 |
-
<label><?php esc_html_e('Parent', 'woocommerce-checkout-manager'); ?></label>
|
25 |
-
<select class="media-modal-parent media-modal-render-info wooccm-enhanced-select" name="conditional_parent_key" data-placeholder="<?php esc_attr_e('Select parent field…', 'woocommerce-checkout-manager'); ?>" data-allow_clear="false">
|
26 |
-
<option <# if (data.conditional_parent_key == '') { #>selected="selected"<# } #> value=""></option>
|
27 |
-
<?php foreach ($fields as $field_id => $field) : ?>
|
28 |
-
<?php if (in_array($field['type'], $conditionals)): ?>
|
29 |
-
<# if ( data.id != '<?php echo esc_attr($field['id']); ?>' ) { #>
|
30 |
-
<option <# if ( data.conditional_parent_key == '<?php echo esc_attr($field['key']); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($field['key']); ?>"><?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?></option>
|
31 |
-
<# } #>
|
32 |
-
<?php endif; ?>
|
33 |
-
<?php endforeach; ?>
|
34 |
-
</select>
|
35 |
-
<span class="description"><?php esc_html_e('Select conditional parent field.', 'woocommerce-checkout-manager'); ?></span>
|
36 |
-
</p>
|
37 |
-
</div>
|
38 |
-
<div class="settings">
|
39 |
-
<p class="form-field">
|
40 |
-
<# if( data.parent != undefined && data.parent.label != '' ) { #>
|
41 |
-
<label>{{data.parent.label}}</label>
|
42 |
-
<# } else { #>
|
43 |
-
<label><?php esc_html_e('Value', 'woocommerce-checkout-manager'); ?></label>
|
44 |
-
<# } #>
|
45 |
-
<# if ( data.parent != undefined && _.contains(<?php echo json_encode($option); ?>, data.parent.type) && _.isObject(data.parent.options)) { #>
|
46 |
-
<select class="wooccm-enhanced-select" name="conditional_parent_value">
|
47 |
-
<# _.each(data.parent.options, function (option, index) { #>
|
48 |
-
<option <# if ( index == data.conditional_parent_value ) { #>selected="selected"<# } #> value="{{option.label}}">{{option.label}}</option>
|
49 |
-
<# }); #>
|
50 |
-
</select>
|
51 |
-
<# } else if( data.parent != undefined && data.parent.type == 'checkbox' ) { #>
|
52 |
-
<select class="select short" name="conditional_parent_value">
|
53 |
-
<option <# if ( 1 == data.conditional_parent_value ) { #>selected="selected"<# } #> value="1"><?php esc_html_e('Yes'); ?></option>
|
54 |
-
<option <# if ( 0 == data.conditional_parent_value ) { #>selected="selected"<# } #> value="0"><?php esc_html_e('No'); ?></option>
|
55 |
-
</select>
|
56 |
-
<# } else if( data.parent != undefined && data.parent.type == 'country' ) { #>
|
57 |
-
<select class="wooccm-enhanced-select" name="conditional_parent_value" data-placeholder="<?php esc_attr_e('Preserve default country…', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true">
|
58 |
-
<option <# if (data.default == '') { #>selected="selected"<# } #> value=""></option>
|
59 |
-
<?php foreach (WC()->countries->get_countries() as $id => $name) : ?>
|
60 |
-
<option <# if (data.conditional_parent_value == '<?php echo esc_attr($id); ?>') { #>selected="selected"<# } #> value="<?php echo esc_attr($id); ?>"><?php echo esc_html($name); ?></option>
|
61 |
-
<?php endforeach; ?>
|
62 |
-
</select>
|
63 |
-
<# } else if( data.parent != undefined ) { #>
|
64 |
-
<input type="text" name="conditional_parent_value" placeholder="{{data.parent.default}}" value="{{data.conditional_parent_value}}">
|
65 |
-
<# } else { #>
|
66 |
-
<input type="text" name="conditional_parent_value" placeholder="<?php esc_html_e('Conditional parent value', 'woocommerce-checkout-manager'); ?>" value="{{data.conditional_parent_value}}">
|
67 |
-
<# } #>
|
68 |
-
<span class="description"><?php esc_html_e('Show field if parent has this value.', 'woocommerce-checkout-manager'); ?></span>
|
69 |
-
</p>
|
70 |
-
</div>
|
71 |
-
</div>
|
72 |
-
|
73 |
-
<div class="actions">
|
74 |
-
<a target="_blank" class="view-attachment" href="<?php echo wc_get_page_permalink('checkout'); ?>"><?php esc_html_e('View checkout page', 'woocommerce-checkout-manager'); ?></a> |
|
75 |
-
<a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e('Get premium version', 'woocommerce-checkout-manager'); ?></a> |
|
76 |
-
<a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php esc_html_e('View documentation', 'woocommerce-checkout-manager'); ?></a>
|
77 |
</div>
|
1 |
+
<span class="settings-save-status">
|
2 |
+
<span class="spinner"></span>
|
3 |
+
<span class="saved"><?php esc_html_e('Saved.'); ?></span>
|
4 |
+
</span>
|
5 |
+
|
6 |
+
<div class="details">
|
7 |
+
<div class="filename"><strong><?php esc_html_e('Field id', 'woocommerce-checkout-manager'); ?>:</strong> {{data.id}}</div>
|
8 |
+
<div class="filename"><strong><?php esc_html_e('Field key', 'woocommerce-checkout-manager'); ?>:</strong> #{{data.key}}</div>
|
9 |
+
<# if (data.parent != undefined) { #>
|
10 |
+
<div class="filename"><strong><?php esc_html_e('Parent type', 'woocommerce-checkout-manager'); ?>:</strong> {{data.parent.type}}</div>
|
11 |
+
<# } #>
|
12 |
+
</div>
|
13 |
+
|
14 |
+
<div class="panel woocommerce_options_panel">
|
15 |
+
<div class="settings">
|
16 |
+
<p class="form-field">
|
17 |
+
<label><?php esc_html_e('Conditional', 'woocommerce-checkout-manager'); ?></label>
|
18 |
+
<input <# if (data.conditional) { #>checked="checked"<# } #> type="checkbox" name="conditional" value="1">
|
19 |
+
<span class="description"><?php esc_html_e('Activate conditional field requirement.', 'woocommerce-checkout-manager'); ?></span>
|
20 |
+
</p>
|
21 |
+
</div>
|
22 |
+
<div class="settings">
|
23 |
+
<p class="form-field">
|
24 |
+
<label><?php esc_html_e('Parent', 'woocommerce-checkout-manager'); ?></label>
|
25 |
+
<select class="media-modal-parent media-modal-render-info wooccm-enhanced-select" name="conditional_parent_key" data-placeholder="<?php esc_attr_e('Select parent field…', 'woocommerce-checkout-manager'); ?>" data-allow_clear="false">
|
26 |
+
<option <# if (data.conditional_parent_key == '') { #>selected="selected"<# } #> value=""></option>
|
27 |
+
<?php foreach ($fields as $field_id => $field) : ?>
|
28 |
+
<?php if (in_array($field['type'], $conditionals)): ?>
|
29 |
+
<# if ( data.id != '<?php echo esc_attr($field['id']); ?>' ) { #>
|
30 |
+
<option <# if ( data.conditional_parent_key == '<?php echo esc_attr($field['key']); ?>' ) { #>selected="selected"<# } #> value="<?php echo esc_attr($field['key']); ?>"><?php printf('%s', $field['label'] ? esc_html($field['label']) : sprintf(esc_html__('Field %s', 'woocommerce-checkout-manager'), $field_id)); ?></option>
|
31 |
+
<# } #>
|
32 |
+
<?php endif; ?>
|
33 |
+
<?php endforeach; ?>
|
34 |
+
</select>
|
35 |
+
<span class="description"><?php esc_html_e('Select conditional parent field.', 'woocommerce-checkout-manager'); ?></span>
|
36 |
+
</p>
|
37 |
+
</div>
|
38 |
+
<div class="settings">
|
39 |
+
<p class="form-field">
|
40 |
+
<# if( data.parent != undefined && data.parent.label != '' ) { #>
|
41 |
+
<label>{{data.parent.label}}</label>
|
42 |
+
<# } else { #>
|
43 |
+
<label><?php esc_html_e('Value', 'woocommerce-checkout-manager'); ?></label>
|
44 |
+
<# } #>
|
45 |
+
<# if ( data.parent != undefined && _.contains(<?php echo json_encode($option); ?>, data.parent.type) && _.isObject(data.parent.options)) { #>
|
46 |
+
<select class="wooccm-enhanced-select" name="conditional_parent_value">
|
47 |
+
<# _.each(data.parent.options, function (option, index) { #>
|
48 |
+
<option <# if ( index == data.conditional_parent_value ) { #>selected="selected"<# } #> value="{{option.label}}">{{option.label}}</option>
|
49 |
+
<# }); #>
|
50 |
+
</select>
|
51 |
+
<# } else if( data.parent != undefined && data.parent.type == 'checkbox' ) { #>
|
52 |
+
<select class="select short" name="conditional_parent_value">
|
53 |
+
<option <# if ( 1 == data.conditional_parent_value ) { #>selected="selected"<# } #> value="1"><?php esc_html_e('Yes'); ?></option>
|
54 |
+
<option <# if ( 0 == data.conditional_parent_value ) { #>selected="selected"<# } #> value="0"><?php esc_html_e('No'); ?></option>
|
55 |
+
</select>
|
56 |
+
<# } else if( data.parent != undefined && data.parent.type == 'country' ) { #>
|
57 |
+
<select class="wooccm-enhanced-select" name="conditional_parent_value" data-placeholder="<?php esc_attr_e('Preserve default country…', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true">
|
58 |
+
<option <# if (data.default == '') { #>selected="selected"<# } #> value=""></option>
|
59 |
+
<?php foreach (WC()->countries->get_countries() as $id => $name) : ?>
|
60 |
+
<option <# if (data.conditional_parent_value == '<?php echo esc_attr($id); ?>') { #>selected="selected"<# } #> value="<?php echo esc_attr($id); ?>"><?php echo esc_html($name); ?></option>
|
61 |
+
<?php endforeach; ?>
|
62 |
+
</select>
|
63 |
+
<# } else if( data.parent != undefined ) { #>
|
64 |
+
<input type="text" name="conditional_parent_value" placeholder="{{data.parent.default}}" value="{{data.conditional_parent_value}}">
|
65 |
+
<# } else { #>
|
66 |
+
<input type="text" name="conditional_parent_value" placeholder="<?php esc_html_e('Conditional parent value', 'woocommerce-checkout-manager'); ?>" value="{{data.conditional_parent_value}}">
|
67 |
+
<# } #>
|
68 |
+
<span class="description"><?php esc_html_e('Show field if parent has this value.', 'woocommerce-checkout-manager'); ?></span>
|
69 |
+
</p>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<div class="actions">
|
74 |
+
<a target="_blank" class="view-attachment" href="<?php echo wc_get_page_permalink('checkout'); ?>"><?php esc_html_e('View checkout page', 'woocommerce-checkout-manager'); ?></a> |
|
75 |
+
<a target="_blank" href="<?php echo WOOCCM_PURCHASE_URL; ?>"><?php esc_html_e('Get premium version', 'woocommerce-checkout-manager'); ?></a> |
|
76 |
+
<a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php esc_html_e('View documentation', 'woocommerce-checkout-manager'); ?></a>
|
77 |
</div>
|
includes/view/backend/pages/modals/parts/panel-admin.php
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<# if (!_.contains(<?php echo json_encode($template); ?>, data.type)) { #>
|
2 |
-
<div class="panel woocommerce_options_panel <# if (data.panel != 'admin') { #>hidden<# } #>">
|
3 |
-
<div class="options_group wooccm-premium">
|
4 |
-
<p class="form-field">
|
5 |
-
<label><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></label>
|
6 |
-
<input <# if ( data.listable ) { #>checked="checked"<# } #> type="checkbox" name="listable" value="1">
|
7 |
-
<span class="description hidden"><?php esc_html_e('Display in View Orders screen', 'woocommerce-checkout-manager'); ?></span>
|
8 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
-
</p>
|
10 |
-
<p class="form-field">
|
11 |
-
<label><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></label>
|
12 |
-
<input <# if ( data.sortable ) { #>checked="checked"<# } #> type="checkbox" name="sortable" value="1">
|
13 |
-
<span class="description hidden"><?php esc_html_e('Allow Sorting on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
|
14 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
15 |
-
</p>
|
16 |
-
<p class="form-field">
|
17 |
-
<label><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></label>
|
18 |
-
<input <# if ( data.filterable ) { #>checked="checked"<# } #> type="checkbox" name="filterable" value="1">
|
19 |
-
<span class="description hidden"><?php esc_html_e('Allow Filtering on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
|
20 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
21 |
-
</p>
|
22 |
-
</div>
|
23 |
-
</div>
|
24 |
<# } #>
|
1 |
+
<# if (!_.contains(<?php echo json_encode($template); ?>, data.type)) { #>
|
2 |
+
<div class="panel woocommerce_options_panel <# if (data.panel != 'admin') { #>hidden<# } #>">
|
3 |
+
<div class="options_group wooccm-premium">
|
4 |
+
<p class="form-field">
|
5 |
+
<label><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></label>
|
6 |
+
<input <# if ( data.listable ) { #>checked="checked"<# } #> type="checkbox" name="listable" value="1">
|
7 |
+
<span class="description hidden"><?php esc_html_e('Display in View Orders screen', 'woocommerce-checkout-manager'); ?></span>
|
8 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
+
</p>
|
10 |
+
<p class="form-field">
|
11 |
+
<label><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></label>
|
12 |
+
<input <# if ( data.sortable ) { #>checked="checked"<# } #> type="checkbox" name="sortable" value="1">
|
13 |
+
<span class="description hidden"><?php esc_html_e('Allow Sorting on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
|
14 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
15 |
+
</p>
|
16 |
+
<p class="form-field">
|
17 |
+
<label><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></label>
|
18 |
+
<input <# if ( data.filterable ) { #>checked="checked"<# } #> type="checkbox" name="filterable" value="1">
|
19 |
+
<span class="description hidden"><?php esc_html_e('Allow Filtering on View Orders screen', 'woocommerce-checkout-manager'); ?></span>
|
20 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
21 |
+
</p>
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
<# } #>
|
includes/view/backend/pages/modals/parts/panel-datepicker.php
CHANGED
@@ -1,64 +1,64 @@
|
|
1 |
-
<# if (data.type == 'date') { #>
|
2 |
-
<div class="panel woocommerce_options_panel <# if (data.panel != 'datepicker') { #>hidden<# } #>">
|
3 |
-
<div class="options_group wooccm-premium">
|
4 |
-
<p class="form-field">
|
5 |
-
<label><?php esc_html_e('Enhance', 'woocommerce-checkout-manager'); ?></label>
|
6 |
-
<input <# if ( data.select2 ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="select2" value="1">
|
7 |
-
<span class="description hidden"><?php esc_html_e('Enhance date behaviour with datepicker.', 'woocommerce-checkout-manager'); ?></span>
|
8 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
-
</p>
|
10 |
-
</div>
|
11 |
-
<div class="options_group wooccm-premium">
|
12 |
-
<p class="form-field">
|
13 |
-
<label><?php esc_html_e('Date format', 'woocommerce-checkout-manager'); ?></label>
|
14 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="text" placeholder="dd-mm-yy" name="date_format" value="{{data.date_format}}">
|
15 |
-
<span class="description"><a target="_blank" href="https://wordpress.org/support/article/formatting-date-and-time/">Documentation on date and time formatting</a>.</span>
|
16 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
17 |
-
</p>
|
18 |
-
</div>
|
19 |
-
<div class="options_group wooccm-premium">
|
20 |
-
<p class="form-field">
|
21 |
-
<label><?php esc_html_e('Date limit', 'woocommerce-checkout-manager'); ?></label>
|
22 |
-
<select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="media-modal-render-panels select short" name="date_limit">
|
23 |
-
<option <# if ( data.date_limit == 'variable' ) { #>selected="selected"<# } #> value="variable"><?php esc_html_e('Since current date', 'woocommerce-checkout-manager'); ?></option>
|
24 |
-
<option <# if ( data.date_limit == 'fixed' ) { #>selected="selected"<# } #> value="fixed"><?php esc_html_e('Between fixed dates', 'woocommerce-checkout-manager'); ?></option>
|
25 |
-
</select>
|
26 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
27 |
-
</p>
|
28 |
-
</div>
|
29 |
-
<div class="options_group wooccm-premium">
|
30 |
-
<p class="form-field">
|
31 |
-
<label><?php esc_html_e('Days disable', 'woocommerce-checkout-manager'); ?></label>
|
32 |
-
<select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="wooccm-enhanced-select" name="date_limit_days[]" data-placeholder="<?php esc_attr_e('Disable week days', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
|
33 |
-
<?php for ($day_index = 0; $day_index <= 6; $day_index++) : ?>
|
34 |
-
<option <# if ( _.contains(data.date_limit_days, '<?php echo esc_attr($day_index); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($day_index); ?>"><?php echo $wp_locale->get_weekday($day_index); ?></option>
|
35 |
-
<?php endfor; ?>
|
36 |
-
</select>
|
37 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
38 |
-
</p>
|
39 |
-
</div>
|
40 |
-
<# if ( data.date_limit == 'variable' ) { #>
|
41 |
-
<div class="options_group wooccm-premium wooccm-enhanced-between-days">
|
42 |
-
<p class="form-field dimensions_field">
|
43 |
-
<label><?php esc_html_e('Between days', 'woocommerce-checkout-manager'); ?></label>
|
44 |
-
<span class="wrap">
|
45 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="number" placeholder="-3" min="-365" max="365" class="short " name="date_limit_variable_min" value="{{data.date_limit_variable_min}}">
|
46 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="number" placeholder="3" min="-365" max="365" class="short" name="date_limit_variable_max" value="{{data.date_limit_variable_max}}">
|
47 |
-
</span>
|
48 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
49 |
-
</p>
|
50 |
-
</div>
|
51 |
-
<# } else { #>
|
52 |
-
<div class="options_group wooccm-premium wooccm-enhanced-between-dates">
|
53 |
-
<p class="form-field dimensions_field">
|
54 |
-
<label><?php esc_html_e('Between dates', 'woocommerce-checkout-manager'); ?></label>
|
55 |
-
<span class="wrap">
|
56 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="text" class="short " name="date_limit_fixed_min" value="{{data.date_limit_fixed_min}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
|
57 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="text" class="short" name="date_limit_fixed_max" value="{{data.date_limit_fixed_max}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
|
58 |
-
</span>
|
59 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
60 |
-
</p>
|
61 |
-
</div>
|
62 |
-
<# } #>
|
63 |
-
</div>
|
64 |
<# } #>
|
1 |
+
<# if (data.type == 'date') { #>
|
2 |
+
<div class="panel woocommerce_options_panel <# if (data.panel != 'datepicker') { #>hidden<# } #>">
|
3 |
+
<div class="options_group wooccm-premium">
|
4 |
+
<p class="form-field">
|
5 |
+
<label><?php esc_html_e('Enhance', 'woocommerce-checkout-manager'); ?></label>
|
6 |
+
<input <# if ( data.select2 ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="select2" value="1">
|
7 |
+
<span class="description hidden"><?php esc_html_e('Enhance date behaviour with datepicker.', 'woocommerce-checkout-manager'); ?></span>
|
8 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
+
</p>
|
10 |
+
</div>
|
11 |
+
<div class="options_group wooccm-premium">
|
12 |
+
<p class="form-field">
|
13 |
+
<label><?php esc_html_e('Date format', 'woocommerce-checkout-manager'); ?></label>
|
14 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="text" placeholder="dd-mm-yy" name="date_format" value="{{data.date_format}}">
|
15 |
+
<span class="description"><a target="_blank" href="https://wordpress.org/support/article/formatting-date-and-time/">Documentation on date and time formatting</a>.</span>
|
16 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
17 |
+
</p>
|
18 |
+
</div>
|
19 |
+
<div class="options_group wooccm-premium">
|
20 |
+
<p class="form-field">
|
21 |
+
<label><?php esc_html_e('Date limit', 'woocommerce-checkout-manager'); ?></label>
|
22 |
+
<select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="media-modal-render-panels select short" name="date_limit">
|
23 |
+
<option <# if ( data.date_limit == 'variable' ) { #>selected="selected"<# } #> value="variable"><?php esc_html_e('Since current date', 'woocommerce-checkout-manager'); ?></option>
|
24 |
+
<option <# if ( data.date_limit == 'fixed' ) { #>selected="selected"<# } #> value="fixed"><?php esc_html_e('Between fixed dates', 'woocommerce-checkout-manager'); ?></option>
|
25 |
+
</select>
|
26 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
27 |
+
</p>
|
28 |
+
</div>
|
29 |
+
<div class="options_group wooccm-premium">
|
30 |
+
<p class="form-field">
|
31 |
+
<label><?php esc_html_e('Days disable', 'woocommerce-checkout-manager'); ?></label>
|
32 |
+
<select <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="wooccm-enhanced-select" name="date_limit_days[]" data-placeholder="<?php esc_attr_e('Disable week days', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
|
33 |
+
<?php for ($day_index = 0; $day_index <= 6; $day_index++) : ?>
|
34 |
+
<option <# if ( _.contains(data.date_limit_days, '<?php echo esc_attr($day_index); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($day_index); ?>"><?php echo $wp_locale->get_weekday($day_index); ?></option>
|
35 |
+
<?php endfor; ?>
|
36 |
+
</select>
|
37 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
38 |
+
</p>
|
39 |
+
</div>
|
40 |
+
<# if ( data.date_limit == 'variable' ) { #>
|
41 |
+
<div class="options_group wooccm-premium wooccm-enhanced-between-days">
|
42 |
+
<p class="form-field dimensions_field">
|
43 |
+
<label><?php esc_html_e('Between days', 'woocommerce-checkout-manager'); ?></label>
|
44 |
+
<span class="wrap">
|
45 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="number" placeholder="-3" min="-365" max="365" class="short " name="date_limit_variable_min" value="{{data.date_limit_variable_min}}" required>
|
46 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="number" placeholder="3" min="-365" max="365" class="short" name="date_limit_variable_max" value="{{data.date_limit_variable_max}}" required>
|
47 |
+
</span>
|
48 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
49 |
+
</p>
|
50 |
+
</div>
|
51 |
+
<# } else { #>
|
52 |
+
<div class="options_group wooccm-premium wooccm-enhanced-between-dates">
|
53 |
+
<p class="form-field dimensions_field">
|
54 |
+
<label><?php esc_html_e('Between dates', 'woocommerce-checkout-manager'); ?></label>
|
55 |
+
<span class="wrap">
|
56 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%" type="text" class="short " name="date_limit_fixed_min" value="{{data.date_limit_fixed_min}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
|
57 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> style="width:48.1%;margin: 0;" type="text" class="short" name="date_limit_fixed_max" value="{{data.date_limit_fixed_max}}" placeholder="<?php esc_html_e('From… YYYY-MM-DD', 'woocommerce-checkout-manager'); ?>" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])">
|
58 |
+
</span>
|
59 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
60 |
+
</p>
|
61 |
+
</div>
|
62 |
+
<# } #>
|
63 |
+
</div>
|
64 |
<# } #>
|
includes/view/backend/pages/modals/parts/panel-display.php
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
<div class="panel woocommerce_options_panel <# if (data.panel != 'display') { #>hidden<# } #>">
|
2 |
-
<div class="options_group wooccm-premium">
|
3 |
-
<p class="form-field">
|
4 |
-
<label><?php esc_html_e('Hide on account', 'woocommerce-checkout-manager'); ?></label>
|
5 |
-
<input <# if (data.hide_account) { #>checked="checked"<# } #> type="checkbox" name="hide_account" value="1">
|
6 |
-
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the account page', 'woocommerce-checkout-manager'); ?></span>
|
7 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
8 |
-
</p>
|
9 |
-
<p class="form-field">
|
10 |
-
<label><?php esc_html_e('Hide on checkout', 'woocommerce-checkout-manager'); ?></label>
|
11 |
-
<input <# if (data.hide_checkout) { #>checked="checked"<# } #> type="checkbox" name="hide_checkout" value="1">
|
12 |
-
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the checkout page', 'woocommerce-checkout-manager'); ?></span>
|
13 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
14 |
-
</p>
|
15 |
-
<p class="form-field">
|
16 |
-
<label><?php esc_html_e('Hide on orders', 'woocommerce-checkout-manager'); ?></label>
|
17 |
-
<input <# if (data.hide_order) { #>checked="checked"<# } #> type="checkbox" name="hide_order" value="1">
|
18 |
-
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user order', 'woocommerce-checkout-manager'); ?></span>
|
19 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
20 |
-
</p>
|
21 |
-
<p class="form-field">
|
22 |
-
<label><?php esc_html_e('Hide on emails', 'woocommerce-checkout-manager'); ?></label>
|
23 |
-
<input <# if (data.hide_email) { #>checked="checked"<# } #> type="checkbox" name="hide_email" value="1">
|
24 |
-
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user email', 'woocommerce-checkout-manager'); ?></span>
|
25 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
26 |
-
</p>
|
27 |
-
<p class="form-field">
|
28 |
-
<label><?php esc_html_e('Hide on invoices', 'woocommerce-checkout-manager'); ?></label>
|
29 |
-
<input <# if (data.hide_invoice) { #>checked="checked"<# } #> type="checkbox" name="hide_invoice" value="1">
|
30 |
-
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the order invoice', 'woocommerce-checkout-manager'); ?></span>
|
31 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
32 |
-
</p>
|
33 |
-
</div>
|
34 |
</div>
|
1 |
+
<div class="panel woocommerce_options_panel <# if (data.panel != 'display') { #>hidden<# } #>">
|
2 |
+
<div class="options_group wooccm-premium">
|
3 |
+
<p class="form-field">
|
4 |
+
<label><?php esc_html_e('Hide on account', 'woocommerce-checkout-manager'); ?></label>
|
5 |
+
<input <# if (data.hide_account) { #>checked="checked"<# } #> type="checkbox" name="hide_account" value="1">
|
6 |
+
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the account page', 'woocommerce-checkout-manager'); ?></span>
|
7 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
8 |
+
</p>
|
9 |
+
<p class="form-field">
|
10 |
+
<label><?php esc_html_e('Hide on checkout', 'woocommerce-checkout-manager'); ?></label>
|
11 |
+
<input <# if (data.hide_checkout) { #>checked="checked"<# } #> type="checkbox" name="hide_checkout" value="1">
|
12 |
+
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the checkout page', 'woocommerce-checkout-manager'); ?></span>
|
13 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
14 |
+
</p>
|
15 |
+
<p class="form-field">
|
16 |
+
<label><?php esc_html_e('Hide on orders', 'woocommerce-checkout-manager'); ?></label>
|
17 |
+
<input <# if (data.hide_order) { #>checked="checked"<# } #> type="checkbox" name="hide_order" value="1">
|
18 |
+
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user order', 'woocommerce-checkout-manager'); ?></span>
|
19 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
20 |
+
</p>
|
21 |
+
<p class="form-field">
|
22 |
+
<label><?php esc_html_e('Hide on emails', 'woocommerce-checkout-manager'); ?></label>
|
23 |
+
<input <# if (data.hide_email) { #>checked="checked"<# } #> type="checkbox" name="hide_email" value="1">
|
24 |
+
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the user email', 'woocommerce-checkout-manager'); ?></span>
|
25 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
26 |
+
</p>
|
27 |
+
<p class="form-field">
|
28 |
+
<label><?php esc_html_e('Hide on invoices', 'woocommerce-checkout-manager'); ?></label>
|
29 |
+
<input <# if (data.hide_invoice) { #>checked="checked"<# } #> type="checkbox" name="hide_invoice" value="1">
|
30 |
+
<span class="description hidden" style="display: inline-block"><?php esc_html_e('Hide this field on the order invoice', 'woocommerce-checkout-manager'); ?></span>
|
31 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
32 |
+
</p>
|
33 |
+
</div>
|
34 |
</div>
|
includes/view/backend/pages/modals/parts/panel-filter.php
CHANGED
@@ -1,80 +1,80 @@
|
|
1 |
-
<div class="panel woocommerce_options_panel <# if (data.panel != 'filter') { #>hidden<# } #>">
|
2 |
-
<div class="options_group wooccm-premium wooccm-enhanced-between-days">
|
3 |
-
<p class="form-field dimensions_field">
|
4 |
-
<label><?php esc_html_e('Cart subtotal', 'woocommerce-checkout-manager'); ?></label>
|
5 |
-
<span class="wrap">
|
6 |
-
<input style="width:48.1%" type="number" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" placeholder="<?php esc_attr_e('minimun', 'woocommerce-checkout-manager'); ?>" min="0" class="short " name="show_cart_minimum" value="{{data.show_cart_minimum}}">
|
7 |
-
<input style="width:48.1%;margin: 0;" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" type="number" placeholder="<?php esc_attr_e('maximun', 'woocommerce-checkout-manager'); ?>" min="0" class="short" name="show_cart_maximun" value="{{data.show_cart_maximun}}">
|
8 |
-
</span>
|
9 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
10 |
-
</p>
|
11 |
-
</div>
|
12 |
-
<div class="options_group">
|
13 |
-
<p class="form-field">
|
14 |
-
<label><?php esc_html_e('Show for roles', 'woocommerce-checkout-manager'); ?></label>
|
15 |
-
<select class="wooccm-enhanced-select" name="show_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
|
16 |
-
<?php foreach ($wp_roles->roles as $key => $value): ?>
|
17 |
-
<option <# if ( _.contains(data.show_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
|
18 |
-
<?php endforeach; ?>
|
19 |
-
</select>
|
20 |
-
</p>
|
21 |
-
<p class="form-field">
|
22 |
-
<label><?php esc_html_e('Hide for roles', 'woocommerce-checkout-manager'); ?></label>
|
23 |
-
<select class="wooccm-enhanced-select" name="hide_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
|
24 |
-
<?php foreach ($wp_roles->roles as $key => $value): ?>
|
25 |
-
<option <# if ( _.contains(data.hide_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
|
26 |
-
<?php endforeach; ?>
|
27 |
-
</select>
|
28 |
-
</p>
|
29 |
-
</div>
|
30 |
-
|
31 |
-
<div class="options_group">
|
32 |
-
<p class="form-field">
|
33 |
-
<label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
|
34 |
-
<input <# if (data.more_product) { #>checked="checked"<# } #> type="checkbox" name="more_product" value="1">
|
35 |
-
<span class="description"><?php esc_html_e('Apply conditions event it there is more than one product', 'woocommerce-checkout-manager'); ?></span>
|
36 |
-
</p>
|
37 |
-
</div>
|
38 |
-
|
39 |
-
<div class="options_group">
|
40 |
-
<p class="form-field">
|
41 |
-
<label><?php esc_html_e('Show for products', 'woocommerce-checkout-manager'); ?></label>
|
42 |
-
<select class="wooccm-product-search" name="show_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product}}" data-allow_clear="true" multiple="multiple">
|
43 |
-
<# _.each(data.show_product_selected, function(title, id){ #>
|
44 |
-
<option value="{{id}}" selected="selected">{{title}}</option>
|
45 |
-
<# }); #>
|
46 |
-
</select>
|
47 |
-
</p>
|
48 |
-
<p class="form-field">
|
49 |
-
<label><?php esc_html_e('Hide for products', 'woocommerce-checkout-manager'); ?></label>
|
50 |
-
<select class="wooccm-product-search" name="hide_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product}}" data-allow_clear="true" multiple="multiple">
|
51 |
-
<# _.each(data.hide_product_selected, function(title, id){ #>
|
52 |
-
<option value="{{id}}" selected="selected">{{title}}</option>
|
53 |
-
<# }); #>
|
54 |
-
</select>
|
55 |
-
</p>
|
56 |
-
</div>
|
57 |
-
|
58 |
-
<div class="options_group">
|
59 |
-
<p class="form-field">
|
60 |
-
<label><?php esc_html_e('Show for category', 'woocommerce-checkout-manager'); ?></label>
|
61 |
-
<select class="wooccm-enhanced-select" name="show_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product_cat}}" data-allow_clear="true" multiple="multiple">
|
62 |
-
<?php if ($product_categories) : ?>
|
63 |
-
<?php foreach ($product_categories as $category): ?>
|
64 |
-
<option <# if ( _.contains(data.show_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
|
65 |
-
<?php endforeach; ?>
|
66 |
-
<?php endif; ?>
|
67 |
-
</select>
|
68 |
-
</p>
|
69 |
-
<p class="form-field">
|
70 |
-
<label><?php esc_html_e('Hide for category', 'woocommerce-checkout-manager'); ?></label>
|
71 |
-
<select class="wooccm-enhanced-select" name="hide_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product_cat}}" data-allow_clear="true" multiple="multiple">
|
72 |
-
<?php if ($product_categories) : ?>
|
73 |
-
<?php foreach ($product_categories as $category): ?>
|
74 |
-
<option <# if ( _.contains(data.hide_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
|
75 |
-
<?php endforeach; ?>
|
76 |
-
<?php endif; ?>
|
77 |
-
</select>
|
78 |
-
</p>
|
79 |
-
</div>
|
80 |
</div>
|
1 |
+
<div class="panel woocommerce_options_panel <# if (data.panel != 'filter') { #>hidden<# } #>">
|
2 |
+
<div class="options_group wooccm-premium wooccm-enhanced-between-days">
|
3 |
+
<p class="form-field dimensions_field">
|
4 |
+
<label><?php esc_html_e('Cart subtotal', 'woocommerce-checkout-manager'); ?></label>
|
5 |
+
<span class="wrap">
|
6 |
+
<input style="width:48.1%" type="number" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" placeholder="<?php esc_attr_e('minimun', 'woocommerce-checkout-manager'); ?>" min="0" class="short " name="show_cart_minimum" value="{{data.show_cart_minimum}}">
|
7 |
+
<input style="width:48.1%;margin: 0;" pattern="[0-9]+([\.,][0-9]+)?" step="0.01" type="number" placeholder="<?php esc_attr_e('maximun', 'woocommerce-checkout-manager'); ?>" min="0" class="short" name="show_cart_maximun" value="{{data.show_cart_maximun}}">
|
8 |
+
</span>
|
9 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
10 |
+
</p>
|
11 |
+
</div>
|
12 |
+
<div class="options_group">
|
13 |
+
<p class="form-field">
|
14 |
+
<label><?php esc_html_e('Show for roles', 'woocommerce-checkout-manager'); ?></label>
|
15 |
+
<select class="wooccm-enhanced-select" name="show_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
|
16 |
+
<?php foreach ($wp_roles->roles as $key => $value): ?>
|
17 |
+
<option <# if ( _.contains(data.show_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
|
18 |
+
<?php endforeach; ?>
|
19 |
+
</select>
|
20 |
+
</p>
|
21 |
+
<p class="form-field">
|
22 |
+
<label><?php esc_html_e('Hide for roles', 'woocommerce-checkout-manager'); ?></label>
|
23 |
+
<select class="wooccm-enhanced-select" name="hide_role[]" data-placeholder="<?php esc_attr_e('Filter by roles', 'woocommerce-checkout-manager'); ?>" data-allow_clear="true" multiple="multiple">
|
24 |
+
<?php foreach ($wp_roles->roles as $key => $value): ?>
|
25 |
+
<option <# if ( _.contains(data.hide_role, '<?php echo esc_attr($key); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($value['name']); ?></option>
|
26 |
+
<?php endforeach; ?>
|
27 |
+
</select>
|
28 |
+
</p>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<div class="options_group">
|
32 |
+
<p class="form-field">
|
33 |
+
<label><?php esc_html_e('More', 'woocommerce-checkout-manager'); ?></label>
|
34 |
+
<input <# if (data.more_product) { #>checked="checked"<# } #> type="checkbox" name="more_product" value="1">
|
35 |
+
<span class="description"><?php esc_html_e('Apply conditions event it there is more than one product', 'woocommerce-checkout-manager'); ?></span>
|
36 |
+
</p>
|
37 |
+
</div>
|
38 |
+
|
39 |
+
<div class="options_group">
|
40 |
+
<p class="form-field">
|
41 |
+
<label><?php esc_html_e('Show for products', 'woocommerce-checkout-manager'); ?></label>
|
42 |
+
<select class="wooccm-product-search" name="show_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product}}" data-allow_clear="true" multiple="multiple">
|
43 |
+
<# _.each(data.show_product_selected, function(title, id){ #>
|
44 |
+
<option value="{{id}}" selected="selected">{{title}}</option>
|
45 |
+
<# }); #>
|
46 |
+
</select>
|
47 |
+
</p>
|
48 |
+
<p class="form-field">
|
49 |
+
<label><?php esc_html_e('Hide for products', 'woocommerce-checkout-manager'); ?></label>
|
50 |
+
<select class="wooccm-product-search" name="hide_product[]" data-placeholder="<?php esc_attr_e('Filter by product', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product}}" data-allow_clear="true" multiple="multiple">
|
51 |
+
<# _.each(data.hide_product_selected, function(title, id){ #>
|
52 |
+
<option value="{{id}}" selected="selected">{{title}}</option>
|
53 |
+
<# }); #>
|
54 |
+
</select>
|
55 |
+
</p>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div class="options_group">
|
59 |
+
<p class="form-field">
|
60 |
+
<label><?php esc_html_e('Show for category', 'woocommerce-checkout-manager'); ?></label>
|
61 |
+
<select class="wooccm-enhanced-select" name="show_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.show_product_cat}}" data-allow_clear="true" multiple="multiple">
|
62 |
+
<?php if ($product_categories) : ?>
|
63 |
+
<?php foreach ($product_categories as $category): ?>
|
64 |
+
<option <# if ( _.contains(data.show_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
|
65 |
+
<?php endforeach; ?>
|
66 |
+
<?php endif; ?>
|
67 |
+
</select>
|
68 |
+
</p>
|
69 |
+
<p class="form-field">
|
70 |
+
<label><?php esc_html_e('Hide for category', 'woocommerce-checkout-manager'); ?></label>
|
71 |
+
<select class="wooccm-enhanced-select" name="hide_product_cat[]" data-placeholder="<?php esc_attr_e('Filter by categories', 'woocommerce-checkout-manager'); ?>" data-selected="{{data.hide_product_cat}}" data-allow_clear="true" multiple="multiple">
|
72 |
+
<?php if ($product_categories) : ?>
|
73 |
+
<?php foreach ($product_categories as $category): ?>
|
74 |
+
<option <# if ( _.contains(data.hide_product_cat, '<?php echo esc_attr($category->term_id); ?>') ) { #>selected="selected"<# } #> value="<?php echo esc_attr($category->term_id); ?>"><?php echo esc_html($category->name); ?></option>
|
75 |
+
<?php endforeach; ?>
|
76 |
+
<?php endif; ?>
|
77 |
+
</select>
|
78 |
+
</p>
|
79 |
+
</div>
|
80 |
</div>
|
includes/view/backend/pages/modals/parts/panel-select2.php
CHANGED
@@ -1,40 +1,40 @@
|
|
1 |
-
<# if (_.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
|
2 |
-
<div class="panel woocommerce_options_panel <# if (data.panel != 'select2') { #>hidden<# } #>">
|
3 |
-
<div class="options_group wooccm-premium">
|
4 |
-
<p class="form-field">
|
5 |
-
<label><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></label>
|
6 |
-
<input <# if ( data.select2 ) { #>checked="checked"<# } #> type="checkbox" name="select2" value="1">
|
7 |
-
<span class="description hidden"><?php esc_html_e('Enhance select behaviour with select2.', 'woocommerce-checkout-manager'); ?></span>
|
8 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
-
</p>
|
10 |
-
</div>
|
11 |
-
<div class="options_group wooccm-premium">
|
12 |
-
<p class="form-field">
|
13 |
-
<label><?php esc_html_e('Allow clear', 'woocommerce-checkout-manager'); ?></label>
|
14 |
-
<input <# if ( data.select2_allowclear ) { #>checked="checked"<# } #> type="checkbox" name="select2_allowclear" value="1">
|
15 |
-
<span class="description hidden"><?php esc_html_e('Provides support for clearable selections.', 'woocommerce-checkout-manager'); ?></span>
|
16 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
17 |
-
</p>
|
18 |
-
<p class="form-field">
|
19 |
-
<label><?php esc_html_e('Allow search', 'woocommerce-checkout-manager'); ?></label>
|
20 |
-
<input <# if ( data.select2_search ) { #>checked="checked"<# } #> type="checkbox" name="select2_search" value="1">
|
21 |
-
<span class="description hidden"><?php esc_html_e('Display the search box for options.', 'woocommerce-checkout-manager'); ?></span>
|
22 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
23 |
-
</p>
|
24 |
-
</div>
|
25 |
-
<div class="options_group wooccm-premium">
|
26 |
-
<p class="form-field">
|
27 |
-
<label><?php esc_html_e('Select on close', 'woocommerce-checkout-manager'); ?></label>
|
28 |
-
<input <# if ( data.select2_selectonclose ) { #>checked="checked"<# } #> type="checkbox" name="select2_selectonclose" value="1">
|
29 |
-
<span class="description hidden"><?php esc_html_e('Implements automatic selection when the dropdown is closed.', 'woocommerce-checkout-manager'); ?></span>
|
30 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
31 |
-
</p>
|
32 |
-
<p class="form-field">
|
33 |
-
<label><?php esc_html_e('Close on select', 'woocommerce-checkout-manager'); ?></label>
|
34 |
-
<input <# if ( data.select2_closeonselect ) { #>checked="checked"<# } #> type="checkbox" name="select2_closeonselect" value="1">
|
35 |
-
<span class="description hidden"><?php esc_html_e('Controls whether the dropdown is closed after a selection is made.', 'woocommerce-checkout-manager'); ?></span>
|
36 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
37 |
-
</p>
|
38 |
-
</div>
|
39 |
-
</div>
|
40 |
<# } #>
|
1 |
+
<# if (_.contains(<?php echo json_encode(array('select', 'multiselect')); ?>, data.type)) { #>
|
2 |
+
<div class="panel woocommerce_options_panel <# if (data.panel != 'select2') { #>hidden<# } #>">
|
3 |
+
<div class="options_group wooccm-premium">
|
4 |
+
<p class="form-field">
|
5 |
+
<label><?php esc_html_e('Select2', 'woocommerce-checkout-manager'); ?></label>
|
6 |
+
<input <# if ( data.select2 ) { #>checked="checked"<# } #> type="checkbox" name="select2" value="1">
|
7 |
+
<span class="description hidden"><?php esc_html_e('Enhance select behaviour with select2.', 'woocommerce-checkout-manager'); ?></span>
|
8 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
+
</p>
|
10 |
+
</div>
|
11 |
+
<div class="options_group wooccm-premium">
|
12 |
+
<p class="form-field">
|
13 |
+
<label><?php esc_html_e('Allow clear', 'woocommerce-checkout-manager'); ?></label>
|
14 |
+
<input <# if ( data.select2_allowclear ) { #>checked="checked"<# } #> type="checkbox" name="select2_allowclear" value="1">
|
15 |
+
<span class="description hidden"><?php esc_html_e('Provides support for clearable selections.', 'woocommerce-checkout-manager'); ?></span>
|
16 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
17 |
+
</p>
|
18 |
+
<p class="form-field">
|
19 |
+
<label><?php esc_html_e('Allow search', 'woocommerce-checkout-manager'); ?></label>
|
20 |
+
<input <# if ( data.select2_search ) { #>checked="checked"<# } #> type="checkbox" name="select2_search" value="1">
|
21 |
+
<span class="description hidden"><?php esc_html_e('Display the search box for options.', 'woocommerce-checkout-manager'); ?></span>
|
22 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
23 |
+
</p>
|
24 |
+
</div>
|
25 |
+
<div class="options_group wooccm-premium">
|
26 |
+
<p class="form-field">
|
27 |
+
<label><?php esc_html_e('Select on close', 'woocommerce-checkout-manager'); ?></label>
|
28 |
+
<input <# if ( data.select2_selectonclose ) { #>checked="checked"<# } #> type="checkbox" name="select2_selectonclose" value="1">
|
29 |
+
<span class="description hidden"><?php esc_html_e('Implements automatic selection when the dropdown is closed.', 'woocommerce-checkout-manager'); ?></span>
|
30 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
31 |
+
</p>
|
32 |
+
<p class="form-field">
|
33 |
+
<label><?php esc_html_e('Close on select', 'woocommerce-checkout-manager'); ?></label>
|
34 |
+
<input <# if ( data.select2_closeonselect ) { #>checked="checked"<# } #> type="checkbox" name="select2_closeonselect" value="1">
|
35 |
+
<span class="description hidden"><?php esc_html_e('Controls whether the dropdown is closed after a selection is made.', 'woocommerce-checkout-manager'); ?></span>
|
36 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
37 |
+
</p>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
<# } #>
|
includes/view/backend/pages/modals/parts/panel-timepicker.php
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
<# if (data.type == 'time') { #>
|
2 |
-
<div class="panel woocommerce_options_panel <# if (data.panel != 'timepicker') { #>hidden<# } #>">
|
3 |
-
<div class="options_group wooccm-premium">
|
4 |
-
<p class="form-field">
|
5 |
-
<label><?php esc_html_e('Enhance', 'woocommerce-checkout-manager'); ?></label>
|
6 |
-
<input <# if ( data.select2 ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="select2" value="1">
|
7 |
-
<span class="description hidden"><?php esc_html_e('Enhance time behaviour with timepicker.', 'woocommerce-checkout-manager'); ?></span>
|
8 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
-
</p>
|
10 |
-
</div>
|
11 |
-
<div class="options_group wooccm-premium">
|
12 |
-
<p class="form-field">
|
13 |
-
<label><?php esc_html_e('Hour start', 'woocommerce-checkout-manager'); ?></label>
|
14 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="time" placeholder="6" name="time_limit_start" value="{{data.time_limit_start}}">
|
15 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
16 |
-
</p>
|
17 |
-
<p class="form-field">
|
18 |
-
<label><?php esc_html_e('Hour end', 'woocommerce-checkout-manager'); ?></label>
|
19 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="time" placeholder="9" name="time_limit_end" value="{{data.time_limit_end}}">
|
20 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
21 |
-
</p>
|
22 |
-
<p class="form-field">
|
23 |
-
<label><?php esc_html_e('Minutes interval', 'woocommerce-checkout-manager'); ?></label>
|
24 |
-
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="60" step="5" placeholder="15" name="time_limit_interval" value="{{data.time_limit_interval}}">
|
25 |
-
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
26 |
-
</p>
|
27 |
-
</div>
|
28 |
-
</div>
|
29 |
<# } #>
|
1 |
+
<# if (data.type == 'time') { #>
|
2 |
+
<div class="panel woocommerce_options_panel <# if (data.panel != 'timepicker') { #>hidden<# } #>">
|
3 |
+
<div class="options_group wooccm-premium">
|
4 |
+
<p class="form-field">
|
5 |
+
<label><?php esc_html_e('Enhance', 'woocommerce-checkout-manager'); ?></label>
|
6 |
+
<input <# if ( data.select2 ) { #>checked="checked"<# } #> class="media-modal-render-panels" type="checkbox" name="select2" value="1">
|
7 |
+
<span class="description hidden"><?php esc_html_e('Enhance time behaviour with timepicker.', 'woocommerce-checkout-manager'); ?></span>
|
8 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
9 |
+
</p>
|
10 |
+
</div>
|
11 |
+
<div class="options_group wooccm-premium">
|
12 |
+
<p class="form-field">
|
13 |
+
<label><?php esc_html_e('Hour start', 'woocommerce-checkout-manager'); ?></label>
|
14 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="time" placeholder="6" name="time_limit_start" value="{{data.time_limit_start}}">
|
15 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
16 |
+
</p>
|
17 |
+
<p class="form-field">
|
18 |
+
<label><?php esc_html_e('Hour end', 'woocommerce-checkout-manager'); ?></label>
|
19 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="time" placeholder="9" name="time_limit_end" value="{{data.time_limit_end}}">
|
20 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
21 |
+
</p>
|
22 |
+
<p class="form-field">
|
23 |
+
<label><?php esc_html_e('Minutes interval', 'woocommerce-checkout-manager'); ?></label>
|
24 |
+
<input <# if ( !data.select2 ) { #>disabled="disabled"<# } #> class="short" type="number" min="0" max="60" step="5" placeholder="15" name="time_limit_interval" value="{{data.time_limit_interval}}">
|
25 |
+
<span class="description premium">(<?php esc_html_e('This is a premium feature', 'woocommerce-checkout-manager'); ?>)</span>
|
26 |
+
</p>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
<# } #>
|
includes/view/backend/pages/parts/header.php
CHANGED
@@ -1,48 +1,48 @@
|
|
1 |
-
<div class="wrap about-wrap full-width-layout">
|
2 |
-
|
3 |
-
<h1><?php esc_html_e('Suggestions', 'woocommerce-checkout-manager'); ?></h1>
|
4 |
-
|
5 |
-
<p class="about-text"><?php printf(esc_html__('Thanks for using our product! We recommend these extensions that will add new features to stand out your business and improve your sales.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?></p>
|
6 |
-
|
7 |
-
<p class="about-text">
|
8 |
-
<?php printf('<a href="%s" target="_blank">%s</a>', WOOCCM_PURCHASE_URL, esc_html__('Purchase', 'woocommerce-checkout-manager')); ?></a> |
|
9 |
-
<?php printf('<a href="%s" target="_blank">%s</a>', WOOCCM_DOCUMENTATION_URL, esc_html__('Documentation', 'woocommerce-checkout-manager')); ?></a>
|
10 |
-
</p>
|
11 |
-
|
12 |
-
<?php printf('<a href="%s" target="_blank"><div style="
|
13 |
-
background: #006bff url(%s) no-repeat;
|
14 |
-
background-position: top center;
|
15 |
-
background-size: 130px 130px;
|
16 |
-
color: #fff;
|
17 |
-
font-size: 14px;
|
18 |
-
text-align: center;
|
19 |
-
font-weight: 600;
|
20 |
-
margin: 5px 0 0;
|
21 |
-
padding-top: 120px;
|
22 |
-
height: 40px;
|
23 |
-
display: inline-block;
|
24 |
-
width: 140px;
|
25 |
-
" class="wp-badge">%s</div></a>', 'https://quadlayers.com/?utm_source=wooccm_admin', plugins_url('/assets/backend/img/quadlayers.jpg', WOOCCM_PLUGIN_FILE), esc_html__('QuadLayers', 'woocommerce-checkout-manager')); ?>
|
26 |
-
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<?php
|
30 |
-
if (isset($GLOBALS['submenu'][WOOCCM_PREFIX])) {
|
31 |
-
if (is_array($GLOBALS['submenu'][WOOCCM_PREFIX])) {
|
32 |
-
?>
|
33 |
-
<div class="wrap about-wrap full-width-layout qlwrap">
|
34 |
-
<h2 class="nav-tab-wrapper">
|
35 |
-
<?php
|
36 |
-
foreach ($GLOBALS['submenu'][WOOCCM_PREFIX] as $tab) {
|
37 |
-
if (strpos($tab[2], '.php') !== false)
|
38 |
-
continue;
|
39 |
-
?>
|
40 |
-
<a href="<?php echo admin_url('admin.php?page=' . esc_attr($tab[2])); ?>" class="nav-tab<?php echo (isset($_GET['page']) && $_GET['page'] == $tab[2]) ? ' nav-tab-active' : ''; ?>"><?php echo $tab[0]; ?></a>
|
41 |
-
<?php
|
42 |
-
}
|
43 |
-
?>
|
44 |
-
</h2>
|
45 |
-
</div>
|
46 |
-
<?php
|
47 |
-
}
|
48 |
}
|
1 |
+
<div class="wrap about-wrap full-width-layout">
|
2 |
+
|
3 |
+
<h1><?php esc_html_e('Suggestions', 'woocommerce-checkout-manager'); ?></h1>
|
4 |
+
|
5 |
+
<p class="about-text"><?php printf(esc_html__('Thanks for using our product! We recommend these extensions that will add new features to stand out your business and improve your sales.', 'woocommerce-checkout-manager'), WOOCCM_PLUGIN_NAME); ?></p>
|
6 |
+
|
7 |
+
<p class="about-text">
|
8 |
+
<?php printf('<a href="%s" target="_blank">%s</a>', WOOCCM_PURCHASE_URL, esc_html__('Purchase', 'woocommerce-checkout-manager')); ?></a> |
|
9 |
+
<?php printf('<a href="%s" target="_blank">%s</a>', WOOCCM_DOCUMENTATION_URL, esc_html__('Documentation', 'woocommerce-checkout-manager')); ?></a>
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<?php printf('<a href="%s" target="_blank"><div style="
|
13 |
+
background: #006bff url(%s) no-repeat;
|
14 |
+
background-position: top center;
|
15 |
+
background-size: 130px 130px;
|
16 |
+
color: #fff;
|
17 |
+
font-size: 14px;
|
18 |
+
text-align: center;
|
19 |
+
font-weight: 600;
|
20 |
+
margin: 5px 0 0;
|
21 |
+
padding-top: 120px;
|
22 |
+
height: 40px;
|
23 |
+
display: inline-block;
|
24 |
+
width: 140px;
|
25 |
+
" class="wp-badge">%s</div></a>', 'https://quadlayers.com/?utm_source=wooccm_admin', plugins_url('/assets/backend/img/quadlayers.jpg', WOOCCM_PLUGIN_FILE), esc_html__('QuadLayers', 'woocommerce-checkout-manager')); ?>
|
26 |
+
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<?php
|
30 |
+
if (isset($GLOBALS['submenu'][WOOCCM_PREFIX])) {
|
31 |
+
if (is_array($GLOBALS['submenu'][WOOCCM_PREFIX])) {
|
32 |
+
?>
|
33 |
+
<div class="wrap about-wrap full-width-layout qlwrap">
|
34 |
+
<h2 class="nav-tab-wrapper">
|
35 |
+
<?php
|
36 |
+
foreach ($GLOBALS['submenu'][WOOCCM_PREFIX] as $tab) {
|
37 |
+
if (strpos($tab[2], '.php') !== false)
|
38 |
+
continue;
|
39 |
+
?>
|
40 |
+
<a href="<?php echo admin_url('admin.php?page=' . esc_attr($tab[2])); ?>" class="nav-tab<?php echo (isset($_GET['page']) && $_GET['page'] == $tab[2]) ? ' nav-tab-active' : ''; ?>"><?php echo $tab[0]; ?></a>
|
41 |
+
<?php
|
42 |
+
}
|
43 |
+
?>
|
44 |
+
</h2>
|
45 |
+
</div>
|
46 |
+
<?php
|
47 |
+
}
|
48 |
}
|
includes/view/backend/pages/parts/loop.php
CHANGED
@@ -1,130 +1,130 @@
|
|
1 |
-
<table class="form-table">
|
2 |
-
<tbody>
|
3 |
-
<tr valign="top">
|
4 |
-
<td class="<?php printf('wooccm_%s_wrapper', $current_section); ?> wc_payment_gateways_wrapper" colspan="2">
|
5 |
-
<table id="<?php printf('wooccm_%s_fields', $current_section); ?>" class="wc_gateways widefat" cellspacing="0" aria-describedby="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
6 |
-
<thead>
|
7 |
-
<tr>
|
8 |
-
<th class="sort" style="width:1%"></th>
|
9 |
-
<th class="required" style="width:1%"><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></th>
|
10 |
-
<th class="position" style="width:1%;min-width: 100px;"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></th>
|
11 |
-
<th class="clear" style="width:1%"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></th>
|
12 |
-
<th class="type" style="width:1%"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
|
13 |
-
<th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
|
14 |
-
<th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
|
15 |
-
<th class="id" style="width:1%;"><?php esc_html_e('ID', 'woocommerce-checkout-manager'); ?></th>
|
16 |
-
<!--<th class="listable"><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></th>
|
17 |
-
<th class="sortable"><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></th>
|
18 |
-
<th class="filterable"><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></th>-->
|
19 |
-
<th class="status" style="width:1%"><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></th>
|
20 |
-
<th class="edit" style="width:1%"></th>
|
21 |
-
<th class="delete" style="width:1%"></th>
|
22 |
-
</tr>
|
23 |
-
</thead>
|
24 |
-
<tbody class="ui-sortable">
|
25 |
-
<?php if (count($fields)): ?>
|
26 |
-
<?php foreach ($fields as $id => $field) : ?>
|
27 |
-
<tr data-field_id="<?php echo esc_attr($field['id']); ?>" data-field_order="<?php echo esc_attr($field['order']); ?>">
|
28 |
-
<td class="sort ui-sortable-handle">
|
29 |
-
<div class="wc-item-reorder-nav">
|
30 |
-
<button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move up', 'woocommerce-checkout-manager'); ?></button>
|
31 |
-
<button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move down', 'woocommerce-checkout-manager'); ?></button>
|
32 |
-
<input type="hidden" name="field_order[]" value="<?php echo esc_attr($id); ?>">
|
33 |
-
</div>
|
34 |
-
</td>
|
35 |
-
<td class="required">
|
36 |
-
<a data-field_attr="required" class="wooccm-field-toggle-attribute" href="#">
|
37 |
-
<?php
|
38 |
-
if ($field['required'] === true) {
|
39 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
40 |
-
} else {
|
41 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
42 |
-
}
|
43 |
-
?>
|
44 |
-
</a>
|
45 |
-
</td>
|
46 |
-
<td class="position">
|
47 |
-
<select data-field_attr="position" class="wooccm-field-change-attribute" style="width: auto; border-radius: 3px; height: 28px; line-height: 28px;" name="position">
|
48 |
-
<option <?php selected($field['position'], 'form-row-wide'); ?> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-manager'); ?></option>
|
49 |
-
<option <?php selected($field['position'], 'form-row-first'); ?> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-manager'); ?></option>
|
50 |
-
<option <?php selected($field['position'], 'form-row-last'); ?> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-manager'); ?></option>
|
51 |
-
</select>
|
52 |
-
</td>
|
53 |
-
<td class="clear">
|
54 |
-
<a data-field_attr="clear" class="wooccm-field-toggle-attribute" href="#">
|
55 |
-
<?php
|
56 |
-
if ($field['clear'] === true) {
|
57 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
58 |
-
} else {
|
59 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
60 |
-
}
|
61 |
-
?>
|
62 |
-
</a>
|
63 |
-
</td>
|
64 |
-
<td class="type">
|
65 |
-
<?php echo esc_html($field['type']); ?>
|
66 |
-
</td>
|
67 |
-
<td class="label">
|
68 |
-
<?php echo esc_html($field['label']); ?>
|
69 |
-
</td>
|
70 |
-
<td class="placeholder">
|
71 |
-
<?php echo esc_html($field['placeholder']); ?>
|
72 |
-
</td>
|
73 |
-
<td class="id">
|
74 |
-
<?php echo esc_html($field['key']); ?>
|
75 |
-
</td>
|
76 |
-
<!--<td class="listable">
|
77 |
-
<?php
|
78 |
-
if ($field['listable'] === true) {
|
79 |
-
?>
|
80 |
-
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
81 |
-
<?php } else { ?>
|
82 |
-
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
83 |
-
<?php } ?>
|
84 |
-
</td>
|
85 |
-
<td class="sortable">
|
86 |
-
<?php
|
87 |
-
if ($field['sortable'] === true) {
|
88 |
-
?>
|
89 |
-
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
90 |
-
<?php } else { ?>
|
91 |
-
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
92 |
-
<?php } ?>
|
93 |
-
</td>
|
94 |
-
<td class="filterable">
|
95 |
-
<?php
|
96 |
-
if ($field['filterable'] === true) {
|
97 |
-
?>
|
98 |
-
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
99 |
-
<?php } else { ?>
|
100 |
-
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
101 |
-
<?php } ?>
|
102 |
-
</td>-->
|
103 |
-
<td class="status">
|
104 |
-
<a data-field_attr="disabled" class="wooccm-field-toggle-attribute" href="#">
|
105 |
-
<?php
|
106 |
-
if ($field['disabled'] === true) {
|
107 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
108 |
-
} else {
|
109 |
-
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
110 |
-
}
|
111 |
-
?>
|
112 |
-
</a>
|
113 |
-
</td>
|
114 |
-
<td class="edit">
|
115 |
-
<a class="<?php printf('wooccm_%s_settings_edit', $current_section); ?> button" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
|
116 |
-
</td>
|
117 |
-
<td class="delete">
|
118 |
-
<?php if (is_array($defaults) && !in_array($field['name'], $defaults)): ?>
|
119 |
-
<a class="<?php printf('wooccm_%s_settings_delete', $current_section); ?>" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
|
120 |
-
<?php endif; ?>
|
121 |
-
</td>
|
122 |
-
</tr>
|
123 |
-
<?php endforeach; ?>
|
124 |
-
<?php endif; ?>
|
125 |
-
</tbody>
|
126 |
-
</table>
|
127 |
-
</td>
|
128 |
-
</tr>
|
129 |
-
</tbody>
|
130 |
</table>
|
1 |
+
<table class="form-table">
|
2 |
+
<tbody>
|
3 |
+
<tr valign="top">
|
4 |
+
<td class="<?php printf('wooccm_%s_wrapper', $current_section); ?> wc_payment_gateways_wrapper" colspan="2">
|
5 |
+
<table id="<?php printf('wooccm_%s_fields', $current_section); ?>" class="wc_gateways widefat" cellspacing="0" aria-describedby="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
6 |
+
<thead>
|
7 |
+
<tr>
|
8 |
+
<th class="sort" style="width:1%"></th>
|
9 |
+
<th class="required" style="width:1%"><?php esc_html_e('Required', 'woocommerce-checkout-manager'); ?></th>
|
10 |
+
<th class="position" style="width:1%;min-width: 100px;"><?php esc_html_e('Position', 'woocommerce-checkout-manager'); ?></th>
|
11 |
+
<th class="clear" style="width:1%"><?php esc_html_e('Clear', 'woocommerce-checkout-manager'); ?></th>
|
12 |
+
<th class="type" style="width:1%"><?php esc_html_e('Type', 'woocommerce-checkout-manager'); ?></th>
|
13 |
+
<th class="label" style="width:1%;min-width: 100px;"><?php esc_html_e('Label', 'woocommerce-checkout-manager'); ?></th>
|
14 |
+
<th class="placeholder"><?php esc_html_e('Placeholder', 'woocommerce-checkout-manager'); ?></th>
|
15 |
+
<th class="id" style="width:1%;"><?php esc_html_e('ID', 'woocommerce-checkout-manager'); ?></th>
|
16 |
+
<!--<th class="listable"><?php esc_html_e('Listable', 'woocommerce-checkout-manager'); ?></th>
|
17 |
+
<th class="sortable"><?php esc_html_e('Sortable', 'woocommerce-checkout-manager'); ?></th>
|
18 |
+
<th class="filterable"><?php esc_html_e('Filterable', 'woocommerce-checkout-manager'); ?></th>-->
|
19 |
+
<th class="status" style="width:1%"><?php esc_html_e('Disabled', 'woocommerce-checkout-manager'); ?></th>
|
20 |
+
<th class="edit" style="width:1%"></th>
|
21 |
+
<th class="delete" style="width:1%"></th>
|
22 |
+
</tr>
|
23 |
+
</thead>
|
24 |
+
<tbody class="ui-sortable">
|
25 |
+
<?php if (count($fields)): ?>
|
26 |
+
<?php foreach ($fields as $id => $field) : ?>
|
27 |
+
<tr data-field_id="<?php echo esc_attr($field['id']); ?>" data-field_order="<?php echo esc_attr($field['order']); ?>">
|
28 |
+
<td class="sort ui-sortable-handle">
|
29 |
+
<div class="wc-item-reorder-nav">
|
30 |
+
<button type="button" class="wc-move-up wc-move-disabled" tabindex="-1" aria-hidden="true" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move up', 'woocommerce-checkout-manager'); ?></button>
|
31 |
+
<button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php echo esc_attr(sprintf(__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move down', 'woocommerce-checkout-manager'); ?></button>
|
32 |
+
<input type="hidden" name="field_order[]" value="<?php echo esc_attr($id); ?>">
|
33 |
+
</div>
|
34 |
+
</td>
|
35 |
+
<td class="required">
|
36 |
+
<a data-field_attr="required" class="wooccm-field-toggle-attribute" href="#">
|
37 |
+
<?php
|
38 |
+
if ($field['required'] === true) {
|
39 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
40 |
+
} else {
|
41 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
42 |
+
}
|
43 |
+
?>
|
44 |
+
</a>
|
45 |
+
</td>
|
46 |
+
<td class="position">
|
47 |
+
<select data-field_attr="position" class="wooccm-field-change-attribute" style="width: auto; border-radius: 3px; height: 28px; line-height: 28px;" name="position">
|
48 |
+
<option <?php selected($field['position'], 'form-row-wide'); ?> value="form-row-wide"><?php esc_html_e('Wide', 'woocommerce-checkout-manager'); ?></option>
|
49 |
+
<option <?php selected($field['position'], 'form-row-first'); ?> value="form-row-first"><?php esc_html_e('Left', 'woocommerce-checkout-manager'); ?></option>
|
50 |
+
<option <?php selected($field['position'], 'form-row-last'); ?> value="form-row-last"><?php esc_html_e('Right', 'woocommerce-checkout-manager'); ?></option>
|
51 |
+
</select>
|
52 |
+
</td>
|
53 |
+
<td class="clear">
|
54 |
+
<a data-field_attr="clear" class="wooccm-field-toggle-attribute" href="#">
|
55 |
+
<?php
|
56 |
+
if ($field['clear'] === true) {
|
57 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
58 |
+
} else {
|
59 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
60 |
+
}
|
61 |
+
?>
|
62 |
+
</a>
|
63 |
+
</td>
|
64 |
+
<td class="type">
|
65 |
+
<?php echo esc_html($field['type']); ?>
|
66 |
+
</td>
|
67 |
+
<td class="label">
|
68 |
+
<?php echo esc_html($field['label']); ?>
|
69 |
+
</td>
|
70 |
+
<td class="placeholder">
|
71 |
+
<?php echo esc_html($field['placeholder']); ?>
|
72 |
+
</td>
|
73 |
+
<td class="id">
|
74 |
+
<?php echo esc_html($field['key']); ?>
|
75 |
+
</td>
|
76 |
+
<!--<td class="listable">
|
77 |
+
<?php
|
78 |
+
if ($field['listable'] === true) {
|
79 |
+
?>
|
80 |
+
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
81 |
+
<?php } else { ?>
|
82 |
+
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
83 |
+
<?php } ?>
|
84 |
+
</td>
|
85 |
+
<td class="sortable">
|
86 |
+
<?php
|
87 |
+
if ($field['sortable'] === true) {
|
88 |
+
?>
|
89 |
+
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
90 |
+
<?php } else { ?>
|
91 |
+
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
92 |
+
<?php } ?>
|
93 |
+
</td>
|
94 |
+
<td class="filterable">
|
95 |
+
<?php
|
96 |
+
if ($field['filterable'] === true) {
|
97 |
+
?>
|
98 |
+
<span class="status-enabled"><?php esc_html_e('Yes'); ?></span>
|
99 |
+
<?php } else { ?>
|
100 |
+
<span class="status-disabled"><?php esc_html_e('Yes'); ?></span>
|
101 |
+
<?php } ?>
|
102 |
+
</td>-->
|
103 |
+
<td class="status">
|
104 |
+
<a data-field_attr="disabled" class="wooccm-field-toggle-attribute" href="#">
|
105 |
+
<?php
|
106 |
+
if ($field['disabled'] === true) {
|
107 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--enabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently enabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('Yes', 'woocommerce-checkout-manager') . '</span>';
|
108 |
+
} else {
|
109 |
+
echo '<span class="woocommerce-input-toggle woocommerce-input-toggle--disabled" aria-label="' . esc_attr(sprintf(__('The "%s" field currently disabled', 'woocommerce-checkout-manager'), $field['label'])) . '">' . esc_attr__('No', 'woocommerce-checkout-manager') . '</span>';
|
110 |
+
}
|
111 |
+
?>
|
112 |
+
</a>
|
113 |
+
</td>
|
114 |
+
<td class="edit">
|
115 |
+
<a class="<?php printf('wooccm_%s_settings_edit', $current_section); ?> button" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Edit'); ?></a>
|
116 |
+
</td>
|
117 |
+
<td class="delete">
|
118 |
+
<?php if (is_array($defaults) && !in_array($field['name'], $defaults)): ?>
|
119 |
+
<a class="<?php printf('wooccm_%s_settings_delete', $current_section); ?>" aria-label="<?php esc_html_e('Edit checkout field', 'woocommerce-checkout-manager'); ?>" href="javascript:;"><?php esc_html_e('Delete'); ?></a>
|
120 |
+
<?php endif; ?>
|
121 |
+
</td>
|
122 |
+
</tr>
|
123 |
+
<?php endforeach; ?>
|
124 |
+
<?php endif; ?>
|
125 |
+
</tbody>
|
126 |
+
</table>
|
127 |
+
</td>
|
128 |
+
</tr>
|
129 |
+
</tbody>
|
130 |
</table>
|
includes/view/backend/pages/parts/tabs.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
<ul class="subsubsub">
|
2 |
-
<?php do_action('wooccm_sections_header'); ?>
|
3 |
-
<li><a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php echo esc_html__('Documentation', 'woocommerce-checkout-manager'); ?></a></li>
|
4 |
-
</ul>
|
5 |
<br class="clear" />
|
1 |
+
<ul class="subsubsub">
|
2 |
+
<?php do_action('wooccm_sections_header'); ?>
|
3 |
+
<li><a target="_blank" href="<?php echo WOOCCM_DOCUMENTATION_URL; ?>"><?php echo esc_html__('Documentation', 'woocommerce-checkout-manager'); ?></a></li>
|
4 |
+
</ul>
|
5 |
<br class="clear" />
|
includes/view/backend/pages/shipping.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php include_once( 'parts/tabs.php' ); ?>
|
2 |
-
<h1 class="screen-reader-text"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></h1>
|
3 |
-
<h2><?php esc_html_e('Shipping fields', 'woocommerce-checkout-manager'); ?></h2>
|
4 |
-
<div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
5 |
-
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
-
</div>
|
7 |
-
<?php include_once( 'parts/actions.php' ); ?>
|
8 |
-
<?php include_once( 'parts/loop.php' ); ?>
|
9 |
<?php include_once( 'modals/field.php' ); ?>
|
1 |
+
<?php include_once( 'parts/tabs.php' ); ?>
|
2 |
+
<h1 class="screen-reader-text"><?php esc_html_e('Shipping', 'woocommerce-checkout-manager'); ?></h1>
|
3 |
+
<h2><?php esc_html_e('Shipping fields', 'woocommerce-checkout-manager'); ?></h2>
|
4 |
+
<div id="<?php printf('wooccm_%s_settings-description', $current_section); ?>">
|
5 |
+
<p><?php printf(esc_html__('Customize and manage the checkout %s fields.', 'woocommerce-checkout-manager'), $current_section); ?></p>
|
6 |
+
</div>
|
7 |
+
<?php include_once( 'parts/actions.php' ); ?>
|
8 |
+
<?php include_once( 'parts/loop.php' ); ?>
|
9 |
<?php include_once( 'modals/field.php' ); ?>
|
includes/view/frontend/class-wooccm-fields-handler.php
CHANGED
@@ -1,255 +1,255 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WOOCCM_Fields_Handler {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
public function posted_data($data) {
|
19 |
-
|
20 |
-
if (count($fields = WC()->session->wooccm['fields'])) {
|
21 |
-
|
22 |
-
foreach ($fields as $key => $field) {
|
23 |
-
|
24 |
-
switch ($field['type']) {
|
25 |
-
|
26 |
-
case 'multicheckbox':
|
27 |
-
|
28 |
-
$data[$key] = isset($_POST[$key]) ? implode(', ', wc_clean(wp_unslash($_POST[$key]))) : '';
|
29 |
-
|
30 |
-
break;
|
31 |
-
|
32 |
-
case 'checkbox':
|
33 |
-
|
34 |
-
if (!empty($_POST[$key])) {
|
35 |
-
$data[$key] = __('Yes', 'woocommerce-checkout-manager');
|
36 |
-
}
|
37 |
-
|
38 |
-
// else {
|
39 |
-
// $data[$key] = __('No', 'woocommerce-checkout-manager');
|
40 |
-
// }
|
41 |
-
|
42 |
-
break;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
return $data;
|
48 |
-
}
|
49 |
-
|
50 |
-
public function add_field_filter($field) {
|
51 |
-
|
52 |
-
if (isset(WC()->session)) {
|
53 |
-
$session_data = WC()->session->wooccm;
|
54 |
-
}
|
55 |
-
|
56 |
-
// keep attr id = attr name
|
57 |
-
// -------------------------------------------------------------------------
|
58 |
-
unset($field['id']);
|
59 |
-
|
60 |
-
switch ($field['type']) {
|
61 |
-
|
62 |
-
case 'select':
|
63 |
-
case 'radio':
|
64 |
-
|
65 |
-
if (!empty($field['options'])) {
|
66 |
-
if (is_array($field['options'])) {
|
67 |
-
$field['add_price_total'] = array_column($field['options'], 'add_price_total');
|
68 |
-
$field['add_price_type'] = array_column($field['options'], 'add_price_type');
|
69 |
-
$field['add_price_tax'] = array_column($field['options'], 'add_price_tax');
|
70 |
-
$field['options'] = array_column($field['options'], 'label');
|
71 |
-
}
|
72 |
-
} else {
|
73 |
-
$field['disabled'] = true;
|
74 |
-
}
|
75 |
-
|
76 |
-
break;
|
77 |
-
|
78 |
-
case 'multiselect':
|
79 |
-
case 'multicheckbox':
|
80 |
-
|
81 |
-
if (!empty($field['options'])) {
|
82 |
-
if (is_array($field['options'])) {
|
83 |
-
$field['add_price_total'] = array_column($field['options'], 'add_price_total');
|
84 |
-
$field['add_price_type'] = array_column($field['options'], 'add_price_type');
|
85 |
-
$field['add_price_tax'] = array_column($field['options'], 'add_price_tax');
|
86 |
-
$field['default'] = array_column($field['options'], 'default');
|
87 |
-
$field['options'] = array_column($field['options'], 'label');
|
88 |
-
}
|
89 |
-
} else {
|
90 |
-
$field['disabled'] = true;
|
91 |
-
}
|
92 |
-
|
93 |
-
break;
|
94 |
-
|
95 |
-
case 'heading':
|
96 |
-
$field['required'] = false;
|
97 |
-
break;
|
98 |
-
}
|
99 |
-
|
100 |
-
// Priority
|
101 |
-
// -----------------------------------------------------------------------
|
102 |
-
if (isset($field['order'])) {
|
103 |
-
$field['priority'] = $field['order'] * 10;
|
104 |
-
}
|
105 |
-
|
106 |
-
if (isset(WC()->session)) {
|
107 |
-
$session_data['fields'][$field['key']] = $field;
|
108 |
-
WC()->session->wooccm = $session_data;
|
109 |
-
}
|
110 |
-
|
111 |
-
return $field;
|
112 |
-
}
|
113 |
-
|
114 |
-
public function add_field_classes($field) {
|
115 |
-
|
116 |
-
// Position
|
117 |
-
// -----------------------------------------------------------------------
|
118 |
-
if (!empty($field['position'])) {
|
119 |
-
$field['class'] = array_diff($field['class'], array('form-row-wide', 'form-row-first', 'form-row-last'));
|
120 |
-
$field['class'][] = $field['position'];
|
121 |
-
}
|
122 |
-
|
123 |
-
// WOOCCM
|
124 |
-
// -----------------------------------------------------------------------
|
125 |
-
|
126 |
-
$field['class'][] = 'wooccm-field';
|
127 |
-
$field['class'][] = 'wooccm-field-' . $field['name'];
|
128 |
-
|
129 |
-
// Type
|
130 |
-
// -----------------------------------------------------------------------
|
131 |
-
if (!empty($field['type'])) {
|
132 |
-
$field['class'][] = 'wooccm-type-' . $field['type'];
|
133 |
-
}
|
134 |
-
|
135 |
-
// Color
|
136 |
-
// -----------------------------------------------------------------------
|
137 |
-
if (!empty($field['type']) && $field['type'] == 'colorpicker') {
|
138 |
-
$field['class'][] = 'wooccm-colorpicker-' . $field['pickertype'];
|
139 |
-
}
|
140 |
-
|
141 |
-
// Extra
|
142 |
-
// -----------------------------------------------------------------------
|
143 |
-
if (!empty($field['extra_class'])) {
|
144 |
-
$field['class'][] = $field['extra_class'];
|
145 |
-
}
|
146 |
-
|
147 |
-
// Clearfix
|
148 |
-
// -----------------------------------------------------------------------
|
149 |
-
if (!empty($field['clear'])) {
|
150 |
-
$field['class'][] = 'wooccm-clearfix';
|
151 |
-
}
|
152 |
-
|
153 |
-
// Required
|
154 |
-
// -----------------------------------------------------------------------
|
155 |
-
|
156 |
-
if (isset($field['required'])) {
|
157 |
-
|
158 |
-
$required = (int) $field['required'];
|
159 |
-
|
160 |
-
$field['custom_attributes']['data-required'] = $required;
|
161 |
-
|
162 |
-
if ($required) {
|
163 |
-
$field['input_class'][] = 'wooccm-required-field';
|
164 |
-
}
|
165 |
-
}
|
166 |
-
|
167 |
-
return $field;
|
168 |
-
}
|
169 |
-
|
170 |
-
public function remove_checkout_fields($fields) {
|
171 |
-
|
172 |
-
foreach ($fields as $key => $type) {
|
173 |
-
|
174 |
-
foreach ($type as $field_id => $field) {
|
175 |
-
|
176 |
-
// Remove disabled
|
177 |
-
// -------------------------------------------------------------------
|
178 |
-
if (!empty($field['disabled'])) {
|
179 |
-
unset($fields[$key][$field_id]);
|
180 |
-
}
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
// Fix for required address field
|
185 |
-
if (get_option('woocommerce_ship_to_destination') == 'billing_only') {
|
186 |
-
unset($fields['shipping']);
|
187 |
-
}
|
188 |
-
|
189 |
-
return $fields;
|
190 |
-
}
|
191 |
-
|
192 |
-
//function woocommerce_checkout_address_2_field($option) {
|
193 |
-
// return 'required';
|
194 |
-
//}
|
195 |
-
|
196 |
-
public function remove_fields_priority($fields) {
|
197 |
-
|
198 |
-
foreach ($fields as $key => $field) {
|
199 |
-
unset($fields[$key]['label']);
|
200 |
-
unset($fields[$key]['placeholder']);
|
201 |
-
unset($fields[$key]['priority']);
|
202 |
-
unset($fields[$key]['required']);
|
203 |
-
}
|
204 |
-
|
205 |
-
return $fields;
|
206 |
-
}
|
207 |
-
|
208 |
-
public function remove_address_fields($data) {
|
209 |
-
|
210 |
-
$remove = array(
|
211 |
-
'shipping_country',
|
212 |
-
'shipping_address_1',
|
213 |
-
'shipping_city',
|
214 |
-
'shipping_state',
|
215 |
-
'shipping_postcode'
|
216 |
-
);
|
217 |
-
|
218 |
-
foreach ($remove as $key) {
|
219 |
-
if (empty($data[$key])) {
|
220 |
-
unset($data[$key]);
|
221 |
-
}
|
222 |
-
}
|
223 |
-
|
224 |
-
return $data;
|
225 |
-
}
|
226 |
-
|
227 |
-
public function init() {
|
228 |
-
// Prepare
|
229 |
-
add_filter('wooccm_checkout_field_filter', array($this, 'add_field_filter'));
|
230 |
-
|
231 |
-
// Add field classes
|
232 |
-
add_filter('wooccm_checkout_field_filter', array($this, 'add_field_classes'));
|
233 |
-
|
234 |
-
// Remove fields
|
235 |
-
// -----------------------------------------------------------------------
|
236 |
-
add_filter('woocommerce_checkout_fields', array($this, 'remove_checkout_fields'));
|
237 |
-
|
238 |
-
// Fix address_2 field
|
239 |
-
// -----------------------------------------------------------------------
|
240 |
-
//add_filter('default_option_woocommerce_checkout_address_2_field', array($this, 'woocommerce_checkout_address_2_field'));
|
241 |
-
// Fix address fields priority, required, placeholder, label
|
242 |
-
// add_filter('woocommerce_get_country_locale', '__return_empty_array');
|
243 |
-
add_filter('woocommerce_get_country_locale_default', array($this, 'remove_fields_priority'));
|
244 |
-
add_filter('woocommerce_get_country_locale_base', array($this, 'remove_fields_priority'));
|
245 |
-
// Fix required country notice when shipping address is activated
|
246 |
-
// -----------------------------------------------------------------------
|
247 |
-
add_filter('woocommerce_checkout_posted_data', array($this, 'remove_address_fields'));
|
248 |
-
|
249 |
-
// Clear session
|
250 |
-
add_action('woocommerce_checkout_posted_data', array($this, 'posted_data'));
|
251 |
-
}
|
252 |
-
|
253 |
-
}
|
254 |
-
|
255 |
-
WOOCCM_Fields_Handler::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WOOCCM_Fields_Handler {
|
4 |
+
|
5 |
+
protected static $_instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
$this->init();
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (is_null(self::$_instance)) {
|
13 |
+
self::$_instance = new self();
|
14 |
+
}
|
15 |
+
return self::$_instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function posted_data($data) {
|
19 |
+
|
20 |
+
if (count($fields = WC()->session->wooccm['fields'])) {
|
21 |
+
|
22 |
+
foreach ($fields as $key => $field) {
|
23 |
+
|
24 |
+
switch ($field['type']) {
|
25 |
+
|
26 |
+
case 'multicheckbox':
|
27 |
+
|
28 |
+
$data[$key] = isset($_POST[$key]) ? implode(', ', wc_clean(wp_unslash($_POST[$key]))) : '';
|
29 |
+
|
30 |
+
break;
|
31 |
+
|
32 |
+
case 'checkbox':
|
33 |
+
|
34 |
+
if (!empty($_POST[$key])) {
|
35 |
+
$data[$key] = __('Yes', 'woocommerce-checkout-manager');
|
36 |
+
}
|
37 |
+
|
38 |
+
// else {
|
39 |
+
// $data[$key] = __('No', 'woocommerce-checkout-manager');
|
40 |
+
// }
|
41 |
+
|
42 |
+
break;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
return $data;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function add_field_filter($field) {
|
51 |
+
|
52 |
+
if (isset(WC()->session)) {
|
53 |
+
$session_data = WC()->session->wooccm;
|
54 |
+
}
|
55 |
+
|
56 |
+
// keep attr id = attr name
|
57 |
+
// -------------------------------------------------------------------------
|
58 |
+
unset($field['id']);
|
59 |
+
|
60 |
+
switch ($field['type']) {
|
61 |
+
|
62 |
+
case 'select':
|
63 |
+
case 'radio':
|
64 |
+
|
65 |
+
if (!empty($field['options'])) {
|
66 |
+
if (is_array($field['options'])) {
|
67 |
+
$field['add_price_total'] = array_column($field['options'], 'add_price_total');
|
68 |
+
$field['add_price_type'] = array_column($field['options'], 'add_price_type');
|
69 |
+
$field['add_price_tax'] = array_column($field['options'], 'add_price_tax');
|
70 |
+
$field['options'] = array_column($field['options'], 'label');
|
71 |
+
}
|
72 |
+
} else {
|
73 |
+
$field['disabled'] = true;
|
74 |
+
}
|
75 |
+
|
76 |
+
break;
|
77 |
+
|
78 |
+
case 'multiselect':
|
79 |
+
case 'multicheckbox':
|
80 |
+
|
81 |
+
if (!empty($field['options'])) {
|
82 |
+
if (is_array($field['options'])) {
|
83 |
+
$field['add_price_total'] = array_column($field['options'], 'add_price_total');
|
84 |
+
$field['add_price_type'] = array_column($field['options'], 'add_price_type');
|
85 |
+
$field['add_price_tax'] = array_column($field['options'], 'add_price_tax');
|
86 |
+
$field['default'] = array_column($field['options'], 'default');
|
87 |
+
$field['options'] = array_column($field['options'], 'label');
|
88 |
+
}
|
89 |
+
} else {
|
90 |
+
$field['disabled'] = true;
|
91 |
+
}
|
92 |
+
|
93 |
+
break;
|
94 |
+
|
95 |
+
case 'heading':
|
96 |
+
$field['required'] = false;
|
97 |
+
break;
|
98 |
+
}
|
99 |
+
|
100 |
+
// Priority
|
101 |
+
// -----------------------------------------------------------------------
|
102 |
+
if (isset($field['order'])) {
|
103 |
+
$field['priority'] = $field['order'] * 10;
|
104 |
+
}
|
105 |
+
|
106 |
+
if (isset(WC()->session)) {
|
107 |
+
$session_data['fields'][$field['key']] = $field;
|
108 |
+
WC()->session->wooccm = $session_data;
|
109 |
+
}
|
110 |
+
|
111 |
+
return $field;
|
112 |
+
}
|
113 |
+
|
114 |
+
public function add_field_classes($field) {
|
115 |
+
|
116 |
+
// Position
|
117 |
+
// -----------------------------------------------------------------------
|
118 |
+
if (!empty($field['position'])) {
|
119 |
+
$field['class'] = array_diff($field['class'], array('form-row-wide', 'form-row-first', 'form-row-last'));
|
120 |
+
$field['class'][] = $field['position'];
|
121 |
+
}
|
122 |
+
|
123 |
+
// WOOCCM
|
124 |
+
// -----------------------------------------------------------------------
|
125 |
+
|
126 |
+
$field['class'][] = 'wooccm-field';
|
127 |
+
$field['class'][] = 'wooccm-field-' . $field['name'];
|
128 |
+
|
129 |
+
// Type
|
130 |
+
// -----------------------------------------------------------------------
|
131 |
+
if (!empty($field['type'])) {
|
132 |
+
$field['class'][] = 'wooccm-type-' . $field['type'];
|
133 |
+
}
|
134 |
+
|
135 |
+
// Color
|
136 |
+
// -----------------------------------------------------------------------
|
137 |
+
if (!empty($field['type']) && $field['type'] == 'colorpicker') {
|
138 |
+
$field['class'][] = 'wooccm-colorpicker-' . $field['pickertype'];
|
139 |
+
}
|
140 |
+
|
141 |
+
// Extra
|
142 |
+
// -----------------------------------------------------------------------
|
143 |
+
if (!empty($field['extra_class'])) {
|
144 |
+
$field['class'][] = $field['extra_class'];
|
145 |
+
}
|
146 |
+
|
147 |
+
// Clearfix
|
148 |
+
// -----------------------------------------------------------------------
|
149 |
+
if (!empty($field['clear'])) {
|
150 |
+
$field['class'][] = 'wooccm-clearfix';
|
151 |
+
}
|
152 |
+
|
153 |
+
// Required
|
154 |
+
// -----------------------------------------------------------------------
|
155 |
+
|
156 |
+
if (isset($field['required'])) {
|
157 |
+
|
158 |
+
$required = (int) $field['required'];
|
159 |
+
|
160 |
+
$field['custom_attributes']['data-required'] = $required;
|
161 |
+
|
162 |
+
if ($required) {
|
163 |
+
$field['input_class'][] = 'wooccm-required-field';
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
return $field;
|
168 |
+
}
|
169 |
+
|
170 |
+
public function remove_checkout_fields($fields) {
|
171 |
+
|
172 |
+
foreach ($fields as $key => $type) {
|
173 |
+
|
174 |
+
foreach ($type as $field_id => $field) {
|
175 |
+
|
176 |
+
// Remove disabled
|
177 |
+
// -------------------------------------------------------------------
|
178 |
+
if (!empty($field['disabled'])) {
|
179 |
+
unset($fields[$key][$field_id]);
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
// Fix for required address field
|
185 |
+
if (get_option('woocommerce_ship_to_destination') == 'billing_only') {
|
186 |
+
unset($fields['shipping']);
|
187 |
+
}
|
188 |
+
|
189 |
+
return $fields;
|
190 |
+
}
|
191 |
+
|
192 |
+
//function woocommerce_checkout_address_2_field($option) {
|
193 |
+
// return 'required';
|
194 |
+
//}
|
195 |
+
|
196 |
+
public function remove_fields_priority($fields) {
|
197 |
+
|
198 |
+
foreach ($fields as $key => $field) {
|
199 |
+
unset($fields[$key]['label']);
|
200 |
+
unset($fields[$key]['placeholder']);
|
201 |
+
unset($fields[$key]['priority']);
|
202 |
+
unset($fields[$key]['required']);
|
203 |
+
}
|
204 |
+
|
205 |
+
return $fields;
|
206 |
+
}
|
207 |
+
|
208 |
+
public function remove_address_fields($data) {
|
209 |
+
|
210 |
+
$remove = array(
|
211 |
+
'shipping_country',
|
212 |
+
'shipping_address_1',
|
213 |
+
'shipping_city',
|
214 |
+
'shipping_state',
|
215 |
+
'shipping_postcode'
|
216 |
+
);
|
217 |
+
|
218 |
+
foreach ($remove as $key) {
|
219 |
+
if (empty($data[$key])) {
|
220 |
+
unset($data[$key]);
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
return $data;
|
225 |
+
}
|
226 |
+
|
227 |
+
public function init() {
|
228 |
+
// Prepare
|
229 |
+
add_filter('wooccm_checkout_field_filter', array($this, 'add_field_filter'));
|
230 |
+
|
231 |
+
// Add field classes
|
232 |
+
add_filter('wooccm_checkout_field_filter', array($this, 'add_field_classes'));
|
233 |
+
|
234 |
+
// Remove fields
|
235 |
+
// -----------------------------------------------------------------------
|
236 |
+
add_filter('woocommerce_checkout_fields', array($this, 'remove_checkout_fields'));
|
237 |
+
|
238 |
+
// Fix address_2 field
|
239 |
+
// -----------------------------------------------------------------------
|
240 |
+
//add_filter('default_option_woocommerce_checkout_address_2_field', array($this, 'woocommerce_checkout_address_2_field'));
|
241 |
+
// Fix address fields priority, required, placeholder, label
|
242 |
+
// add_filter('woocommerce_get_country_locale', '__return_empty_array');
|
243 |
+
add_filter('woocommerce_get_country_locale_default', array($this, 'remove_fields_priority'));
|
244 |
+
add_filter('woocommerce_get_country_locale_base', array($this, 'remove_fields_priority'));
|
245 |
+
// Fix required country notice when shipping address is activated
|
246 |
+
// -----------------------------------------------------------------------
|
247 |
+
add_filter('woocommerce_checkout_posted_data', array($this, 'remove_address_fields'));
|
248 |
+
|
249 |
+
// Clear session
|
250 |
+
add_action('woocommerce_checkout_posted_data', array($this, 'posted_data'));
|
251 |
+
}
|
252 |
+
|
253 |
+
}
|
254 |
+
|
255 |
+
WOOCCM_Fields_Handler::instance();
|
languages/woocommerce-checkout-manager.pot
CHANGED
@@ -1,1219 +1,1219 @@
|
|
1 |
-
#, fuzzy
|
2 |
-
msgid ""
|
3 |
-
msgstr ""
|
4 |
-
"Project-Id-Version: WooCommerce Checkout Manager\n"
|
5 |
-
"POT-Creation-Date: 2019-12-17 15:21-0300\n"
|
6 |
-
"PO-Revision-Date: 2019-12-17 15:21-0300\n"
|
7 |
-
"Last-Translator: \n"
|
8 |
-
"Language-Team: \n"
|
9 |
-
"MIME-Version: 1.0\n"
|
10 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
-
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.8.1\n"
|
13 |
-
"X-Poedit-Basepath: ..\n"
|
14 |
-
"X-Poedit-WPHeader: woocommerce-checkout-manager.php\n"
|
15 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
-
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
17 |
-
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
18 |
-
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
19 |
-
"X-Poedit-SearchPath-0: .\n"
|
20 |
-
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
21 |
-
|
22 |
-
#: includes/class-wooccm-admin.php:55
|
23 |
-
#, php-format
|
24 |
-
msgid "Stock: %d"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: includes/class-wooccm-admin.php:84 includes/class-wooccm-admin.php:89
|
28 |
-
#: includes/controller/class-wooccm-checkout.php:242
|
29 |
-
#: includes/view/backend/pages/checkout.php:2
|
30 |
-
msgid "Checkout"
|
31 |
-
msgstr ""
|
32 |
-
|
33 |
-
#: includes/class-wooccm-notices.php:71 includes/class-wooccm-notices.php:98
|
34 |
-
msgid "Join Community!"
|
35 |
-
msgstr ""
|
36 |
-
|
37 |
-
#: includes/class-wooccm-notices.php:74 includes/class-wooccm-notices.php:101
|
38 |
-
msgid "Report a bug"
|
39 |
-
msgstr ""
|
40 |
-
|
41 |
-
#: includes/class-wooccm-notices.php:77 includes/class-wooccm-notices.php:104
|
42 |
-
msgid "About us"
|
43 |
-
msgstr ""
|
44 |
-
|
45 |
-
#: includes/class-wooccm-notices.php:93
|
46 |
-
msgid "Hello! We've recently acquired this plugin!"
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: includes/class-wooccm-notices.php:95
|
50 |
-
msgid ""
|
51 |
-
"We will do our best to improve it and include new features gradually. Please "
|
52 |
-
"be patient and let us know about the issues and improvements that you want "
|
53 |
-
"to see in this plugin."
|
54 |
-
msgstr ""
|
55 |
-
|
56 |
-
#: includes/class-wooccm-notices.php:136
|
57 |
-
#: includes/controller/class-wooccm-premium.php:40
|
58 |
-
#: includes/view/backend/pages/parts/tabs.php:4
|
59 |
-
#: includes/view/backend/pages/premium.php:6
|
60 |
-
msgid "Premium"
|
61 |
-
msgstr ""
|
62 |
-
|
63 |
-
#: includes/class-wooccm-notices.php:137
|
64 |
-
msgid "Settings"
|
65 |
-
msgstr ""
|
66 |
-
|
67 |
-
#: includes/class-wooccm-suggestions-list-table.php:109
|
68 |
-
msgid "Search Results"
|
69 |
-
msgstr ""
|
70 |
-
|
71 |
-
#: includes/class-wooccm-suggestions-list-table.php:112
|
72 |
-
msgctxt "Plugin Installer"
|
73 |
-
msgid "Beta Testing"
|
74 |
-
msgstr ""
|
75 |
-
|
76 |
-
#: includes/class-wooccm-suggestions-list-table.php:114
|
77 |
-
msgctxt "Plugin Installer"
|
78 |
-
msgid "Featured"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: includes/class-wooccm-suggestions-list-table.php:115
|
82 |
-
msgctxt "Plugin Installer"
|
83 |
-
msgid "Popular"
|
84 |
-
msgstr ""
|
85 |
-
|
86 |
-
#: includes/class-wooccm-suggestions-list-table.php:116
|
87 |
-
msgctxt "Plugin Installer"
|
88 |
-
msgid "Recommended"
|
89 |
-
msgstr ""
|
90 |
-
|
91 |
-
#: includes/class-wooccm-suggestions-list-table.php:117
|
92 |
-
msgctxt "Plugin Installer"
|
93 |
-
msgid "Favorites"
|
94 |
-
msgstr ""
|
95 |
-
|
96 |
-
#: includes/class-wooccm-upload.php:66
|
97 |
-
msgid "No attachment selected."
|
98 |
-
msgstr ""
|
99 |
-
|
100 |
-
#: includes/class-wooccm-upload.php:103
|
101 |
-
#: includes/controller/class-wooccm-order.php:48
|
102 |
-
msgid "No uploads were recognised. Files were not uploaded."
|
103 |
-
msgstr ""
|
104 |
-
|
105 |
-
#: includes/class-wooccm-upload.php:110
|
106 |
-
#: includes/controller/class-wooccm-order.php:103
|
107 |
-
msgid "Unknow error."
|
108 |
-
msgstr ""
|
109 |
-
|
110 |
-
#: includes/class-wooccm.php:77 includes/class-wooccm.php:108
|
111 |
-
msgid "Uploading, please wait..."
|
112 |
-
msgstr ""
|
113 |
-
|
114 |
-
#: includes/class-wooccm.php:78 includes/class-wooccm.php:109
|
115 |
-
msgid "Saving, please wait..."
|
116 |
-
msgstr ""
|
117 |
-
|
118 |
-
#: includes/class-wooccm.php:79 includes/class-wooccm.php:110
|
119 |
-
msgid "Files uploaded successfully."
|
120 |
-
msgstr ""
|
121 |
-
|
122 |
-
#: includes/class-wooccm.php:80 includes/class-wooccm.php:111
|
123 |
-
msgid "Deleted successfully."
|
124 |
-
msgstr ""
|
125 |
-
|
126 |
-
#: includes/class-wooccm.php:91 includes/view/backend/pages/parts/loop.php:11
|
127 |
-
msgid "Clear"
|
128 |
-
msgstr ""
|
129 |
-
|
130 |
-
#: includes/class-wooccm.php:92
|
131 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:64
|
132 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:96
|
133 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:23
|
134 |
-
msgid "Default"
|
135 |
-
msgstr ""
|
136 |
-
|
137 |
-
#: includes/class-wooccm.php:93
|
138 |
-
msgid "Select Color"
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
#: includes/class-wooccm.php:94
|
142 |
-
msgid "Current Color"
|
143 |
-
msgstr ""
|
144 |
-
|
145 |
-
#: includes/controller/class-wooccm-advanced.php:49
|
146 |
-
msgid "Custom CSS"
|
147 |
-
msgstr ""
|
148 |
-
|
149 |
-
#: includes/controller/class-wooccm-advanced.php:50
|
150 |
-
msgid "Add custom stylesheets to the checkout page."
|
151 |
-
msgstr ""
|
152 |
-
|
153 |
-
#: includes/controller/class-wooccm-advanced.php:68
|
154 |
-
#: includes/view/backend/pages/advanced.php:2
|
155 |
-
msgid "Advanced"
|
156 |
-
msgstr ""
|
157 |
-
|
158 |
-
#: includes/controller/class-wooccm-checkout.php:132
|
159 |
-
msgid "Force shipping address"
|
160 |
-
msgstr ""
|
161 |
-
|
162 |
-
#: includes/controller/class-wooccm-checkout.php:133
|
163 |
-
msgid "Force show shipping checkout fields."
|
164 |
-
msgstr ""
|
165 |
-
|
166 |
-
#: includes/controller/class-wooccm-checkout.php:138
|
167 |
-
#: includes/controller/class-wooccm-checkout.php:150
|
168 |
-
#: includes/controller/class-wooccm-checkout.php:162
|
169 |
-
#: includes/controller/class-wooccm-email.php:34
|
170 |
-
#: includes/controller/class-wooccm-order.php:181
|
171 |
-
#: includes/controller/class-wooccm-order.php:209
|
172 |
-
#: includes/view/backend/pages/modals/parts/info.php:53
|
173 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:67
|
174 |
-
#: includes/view/backend/pages/parts/loop.php:38
|
175 |
-
#: includes/view/backend/pages/parts/loop.php:56
|
176 |
-
#: includes/view/backend/pages/parts/loop.php:76
|
177 |
-
#: includes/view/backend/pages/parts/loop.php:78
|
178 |
-
#: includes/view/backend/pages/parts/loop.php:85
|
179 |
-
#: includes/view/backend/pages/parts/loop.php:87
|
180 |
-
#: includes/view/backend/pages/parts/loop.php:94
|
181 |
-
#: includes/view/backend/pages/parts/loop.php:96
|
182 |
-
#: includes/view/backend/pages/parts/loop.php:103
|
183 |
-
msgid "Yes"
|
184 |
-
msgstr ""
|
185 |
-
|
186 |
-
#: includes/controller/class-wooccm-checkout.php:139
|
187 |
-
#: includes/controller/class-wooccm-checkout.php:151
|
188 |
-
#: includes/controller/class-wooccm-checkout.php:163
|
189 |
-
#: includes/controller/class-wooccm-email.php:35
|
190 |
-
#: includes/controller/class-wooccm-order.php:182
|
191 |
-
#: includes/controller/class-wooccm-order.php:210
|
192 |
-
#: includes/view/backend/pages/modals/parts/info.php:54
|
193 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:68
|
194 |
-
#: includes/view/backend/pages/parts/loop.php:40
|
195 |
-
#: includes/view/backend/pages/parts/loop.php:58
|
196 |
-
#: includes/view/backend/pages/parts/loop.php:105
|
197 |
-
msgid "No"
|
198 |
-
msgstr ""
|
199 |
-
|
200 |
-
#: includes/controller/class-wooccm-checkout.php:144
|
201 |
-
msgid "Force create an account"
|
202 |
-
msgstr ""
|
203 |
-
|
204 |
-
#: includes/controller/class-wooccm-checkout.php:145
|
205 |
-
msgid "Force create an account for guests users."
|
206 |
-
msgstr ""
|
207 |
-
|
208 |
-
#: includes/controller/class-wooccm-checkout.php:156
|
209 |
-
msgid "Remove order notes"
|
210 |
-
msgstr ""
|
211 |
-
|
212 |
-
#: includes/controller/class-wooccm-checkout.php:157
|
213 |
-
msgid "Remove order notes from checkout page."
|
214 |
-
msgstr ""
|
215 |
-
|
216 |
-
#: includes/controller/class-wooccm-checkout.php:168
|
217 |
-
msgid "Order notes label"
|
218 |
-
msgstr ""
|
219 |
-
|
220 |
-
#: includes/controller/class-wooccm-checkout.php:169
|
221 |
-
#: includes/controller/class-wooccm-checkout.php:176
|
222 |
-
#: includes/controller/class-wooccm-checkout.php:183
|
223 |
-
#: includes/controller/class-wooccm-checkout.php:190
|
224 |
-
msgid "Add custom title for the custom fields table in the thankyou page."
|
225 |
-
msgstr ""
|
226 |
-
|
227 |
-
#: includes/controller/class-wooccm-checkout.php:172
|
228 |
-
msgid "Order notes"
|
229 |
-
msgstr ""
|
230 |
-
|
231 |
-
#: includes/controller/class-wooccm-checkout.php:175
|
232 |
-
msgid "Order notes placeholder"
|
233 |
-
msgstr ""
|
234 |
-
|
235 |
-
#: includes/controller/class-wooccm-checkout.php:179
|
236 |
-
msgid "Notes about your order, e.g. special notes for delivery."
|
237 |
-
msgstr ""
|
238 |
-
|
239 |
-
#: includes/controller/class-wooccm-checkout.php:182
|
240 |
-
msgid "Add message before checkout"
|
241 |
-
msgstr ""
|
242 |
-
|
243 |
-
#: includes/controller/class-wooccm-checkout.php:189
|
244 |
-
msgid "Add message after checkout"
|
245 |
-
msgstr ""
|
246 |
-
|
247 |
-
#: includes/controller/class-wooccm-email.php:28
|
248 |
-
#: includes/controller/class-wooccm-order.php:203
|
249 |
-
msgid "Add custom fields"
|
250 |
-
msgstr ""
|
251 |
-
|
252 |
-
#: includes/controller/class-wooccm-email.php:29
|
253 |
-
#: includes/controller/class-wooccm-order.php:204
|
254 |
-
msgid "Show the selected fields in the order."
|
255 |
-
msgstr ""
|
256 |
-
|
257 |
-
#: includes/controller/class-wooccm-email.php:40
|
258 |
-
#: includes/controller/class-wooccm-order.php:187
|
259 |
-
#: includes/controller/class-wooccm-order.php:215
|
260 |
-
msgid "Add for this order status"
|
261 |
-
msgstr ""
|
262 |
-
|
263 |
-
#: includes/controller/class-wooccm-email.php:41
|
264 |
-
#: includes/controller/class-wooccm-order.php:176
|
265 |
-
#: includes/controller/class-wooccm-order.php:188
|
266 |
-
#: includes/controller/class-wooccm-order.php:216
|
267 |
-
msgid "Allow customers to upload files in the order."
|
268 |
-
msgstr ""
|
269 |
-
|
270 |
-
#: includes/controller/class-wooccm-email.php:49
|
271 |
-
#: includes/controller/class-wooccm-order.php:224
|
272 |
-
msgid "Add custom fields title"
|
273 |
-
msgstr ""
|
274 |
-
|
275 |
-
#: includes/controller/class-wooccm-email.php:50
|
276 |
-
#: includes/controller/class-wooccm-order.php:197
|
277 |
-
#: includes/controller/class-wooccm-order.php:225
|
278 |
-
msgid "Add custom title for the uploads files table."
|
279 |
-
msgstr ""
|
280 |
-
|
281 |
-
#: includes/controller/class-wooccm-email.php:54
|
282 |
-
#: includes/controller/class-wooccm-order.php:228
|
283 |
-
msgid "Order extra"
|
284 |
-
msgstr ""
|
285 |
-
|
286 |
-
#: includes/controller/class-wooccm-email.php:66
|
287 |
-
#: includes/view/backend/pages/email.php:2
|
288 |
-
msgid "Email"
|
289 |
-
msgstr ""
|
290 |
-
|
291 |
-
#: includes/controller/class-wooccm-field.php:33
|
292 |
-
msgid "Are you sure you want to remove this field?"
|
293 |
-
msgstr ""
|
294 |
-
|
295 |
-
#: includes/controller/class-wooccm-field.php:34
|
296 |
-
msgid "Are you sure you want to reset this fields?"
|
297 |
-
msgstr ""
|
298 |
-
|
299 |
-
#: includes/controller/class-wooccm-field.php:71
|
300 |
-
#: includes/controller/class-wooccm-field.php:98
|
301 |
-
#: includes/controller/class-wooccm-field.php:126
|
302 |
-
#: includes/controller/class-wooccm-field.php:141
|
303 |
-
#: includes/controller/class-wooccm-field.php:161
|
304 |
-
#: includes/controller/class-wooccm-field.php:177
|
305 |
-
msgid "Unknow error"
|
306 |
-
msgstr ""
|
307 |
-
|
308 |
-
#: includes/controller/class-wooccm-field.php:174
|
309 |
-
msgid "Undefined field id"
|
310 |
-
msgstr ""
|
311 |
-
|
312 |
-
#: includes/controller/class-wooccm-field.php:360
|
313 |
-
msgid "Select the position of the additional fields."
|
314 |
-
msgstr ""
|
315 |
-
|
316 |
-
#: includes/controller/class-wooccm-field.php:365
|
317 |
-
msgid "Before billing form"
|
318 |
-
msgstr ""
|
319 |
-
|
320 |
-
#: includes/controller/class-wooccm-field.php:366
|
321 |
-
msgid "After billing form"
|
322 |
-
msgstr ""
|
323 |
-
|
324 |
-
#: includes/controller/class-wooccm-field.php:367
|
325 |
-
msgid "Before order notes"
|
326 |
-
msgstr ""
|
327 |
-
|
328 |
-
#: includes/controller/class-wooccm-field.php:368
|
329 |
-
msgid "After order notes"
|
330 |
-
msgstr ""
|
331 |
-
|
332 |
-
#: includes/controller/class-wooccm-field.php:401
|
333 |
-
#: includes/controller/class-wooccm-field.php:429
|
334 |
-
#: includes/controller/class-wooccm-field.php:477
|
335 |
-
#, php-format
|
336 |
-
msgid "ID: %s | Field Type: %s"
|
337 |
-
msgstr ""
|
338 |
-
|
339 |
-
#: includes/controller/class-wooccm-field.php:401
|
340 |
-
#: includes/controller/class-wooccm-field.php:429
|
341 |
-
#: includes/controller/class-wooccm-field.php:477
|
342 |
-
msgid "Generic"
|
343 |
-
msgstr ""
|
344 |
-
|
345 |
-
#: includes/controller/class-wooccm-field.php:454
|
346 |
-
#: includes/controller/class-wooccm-field.php:531
|
347 |
-
#: includes/view/backend/pages/additional.php:2
|
348 |
-
msgid "Additional"
|
349 |
-
msgstr ""
|
350 |
-
|
351 |
-
#: includes/controller/class-wooccm-field.php:478
|
352 |
-
#: includes/view/backend/pages/modals/parts/info.php:30
|
353 |
-
#, php-format
|
354 |
-
msgid "Field %s"
|
355 |
-
msgstr ""
|
356 |
-
|
357 |
-
#: includes/controller/class-wooccm-field.php:517
|
358 |
-
#: includes/view/backend/pages/billing.php:2
|
359 |
-
msgid "Billing"
|
360 |
-
msgstr ""
|
361 |
-
|
362 |
-
#: includes/controller/class-wooccm-field.php:524
|
363 |
-
#: includes/view/backend/pages/shipping.php:2
|
364 |
-
msgid "Shipping"
|
365 |
-
msgstr ""
|
366 |
-
|
367 |
-
#: includes/controller/class-wooccm-order.php:54
|
368 |
-
msgid "Empty order id."
|
369 |
-
msgstr ""
|
370 |
-
|
371 |
-
#: includes/controller/class-wooccm-order.php:58
|
372 |
-
msgid "Invalid order id."
|
373 |
-
msgstr ""
|
374 |
-
|
375 |
-
#: includes/controller/class-wooccm-order.php:162
|
376 |
-
msgid "Order Files"
|
377 |
-
msgstr ""
|
378 |
-
|
379 |
-
#: includes/controller/class-wooccm-order.php:175
|
380 |
-
msgid "Add upload files"
|
381 |
-
msgstr ""
|
382 |
-
|
383 |
-
#: includes/controller/class-wooccm-order.php:196
|
384 |
-
msgid "Add upload files title"
|
385 |
-
msgstr ""
|
386 |
-
|
387 |
-
#: includes/controller/class-wooccm-order.php:200
|
388 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:80
|
389 |
-
#: templates/order/order-upload-files.php:2
|
390 |
-
msgid "Upload files"
|
391 |
-
msgstr ""
|
392 |
-
|
393 |
-
#: includes/controller/class-wooccm-order.php:240
|
394 |
-
#: includes/view/backend/pages/order.php:2
|
395 |
-
msgid "Order"
|
396 |
-
msgstr ""
|
397 |
-
|
398 |
-
#: includes/controller/class-wooccm-suggestions.php:27
|
399 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:37
|
400 |
-
#: includes/view/backend/pages/parts/header.php:3
|
401 |
-
msgid "Suggestions"
|
402 |
-
msgstr ""
|
403 |
-
|
404 |
-
#: includes/model/class-wooccm-field.php:134
|
405 |
-
msgid "Option"
|
406 |
-
msgstr ""
|
407 |
-
|
408 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:5
|
409 |
-
#: templates/order/order-upload-files.php:7
|
410 |
-
msgid "Image"
|
411 |
-
msgstr ""
|
412 |
-
|
413 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:6
|
414 |
-
#: templates/order/order-upload-files.php:8
|
415 |
-
msgid "Filename"
|
416 |
-
msgstr ""
|
417 |
-
|
418 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:7
|
419 |
-
#: templates/order/order-upload-files.php:9
|
420 |
-
msgid "Dimensions"
|
421 |
-
msgstr ""
|
422 |
-
|
423 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:8
|
424 |
-
#: templates/order/order-upload-files.php:10
|
425 |
-
msgid "Extension"
|
426 |
-
msgstr ""
|
427 |
-
|
428 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:39
|
429 |
-
#: templates/order/order-upload-files.php:37
|
430 |
-
msgid "Download"
|
431 |
-
msgstr ""
|
432 |
-
|
433 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:40
|
434 |
-
#: includes/view/backend/pages/parts/loop.php:115
|
435 |
-
#: templates/order/order-upload-files.php:38
|
436 |
-
msgid "Delete"
|
437 |
-
msgstr ""
|
438 |
-
|
439 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:46
|
440 |
-
#: templates/order/order-upload-files.php:44
|
441 |
-
msgid "No files have been uploaded to this order."
|
442 |
-
msgstr ""
|
443 |
-
|
444 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:55
|
445 |
-
#: templates/order/order-upload-files.php:53
|
446 |
-
msgid "Upload Files"
|
447 |
-
msgstr ""
|
448 |
-
|
449 |
-
#: includes/view/backend/meta-boxes/html-order-uploads.php:58
|
450 |
-
#: templates/order/order-upload-files.php:56
|
451 |
-
msgid "Save Changes"
|
452 |
-
msgstr ""
|
453 |
-
|
454 |
-
#: includes/view/backend/pages/additional.php:3
|
455 |
-
msgid "Additional fields"
|
456 |
-
msgstr ""
|
457 |
-
|
458 |
-
#: includes/view/backend/pages/additional.php:5
|
459 |
-
#: includes/view/backend/pages/advanced.php:5
|
460 |
-
#: includes/view/backend/pages/billing.php:5
|
461 |
-
#: includes/view/backend/pages/email.php:5
|
462 |
-
#: includes/view/backend/pages/shipping.php:5
|
463 |
-
#, php-format
|
464 |
-
msgid "Customize and manage the checkout %s fields."
|
465 |
-
msgstr ""
|
466 |
-
|
467 |
-
#: includes/view/backend/pages/advanced.php:3
|
468 |
-
msgid "Advanced settings"
|
469 |
-
msgstr ""
|
470 |
-
|
471 |
-
#: includes/view/backend/pages/advanced.php:8
|
472 |
-
msgid ""
|
473 |
-
"This will permanently delete all WordPress Options associated with "
|
474 |
-
"WooCommerce Checkout Manager. Are you sure you want to proceed?"
|
475 |
-
msgstr ""
|
476 |
-
|
477 |
-
#: includes/view/backend/pages/advanced.php:8
|
478 |
-
msgid "Delete Options"
|
479 |
-
msgstr ""
|
480 |
-
|
481 |
-
#: includes/view/backend/pages/advanced.php:9
|
482 |
-
msgid ""
|
483 |
-
"This will permanently delete all WordPress Post meta associated with that is "
|
484 |
-
"linked to Orders. Are you sure you want to proceed?"
|
485 |
-
msgstr ""
|
486 |
-
|
487 |
-
#: includes/view/backend/pages/advanced.php:9
|
488 |
-
msgid "Delete Orders Post meta"
|
489 |
-
msgstr ""
|
490 |
-
|
491 |
-
#: includes/view/backend/pages/advanced.php:10
|
492 |
-
msgid ""
|
493 |
-
"This will permanently delete all WordPress Post meta associated with that is "
|
494 |
-
"linked to Users. Are you sure you want to proceed?"
|
495 |
-
msgstr ""
|
496 |
-
|
497 |
-
#: includes/view/backend/pages/advanced.php:10
|
498 |
-
msgid "Delete Users Post meta"
|
499 |
-
msgstr ""
|
500 |
-
|
501 |
-
#: includes/view/backend/pages/billing.php:3
|
502 |
-
msgid "Billing fields"
|
503 |
-
msgstr ""
|
504 |
-
|
505 |
-
#: includes/view/backend/pages/checkout.php:3
|
506 |
-
msgid "Checkout settings"
|
507 |
-
msgstr ""
|
508 |
-
|
509 |
-
#: includes/view/backend/pages/checkout.php:5
|
510 |
-
msgid "Customize and manage the checkout settings."
|
511 |
-
msgstr ""
|
512 |
-
|
513 |
-
#: includes/view/backend/pages/email.php:3
|
514 |
-
msgid "Email settings"
|
515 |
-
msgstr ""
|
516 |
-
|
517 |
-
#: includes/view/backend/pages/modals/parts/info.php:3
|
518 |
-
msgid "Saved."
|
519 |
-
msgstr ""
|
520 |
-
|
521 |
-
#: includes/view/backend/pages/modals/parts/info.php:7
|
522 |
-
msgid "Field id"
|
523 |
-
msgstr ""
|
524 |
-
|
525 |
-
#: includes/view/backend/pages/modals/parts/info.php:8
|
526 |
-
msgid "Field key"
|
527 |
-
msgstr ""
|
528 |
-
|
529 |
-
#: includes/view/backend/pages/modals/parts/info.php:10
|
530 |
-
msgid "Parent type"
|
531 |
-
msgstr ""
|
532 |
-
|
533 |
-
#: includes/view/backend/pages/modals/parts/info.php:17
|
534 |
-
msgid "Conditional"
|
535 |
-
msgstr ""
|
536 |
-
|
537 |
-
#: includes/view/backend/pages/modals/parts/info.php:19
|
538 |
-
msgid "Activate conditional field requirement."
|
539 |
-
msgstr ""
|
540 |
-
|
541 |
-
#: includes/view/backend/pages/modals/parts/info.php:24
|
542 |
-
msgid "Parent"
|
543 |
-
msgstr ""
|
544 |
-
|
545 |
-
#: includes/view/backend/pages/modals/parts/info.php:25
|
546 |
-
msgid "Select parent field…"
|
547 |
-
msgstr ""
|
548 |
-
|
549 |
-
#: includes/view/backend/pages/modals/parts/info.php:35
|
550 |
-
msgid "Select conditional parent field."
|
551 |
-
msgstr ""
|
552 |
-
|
553 |
-
#: includes/view/backend/pages/modals/parts/info.php:43
|
554 |
-
msgid "Value"
|
555 |
-
msgstr ""
|
556 |
-
|
557 |
-
#: includes/view/backend/pages/modals/parts/info.php:57
|
558 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:97
|
559 |
-
msgid "Preserve default country…"
|
560 |
-
msgstr ""
|
561 |
-
|
562 |
-
#: includes/view/backend/pages/modals/parts/info.php:66
|
563 |
-
msgid "Conditional parent value"
|
564 |
-
msgstr ""
|
565 |
-
|
566 |
-
#: includes/view/backend/pages/modals/parts/info.php:68
|
567 |
-
msgid "Show field if parent has this value."
|
568 |
-
msgstr ""
|
569 |
-
|
570 |
-
#: includes/view/backend/pages/modals/parts/info.php:74
|
571 |
-
msgid "View checkout page"
|
572 |
-
msgstr ""
|
573 |
-
|
574 |
-
#: includes/view/backend/pages/modals/parts/info.php:75
|
575 |
-
msgid "Get premium version"
|
576 |
-
msgstr ""
|
577 |
-
|
578 |
-
#: includes/view/backend/pages/modals/parts/info.php:76
|
579 |
-
msgid "View documentation"
|
580 |
-
msgstr ""
|
581 |
-
|
582 |
-
#: includes/view/backend/pages/modals/parts/main.php:12
|
583 |
-
msgid "Edit previous media item"
|
584 |
-
msgstr ""
|
585 |
-
|
586 |
-
#: includes/view/backend/pages/modals/parts/main.php:13
|
587 |
-
msgid "Edit next media item"
|
588 |
-
msgstr ""
|
589 |
-
|
590 |
-
#: includes/view/backend/pages/modals/parts/main.php:14
|
591 |
-
msgid "Close dialog"
|
592 |
-
msgstr ""
|
593 |
-
|
594 |
-
#: includes/view/backend/pages/modals/parts/main.php:17
|
595 |
-
msgid "Edit field"
|
596 |
-
msgstr ""
|
597 |
-
|
598 |
-
#: includes/view/backend/pages/modals/parts/main.php:17
|
599 |
-
msgid "New"
|
600 |
-
msgstr ""
|
601 |
-
|
602 |
-
#: includes/view/backend/pages/modals/parts/main.php:39
|
603 |
-
msgid "Save"
|
604 |
-
msgstr ""
|
605 |
-
|
606 |
-
#: includes/view/backend/pages/modals/parts/main.php:45
|
607 |
-
msgid "Close"
|
608 |
-
msgstr ""
|
609 |
-
|
610 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:4
|
611 |
-
#: includes/view/backend/pages/parts/loop.php:15
|
612 |
-
msgid "Listable"
|
613 |
-
msgstr ""
|
614 |
-
|
615 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:6
|
616 |
-
msgid "Display in View Orders screen"
|
617 |
-
msgstr ""
|
618 |
-
|
619 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:7
|
620 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:13
|
621 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:19
|
622 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:9
|
623 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:20
|
624 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:7
|
625 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:17
|
626 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:28
|
627 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:76
|
628 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:82
|
629 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:88
|
630 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:94
|
631 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:6
|
632 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:11
|
633 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:20
|
634 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:27
|
635 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:7
|
636 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:15
|
637 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:21
|
638 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:29
|
639 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:35
|
640 |
-
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:6
|
641 |
-
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:11
|
642 |
-
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:16
|
643 |
-
msgid "This is a premium feature"
|
644 |
-
msgstr ""
|
645 |
-
|
646 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:10
|
647 |
-
#: includes/view/backend/pages/parts/loop.php:16
|
648 |
-
msgid "Sortable"
|
649 |
-
msgstr ""
|
650 |
-
|
651 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:12
|
652 |
-
msgid "Allow Sorting on View Orders screen"
|
653 |
-
msgstr ""
|
654 |
-
|
655 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:16
|
656 |
-
#: includes/view/backend/pages/parts/loop.php:17
|
657 |
-
msgid "Filterable"
|
658 |
-
msgstr ""
|
659 |
-
|
660 |
-
#: includes/view/backend/pages/modals/parts/panel-admin.php:18
|
661 |
-
msgid "Allow Filtering on View Orders screen"
|
662 |
-
msgstr ""
|
663 |
-
|
664 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:4
|
665 |
-
msgid "Between days"
|
666 |
-
msgstr ""
|
667 |
-
|
668 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:15
|
669 |
-
msgid "Between dates"
|
670 |
-
msgstr ""
|
671 |
-
|
672 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:17
|
673 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:18
|
674 |
-
msgid "From… YYYY-MM-DD"
|
675 |
-
msgstr ""
|
676 |
-
|
677 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:4
|
678 |
-
msgid "Date format"
|
679 |
-
msgstr ""
|
680 |
-
|
681 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:12
|
682 |
-
msgid "Date limit"
|
683 |
-
msgstr ""
|
684 |
-
|
685 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:14
|
686 |
-
msgid "Since current date"
|
687 |
-
msgstr ""
|
688 |
-
|
689 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:15
|
690 |
-
msgid "Between fixed dates"
|
691 |
-
msgstr ""
|
692 |
-
|
693 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:22
|
694 |
-
msgid "Days disable"
|
695 |
-
msgstr ""
|
696 |
-
|
697 |
-
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:23
|
698 |
-
msgid "Disable week days"
|
699 |
-
msgstr ""
|
700 |
-
|
701 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:4
|
702 |
-
msgid "Show for roles"
|
703 |
-
msgstr ""
|
704 |
-
|
705 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:5
|
706 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:13
|
707 |
-
msgid "Filter by roles"
|
708 |
-
msgstr ""
|
709 |
-
|
710 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:12
|
711 |
-
msgid "Hide for roles"
|
712 |
-
msgstr ""
|
713 |
-
|
714 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:23
|
715 |
-
msgid "More"
|
716 |
-
msgstr ""
|
717 |
-
|
718 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:25
|
719 |
-
msgid "Apply conditions event it there is more than one product"
|
720 |
-
msgstr ""
|
721 |
-
|
722 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:31
|
723 |
-
msgid "Show for products"
|
724 |
-
msgstr ""
|
725 |
-
|
726 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:32
|
727 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:40
|
728 |
-
msgid "Filter by product"
|
729 |
-
msgstr ""
|
730 |
-
|
731 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:39
|
732 |
-
msgid "Hide for products"
|
733 |
-
msgstr ""
|
734 |
-
|
735 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:50
|
736 |
-
msgid "Show for category"
|
737 |
-
msgstr ""
|
738 |
-
|
739 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:51
|
740 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:61
|
741 |
-
msgid "Filter by categories"
|
742 |
-
msgstr ""
|
743 |
-
|
744 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:60
|
745 |
-
msgid "Hide for category"
|
746 |
-
msgstr ""
|
747 |
-
|
748 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:73
|
749 |
-
msgid "Hide on account"
|
750 |
-
msgstr ""
|
751 |
-
|
752 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:75
|
753 |
-
msgid "Hide this field on the account page"
|
754 |
-
msgstr ""
|
755 |
-
|
756 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:79
|
757 |
-
msgid "Hide on checkout"
|
758 |
-
msgstr ""
|
759 |
-
|
760 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:81
|
761 |
-
msgid "Hide this field on the checkout page"
|
762 |
-
msgstr ""
|
763 |
-
|
764 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:85
|
765 |
-
msgid "Hide on emails"
|
766 |
-
msgstr ""
|
767 |
-
|
768 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:87
|
769 |
-
msgid "Hide this field on the user email"
|
770 |
-
msgstr ""
|
771 |
-
|
772 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:91
|
773 |
-
msgid "Hide on orders"
|
774 |
-
msgstr ""
|
775 |
-
|
776 |
-
#: includes/view/backend/pages/modals/parts/panel-display.php:93
|
777 |
-
msgid "Hide this field on the user order"
|
778 |
-
msgstr ""
|
779 |
-
|
780 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:4
|
781 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:9
|
782 |
-
msgid "Name"
|
783 |
-
msgstr ""
|
784 |
-
|
785 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:6
|
786 |
-
msgid "You can't change the slug of default fields."
|
787 |
-
msgstr ""
|
788 |
-
|
789 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:7
|
790 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:10
|
791 |
-
msgid "myfield"
|
792 |
-
msgstr ""
|
793 |
-
|
794 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:9
|
795 |
-
msgid "Currently is not possible to change the name of the fields."
|
796 |
-
msgstr ""
|
797 |
-
|
798 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:16
|
799 |
-
#: includes/view/backend/pages/parts/loop.php:12
|
800 |
-
msgid "Type"
|
801 |
-
msgstr ""
|
802 |
-
|
803 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:28
|
804 |
-
msgid "Type of the checkout field."
|
805 |
-
msgstr ""
|
806 |
-
|
807 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:32
|
808 |
-
msgid "Picker Type"
|
809 |
-
msgstr ""
|
810 |
-
|
811 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:34
|
812 |
-
msgid "Farbtastic"
|
813 |
-
msgstr ""
|
814 |
-
|
815 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:35
|
816 |
-
msgid "Iris"
|
817 |
-
msgstr ""
|
818 |
-
|
819 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:42
|
820 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:12
|
821 |
-
#: includes/view/backend/pages/parts/loop.php:13
|
822 |
-
msgid "Label"
|
823 |
-
msgstr ""
|
824 |
-
|
825 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:43
|
826 |
-
msgid "My Field Name"
|
827 |
-
msgstr ""
|
828 |
-
|
829 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:44
|
830 |
-
msgid "Label text of the checkout field."
|
831 |
-
msgstr ""
|
832 |
-
|
833 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:48
|
834 |
-
#: includes/view/backend/pages/parts/loop.php:14
|
835 |
-
msgid "Placeholder"
|
836 |
-
msgstr ""
|
837 |
-
|
838 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:49
|
839 |
-
msgid "This is a placeholder"
|
840 |
-
msgstr ""
|
841 |
-
|
842 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:50
|
843 |
-
msgid "Placeholder text of the checkout field."
|
844 |
-
msgstr ""
|
845 |
-
|
846 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:55
|
847 |
-
msgid "Button"
|
848 |
-
msgstr ""
|
849 |
-
|
850 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:56
|
851 |
-
msgid "Upload your files"
|
852 |
-
msgstr ""
|
853 |
-
|
854 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:57
|
855 |
-
msgid "Text for the button name."
|
856 |
-
msgstr ""
|
857 |
-
|
858 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:71
|
859 |
-
msgid "Enter a default value (optional)"
|
860 |
-
msgstr ""
|
861 |
-
|
862 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:73
|
863 |
-
msgid "Default value of the checkout field."
|
864 |
-
msgstr ""
|
865 |
-
|
866 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:84
|
867 |
-
msgid "Choose the allowed types…"
|
868 |
-
msgstr ""
|
869 |
-
|
870 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:110
|
871 |
-
msgid "Country"
|
872 |
-
msgstr ""
|
873 |
-
|
874 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:111
|
875 |
-
msgid "Select country…"
|
876 |
-
msgstr ""
|
877 |
-
|
878 |
-
#: includes/view/backend/pages/modals/parts/panel-general.php:122
|
879 |
-
msgid "Extra class"
|
880 |
-
msgstr ""
|
881 |
-
|
882 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:8
|
883 |
-
msgid "Select all"
|
884 |
-
msgstr ""
|
885 |
-
|
886 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:15
|
887 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:4
|
888 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:20
|
889 |
-
msgid "Price"
|
890 |
-
msgstr ""
|
891 |
-
|
892 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:16
|
893 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:20
|
894 |
-
msgid "This is a premium feature."
|
895 |
-
msgstr ""
|
896 |
-
|
897 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:19
|
898 |
-
msgid "Taxable"
|
899 |
-
msgstr ""
|
900 |
-
|
901 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:65
|
902 |
-
msgid "Add new option"
|
903 |
-
msgstr ""
|
904 |
-
|
905 |
-
#: includes/view/backend/pages/modals/parts/panel-options.php:66
|
906 |
-
msgid "Delete selected"
|
907 |
-
msgstr ""
|
908 |
-
|
909 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:10
|
910 |
-
msgid "My Custom Charge"
|
911 |
-
msgstr ""
|
912 |
-
|
913 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:14
|
914 |
-
msgid "Total"
|
915 |
-
msgstr ""
|
916 |
-
|
917 |
-
#: includes/view/backend/pages/modals/parts/panel-price.php:25
|
918 |
-
msgid "Tax"
|
919 |
-
msgstr ""
|
920 |
-
|
921 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:4
|
922 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:12
|
923 |
-
msgid "Select2"
|
924 |
-
msgstr ""
|
925 |
-
|
926 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:6
|
927 |
-
msgid "Enhance select behaviour with select2."
|
928 |
-
msgstr ""
|
929 |
-
|
930 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:12
|
931 |
-
msgid "Allow clear"
|
932 |
-
msgstr ""
|
933 |
-
|
934 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:14
|
935 |
-
msgid "Provides support for clearable selections."
|
936 |
-
msgstr ""
|
937 |
-
|
938 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:18
|
939 |
-
msgid "Allow search"
|
940 |
-
msgstr ""
|
941 |
-
|
942 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:20
|
943 |
-
msgid "Display the search box for options."
|
944 |
-
msgstr ""
|
945 |
-
|
946 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:26
|
947 |
-
msgid "Select on close"
|
948 |
-
msgstr ""
|
949 |
-
|
950 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:28
|
951 |
-
msgid "Implements automatic selection when the dropdown is closed."
|
952 |
-
msgstr ""
|
953 |
-
|
954 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:32
|
955 |
-
msgid "Close on select"
|
956 |
-
msgstr ""
|
957 |
-
|
958 |
-
#: includes/view/backend/pages/modals/parts/panel-select2.php:34
|
959 |
-
msgid "Controls whether the dropdown is closed after a selection is made."
|
960 |
-
msgstr ""
|
961 |
-
|
962 |
-
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:4
|
963 |
-
msgid "Hour start"
|
964 |
-
msgstr ""
|
965 |
-
|
966 |
-
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:9
|
967 |
-
msgid "Hour end"
|
968 |
-
msgstr ""
|
969 |
-
|
970 |
-
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:14
|
971 |
-
msgid "Minutes interval"
|
972 |
-
msgstr ""
|
973 |
-
|
974 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:3
|
975 |
-
msgid "General"
|
976 |
-
msgstr ""
|
977 |
-
|
978 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:7
|
979 |
-
msgid "Options"
|
980 |
-
msgstr ""
|
981 |
-
|
982 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:16
|
983 |
-
msgid "Display"
|
984 |
-
msgstr ""
|
985 |
-
|
986 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:25
|
987 |
-
msgid "Timepicker"
|
988 |
-
msgstr ""
|
989 |
-
|
990 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:30
|
991 |
-
msgid "Datepicker"
|
992 |
-
msgstr ""
|
993 |
-
|
994 |
-
#: includes/view/backend/pages/modals/parts/tabs.php:34
|
995 |
-
msgid "Admin"
|
996 |
-
msgstr ""
|
997 |
-
|
998 |
-
#: includes/view/backend/pages/order.php:3
|
999 |
-
msgid "Order settings"
|
1000 |
-
msgstr ""
|
1001 |
-
|
1002 |
-
#: includes/view/backend/pages/order.php:5
|
1003 |
-
msgid "Customize and manage the order settings."
|
1004 |
-
msgstr ""
|
1005 |
-
|
1006 |
-
#: includes/view/backend/pages/parts/actions.php:3
|
1007 |
-
msgid "+ Add New Field"
|
1008 |
-
msgstr ""
|
1009 |
-
|
1010 |
-
#: includes/view/backend/pages/parts/actions.php:4
|
1011 |
-
msgid "Import"
|
1012 |
-
msgstr ""
|
1013 |
-
|
1014 |
-
#: includes/view/backend/pages/parts/actions.php:5
|
1015 |
-
msgid "Reset"
|
1016 |
-
msgstr ""
|
1017 |
-
|
1018 |
-
#: includes/view/backend/pages/parts/header.php:5
|
1019 |
-
msgid ""
|
1020 |
-
"Thanks for using our product! We recommend these extensions that will add "
|
1021 |
-
"new features to stand out your business and improve your sales."
|
1022 |
-
msgstr ""
|
1023 |
-
|
1024 |
-
#: includes/view/backend/pages/parts/header.php:8
|
1025 |
-
msgid "Purchase"
|
1026 |
-
msgstr ""
|
1027 |
-
|
1028 |
-
#: includes/view/backend/pages/parts/header.php:9
|
1029 |
-
#: includes/view/backend/pages/parts/tabs.php:3
|
1030 |
-
msgid "Documentation"
|
1031 |
-
msgstr ""
|
1032 |
-
|
1033 |
-
#. Author of the plugin/theme
|
1034 |
-
#: includes/view/backend/pages/parts/header.php:25
|
1035 |
-
msgid "QuadLayers"
|
1036 |
-
msgstr ""
|
1037 |
-
|
1038 |
-
#: includes/view/backend/pages/parts/loop.php:9
|
1039 |
-
msgid "Required"
|
1040 |
-
msgstr ""
|
1041 |
-
|
1042 |
-
#: includes/view/backend/pages/parts/loop.php:10
|
1043 |
-
msgid "Position"
|
1044 |
-
msgstr ""
|
1045 |
-
|
1046 |
-
#: includes/view/backend/pages/parts/loop.php:18
|
1047 |
-
msgid "Disabled"
|
1048 |
-
msgstr ""
|
1049 |
-
|
1050 |
-
#: includes/view/backend/pages/parts/loop.php:29
|
1051 |
-
#, php-format
|
1052 |
-
msgid "Move the \"%s\" payment method up"
|
1053 |
-
msgstr ""
|
1054 |
-
|
1055 |
-
#: includes/view/backend/pages/parts/loop.php:29
|
1056 |
-
msgid "Move up"
|
1057 |
-
msgstr ""
|
1058 |
-
|
1059 |
-
#: includes/view/backend/pages/parts/loop.php:30
|
1060 |
-
#, php-format
|
1061 |
-
msgid "Move the \"%s\" payment method down"
|
1062 |
-
msgstr ""
|
1063 |
-
|
1064 |
-
#: includes/view/backend/pages/parts/loop.php:30
|
1065 |
-
msgid "Move down"
|
1066 |
-
msgstr ""
|
1067 |
-
|
1068 |
-
#: includes/view/backend/pages/parts/loop.php:38
|
1069 |
-
#: includes/view/backend/pages/parts/loop.php:56
|
1070 |
-
#: includes/view/backend/pages/parts/loop.php:103
|
1071 |
-
#, php-format
|
1072 |
-
msgid "The \"%s\" field currently enabled"
|
1073 |
-
msgstr ""
|
1074 |
-
|
1075 |
-
#: includes/view/backend/pages/parts/loop.php:40
|
1076 |
-
#: includes/view/backend/pages/parts/loop.php:58
|
1077 |
-
#: includes/view/backend/pages/parts/loop.php:105
|
1078 |
-
#, php-format
|
1079 |
-
msgid "The \"%s\" field currently disabled"
|
1080 |
-
msgstr ""
|
1081 |
-
|
1082 |
-
#: includes/view/backend/pages/parts/loop.php:47
|
1083 |
-
msgid "Wide"
|
1084 |
-
msgstr ""
|
1085 |
-
|
1086 |
-
#: includes/view/backend/pages/parts/loop.php:48
|
1087 |
-
msgid "Left"
|
1088 |
-
msgstr ""
|
1089 |
-
|
1090 |
-
#: includes/view/backend/pages/parts/loop.php:49
|
1091 |
-
msgid "Right"
|
1092 |
-
msgstr ""
|
1093 |
-
|
1094 |
-
#: includes/view/backend/pages/parts/loop.php:111
|
1095 |
-
#: includes/view/backend/pages/parts/loop.php:115
|
1096 |
-
msgid "Edit checkout field"
|
1097 |
-
msgstr ""
|
1098 |
-
|
1099 |
-
#: includes/view/backend/pages/parts/loop.php:111
|
1100 |
-
msgid "Edit"
|
1101 |
-
msgstr ""
|
1102 |
-
|
1103 |
-
#: includes/view/backend/pages/premium.php:8
|
1104 |
-
#, php-format
|
1105 |
-
msgid ""
|
1106 |
-
"%s allows you to customize, add, edit and delete fields displayed on the "
|
1107 |
-
"checkout page. With the premium version you can also create conditional "
|
1108 |
-
"fields and include custom fees based on the checkout fields."
|
1109 |
-
msgstr ""
|
1110 |
-
|
1111 |
-
#: includes/view/backend/pages/premium.php:11
|
1112 |
-
msgid "Purchase Now"
|
1113 |
-
msgstr ""
|
1114 |
-
|
1115 |
-
#: includes/view/backend/pages/premium.php:12
|
1116 |
-
msgid "Get Support"
|
1117 |
-
msgstr ""
|
1118 |
-
|
1119 |
-
#: includes/view/backend/pages/premium.php:16
|
1120 |
-
msgid "Add checkout fees"
|
1121 |
-
msgstr ""
|
1122 |
-
|
1123 |
-
#: includes/view/backend/pages/premium.php:18
|
1124 |
-
#, php-format
|
1125 |
-
msgid ""
|
1126 |
-
"%s allows you to include fees to each custom or core field. Fees can be "
|
1127 |
-
"fixed or percentage amounts based on checkout total."
|
1128 |
-
msgstr ""
|
1129 |
-
|
1130 |
-
#: includes/view/backend/pages/premium.php:22
|
1131 |
-
msgid "Remove account fields"
|
1132 |
-
msgstr ""
|
1133 |
-
|
1134 |
-
#: includes/view/backend/pages/premium.php:24
|
1135 |
-
msgid ""
|
1136 |
-
"By default all fields attached to the billing or shipping sections are "
|
1137 |
-
"included in the edit address area of the user account page. With the premium "
|
1138 |
-
"version, you can hide the fields on the checkout or my account page."
|
1139 |
-
msgstr ""
|
1140 |
-
|
1141 |
-
#: includes/view/backend/pages/premium.php:28
|
1142 |
-
msgid "Enhance select fields"
|
1143 |
-
msgstr ""
|
1144 |
-
|
1145 |
-
#: includes/view/backend/pages/premium.php:30
|
1146 |
-
msgid ""
|
1147 |
-
"The enhance options allow you to improve the behavior of the select and "
|
1148 |
-
"multiselect fields with the select2 jquery plugin."
|
1149 |
-
msgstr ""
|
1150 |
-
|
1151 |
-
#: includes/view/backend/pages/premium.php:45
|
1152 |
-
msgid "Display on admin list orders"
|
1153 |
-
msgstr ""
|
1154 |
-
|
1155 |
-
#: includes/view/backend/pages/premium.php:47
|
1156 |
-
msgid ""
|
1157 |
-
"This option allows you to display the fields in the WooCommerce order list."
|
1158 |
-
msgstr ""
|
1159 |
-
|
1160 |
-
#: includes/view/backend/pages/premium.php:51
|
1161 |
-
msgid "Allow sorting on admin list orders"
|
1162 |
-
msgstr ""
|
1163 |
-
|
1164 |
-
#: includes/view/backend/pages/premium.php:53
|
1165 |
-
msgid ""
|
1166 |
-
"This option allows you to sort the WooCommerce orders list based on the "
|
1167 |
-
"field values."
|
1168 |
-
msgstr ""
|
1169 |
-
|
1170 |
-
#: includes/view/backend/pages/premium.php:57
|
1171 |
-
msgid "Allow filtering on admin list orders"
|
1172 |
-
msgstr ""
|
1173 |
-
|
1174 |
-
#: includes/view/backend/pages/premium.php:59
|
1175 |
-
msgid ""
|
1176 |
-
"This option allows you to add a search field to filter the options based on "
|
1177 |
-
"the selected values."
|
1178 |
-
msgstr ""
|
1179 |
-
|
1180 |
-
#: includes/view/backend/pages/shipping.php:3
|
1181 |
-
msgid "Shipping fields"
|
1182 |
-
msgstr ""
|
1183 |
-
|
1184 |
-
#: includes/view/frontend/class-wooccm-fields-additional.php:26
|
1185 |
-
#, php-format
|
1186 |
-
msgid "%s is a required field."
|
1187 |
-
msgstr ""
|
1188 |
-
|
1189 |
-
#: includes/view/frontend/class-wooccm-fields-filters.php:27
|
1190 |
-
msgid "required"
|
1191 |
-
msgstr ""
|
1192 |
-
|
1193 |
-
#: includes/view/frontend/class-wooccm-fields-filters.php:29
|
1194 |
-
msgid "optional"
|
1195 |
-
msgstr ""
|
1196 |
-
|
1197 |
-
#: templates/order/order-custom-fields.php:1
|
1198 |
-
msgid "Custom fields"
|
1199 |
-
msgstr ""
|
1200 |
-
|
1201 |
-
#: templates/order/order-upload-files.php:6
|
1202 |
-
msgid "ID"
|
1203 |
-
msgstr ""
|
1204 |
-
|
1205 |
-
#: templates/order/order-upload-files.php:11
|
1206 |
-
msgid "Actions"
|
1207 |
-
msgstr ""
|
1208 |
-
|
1209 |
-
#. Plugin Name of the plugin/theme
|
1210 |
-
msgid "WooCommerce Checkout Manager"
|
1211 |
-
msgstr ""
|
1212 |
-
|
1213 |
-
#. Description of the plugin/theme
|
1214 |
-
msgid "Manages WooCommerce Checkout, the advanced way."
|
1215 |
-
msgstr ""
|
1216 |
-
|
1217 |
-
#. Author URI of the plugin/theme
|
1218 |
-
msgid "https://www.quadlayers.com"
|
1219 |
-
msgstr ""
|
1 |
+
#, fuzzy
|
2 |
+
msgid ""
|
3 |
+
msgstr ""
|
4 |
+
"Project-Id-Version: WooCommerce Checkout Manager\n"
|
5 |
+
"POT-Creation-Date: 2019-12-17 15:21-0300\n"
|
6 |
+
"PO-Revision-Date: 2019-12-17 15:21-0300\n"
|
7 |
+
"Last-Translator: \n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.8.1\n"
|
13 |
+
"X-Poedit-Basepath: ..\n"
|
14 |
+
"X-Poedit-WPHeader: woocommerce-checkout-manager.php\n"
|
15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
17 |
+
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
18 |
+
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
19 |
+
"X-Poedit-SearchPath-0: .\n"
|
20 |
+
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
21 |
+
|
22 |
+
#: includes/class-wooccm-admin.php:55
|
23 |
+
#, php-format
|
24 |
+
msgid "Stock: %d"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: includes/class-wooccm-admin.php:84 includes/class-wooccm-admin.php:89
|
28 |
+
#: includes/controller/class-wooccm-checkout.php:242
|
29 |
+
#: includes/view/backend/pages/checkout.php:2
|
30 |
+
msgid "Checkout"
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: includes/class-wooccm-notices.php:71 includes/class-wooccm-notices.php:98
|
34 |
+
msgid "Join Community!"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: includes/class-wooccm-notices.php:74 includes/class-wooccm-notices.php:101
|
38 |
+
msgid "Report a bug"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: includes/class-wooccm-notices.php:77 includes/class-wooccm-notices.php:104
|
42 |
+
msgid "About us"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: includes/class-wooccm-notices.php:93
|
46 |
+
msgid "Hello! We've recently acquired this plugin!"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: includes/class-wooccm-notices.php:95
|
50 |
+
msgid ""
|
51 |
+
"We will do our best to improve it and include new features gradually. Please "
|
52 |
+
"be patient and let us know about the issues and improvements that you want "
|
53 |
+
"to see in this plugin."
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: includes/class-wooccm-notices.php:136
|
57 |
+
#: includes/controller/class-wooccm-premium.php:40
|
58 |
+
#: includes/view/backend/pages/parts/tabs.php:4
|
59 |
+
#: includes/view/backend/pages/premium.php:6
|
60 |
+
msgid "Premium"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: includes/class-wooccm-notices.php:137
|
64 |
+
msgid "Settings"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: includes/class-wooccm-suggestions-list-table.php:109
|
68 |
+
msgid "Search Results"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: includes/class-wooccm-suggestions-list-table.php:112
|
72 |
+
msgctxt "Plugin Installer"
|
73 |
+
msgid "Beta Testing"
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: includes/class-wooccm-suggestions-list-table.php:114
|
77 |
+
msgctxt "Plugin Installer"
|
78 |
+
msgid "Featured"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: includes/class-wooccm-suggestions-list-table.php:115
|
82 |
+
msgctxt "Plugin Installer"
|
83 |
+
msgid "Popular"
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: includes/class-wooccm-suggestions-list-table.php:116
|
87 |
+
msgctxt "Plugin Installer"
|
88 |
+
msgid "Recommended"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: includes/class-wooccm-suggestions-list-table.php:117
|
92 |
+
msgctxt "Plugin Installer"
|
93 |
+
msgid "Favorites"
|
94 |
+
msgstr ""
|
95 |
+
|
96 |
+
#: includes/class-wooccm-upload.php:66
|
97 |
+
msgid "No attachment selected."
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#: includes/class-wooccm-upload.php:103
|
101 |
+
#: includes/controller/class-wooccm-order.php:48
|
102 |
+
msgid "No uploads were recognised. Files were not uploaded."
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: includes/class-wooccm-upload.php:110
|
106 |
+
#: includes/controller/class-wooccm-order.php:103
|
107 |
+
msgid "Unknow error."
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: includes/class-wooccm.php:77 includes/class-wooccm.php:108
|
111 |
+
msgid "Uploading, please wait..."
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: includes/class-wooccm.php:78 includes/class-wooccm.php:109
|
115 |
+
msgid "Saving, please wait..."
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: includes/class-wooccm.php:79 includes/class-wooccm.php:110
|
119 |
+
msgid "Files uploaded successfully."
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: includes/class-wooccm.php:80 includes/class-wooccm.php:111
|
123 |
+
msgid "Deleted successfully."
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: includes/class-wooccm.php:91 includes/view/backend/pages/parts/loop.php:11
|
127 |
+
msgid "Clear"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: includes/class-wooccm.php:92
|
131 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:64
|
132 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:96
|
133 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:23
|
134 |
+
msgid "Default"
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: includes/class-wooccm.php:93
|
138 |
+
msgid "Select Color"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: includes/class-wooccm.php:94
|
142 |
+
msgid "Current Color"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: includes/controller/class-wooccm-advanced.php:49
|
146 |
+
msgid "Custom CSS"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: includes/controller/class-wooccm-advanced.php:50
|
150 |
+
msgid "Add custom stylesheets to the checkout page."
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: includes/controller/class-wooccm-advanced.php:68
|
154 |
+
#: includes/view/backend/pages/advanced.php:2
|
155 |
+
msgid "Advanced"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: includes/controller/class-wooccm-checkout.php:132
|
159 |
+
msgid "Force shipping address"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: includes/controller/class-wooccm-checkout.php:133
|
163 |
+
msgid "Force show shipping checkout fields."
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: includes/controller/class-wooccm-checkout.php:138
|
167 |
+
#: includes/controller/class-wooccm-checkout.php:150
|
168 |
+
#: includes/controller/class-wooccm-checkout.php:162
|
169 |
+
#: includes/controller/class-wooccm-email.php:34
|
170 |
+
#: includes/controller/class-wooccm-order.php:181
|
171 |
+
#: includes/controller/class-wooccm-order.php:209
|
172 |
+
#: includes/view/backend/pages/modals/parts/info.php:53
|
173 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:67
|
174 |
+
#: includes/view/backend/pages/parts/loop.php:38
|
175 |
+
#: includes/view/backend/pages/parts/loop.php:56
|
176 |
+
#: includes/view/backend/pages/parts/loop.php:76
|
177 |
+
#: includes/view/backend/pages/parts/loop.php:78
|
178 |
+
#: includes/view/backend/pages/parts/loop.php:85
|
179 |
+
#: includes/view/backend/pages/parts/loop.php:87
|
180 |
+
#: includes/view/backend/pages/parts/loop.php:94
|
181 |
+
#: includes/view/backend/pages/parts/loop.php:96
|
182 |
+
#: includes/view/backend/pages/parts/loop.php:103
|
183 |
+
msgid "Yes"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: includes/controller/class-wooccm-checkout.php:139
|
187 |
+
#: includes/controller/class-wooccm-checkout.php:151
|
188 |
+
#: includes/controller/class-wooccm-checkout.php:163
|
189 |
+
#: includes/controller/class-wooccm-email.php:35
|
190 |
+
#: includes/controller/class-wooccm-order.php:182
|
191 |
+
#: includes/controller/class-wooccm-order.php:210
|
192 |
+
#: includes/view/backend/pages/modals/parts/info.php:54
|
193 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:68
|
194 |
+
#: includes/view/backend/pages/parts/loop.php:40
|
195 |
+
#: includes/view/backend/pages/parts/loop.php:58
|
196 |
+
#: includes/view/backend/pages/parts/loop.php:105
|
197 |
+
msgid "No"
|
198 |
+
msgstr ""
|
199 |
+
|
200 |
+
#: includes/controller/class-wooccm-checkout.php:144
|
201 |
+
msgid "Force create an account"
|
202 |
+
msgstr ""
|
203 |
+
|
204 |
+
#: includes/controller/class-wooccm-checkout.php:145
|
205 |
+
msgid "Force create an account for guests users."
|
206 |
+
msgstr ""
|
207 |
+
|
208 |
+
#: includes/controller/class-wooccm-checkout.php:156
|
209 |
+
msgid "Remove order notes"
|
210 |
+
msgstr ""
|
211 |
+
|
212 |
+
#: includes/controller/class-wooccm-checkout.php:157
|
213 |
+
msgid "Remove order notes from checkout page."
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
#: includes/controller/class-wooccm-checkout.php:168
|
217 |
+
msgid "Order notes label"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: includes/controller/class-wooccm-checkout.php:169
|
221 |
+
#: includes/controller/class-wooccm-checkout.php:176
|
222 |
+
#: includes/controller/class-wooccm-checkout.php:183
|
223 |
+
#: includes/controller/class-wooccm-checkout.php:190
|
224 |
+
msgid "Add custom title for the custom fields table in the thankyou page."
|
225 |
+
msgstr ""
|
226 |
+
|
227 |
+
#: includes/controller/class-wooccm-checkout.php:172
|
228 |
+
msgid "Order notes"
|
229 |
+
msgstr ""
|
230 |
+
|
231 |
+
#: includes/controller/class-wooccm-checkout.php:175
|
232 |
+
msgid "Order notes placeholder"
|
233 |
+
msgstr ""
|
234 |
+
|
235 |
+
#: includes/controller/class-wooccm-checkout.php:179
|
236 |
+
msgid "Notes about your order, e.g. special notes for delivery."
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: includes/controller/class-wooccm-checkout.php:182
|
240 |
+
msgid "Add message before checkout"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: includes/controller/class-wooccm-checkout.php:189
|
244 |
+
msgid "Add message after checkout"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: includes/controller/class-wooccm-email.php:28
|
248 |
+
#: includes/controller/class-wooccm-order.php:203
|
249 |
+
msgid "Add custom fields"
|
250 |
+
msgstr ""
|
251 |
+
|
252 |
+
#: includes/controller/class-wooccm-email.php:29
|
253 |
+
#: includes/controller/class-wooccm-order.php:204
|
254 |
+
msgid "Show the selected fields in the order."
|
255 |
+
msgstr ""
|
256 |
+
|
257 |
+
#: includes/controller/class-wooccm-email.php:40
|
258 |
+
#: includes/controller/class-wooccm-order.php:187
|
259 |
+
#: includes/controller/class-wooccm-order.php:215
|
260 |
+
msgid "Add for this order status"
|
261 |
+
msgstr ""
|
262 |
+
|
263 |
+
#: includes/controller/class-wooccm-email.php:41
|
264 |
+
#: includes/controller/class-wooccm-order.php:176
|
265 |
+
#: includes/controller/class-wooccm-order.php:188
|
266 |
+
#: includes/controller/class-wooccm-order.php:216
|
267 |
+
msgid "Allow customers to upload files in the order."
|
268 |
+
msgstr ""
|
269 |
+
|
270 |
+
#: includes/controller/class-wooccm-email.php:49
|
271 |
+
#: includes/controller/class-wooccm-order.php:224
|
272 |
+
msgid "Add custom fields title"
|
273 |
+
msgstr ""
|
274 |
+
|
275 |
+
#: includes/controller/class-wooccm-email.php:50
|
276 |
+
#: includes/controller/class-wooccm-order.php:197
|
277 |
+
#: includes/controller/class-wooccm-order.php:225
|
278 |
+
msgid "Add custom title for the uploads files table."
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#: includes/controller/class-wooccm-email.php:54
|
282 |
+
#: includes/controller/class-wooccm-order.php:228
|
283 |
+
msgid "Order extra"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#: includes/controller/class-wooccm-email.php:66
|
287 |
+
#: includes/view/backend/pages/email.php:2
|
288 |
+
msgid "Email"
|
289 |
+
msgstr ""
|
290 |
+
|
291 |
+
#: includes/controller/class-wooccm-field.php:33
|
292 |
+
msgid "Are you sure you want to remove this field?"
|
293 |
+
msgstr ""
|
294 |
+
|
295 |
+
#: includes/controller/class-wooccm-field.php:34
|
296 |
+
msgid "Are you sure you want to reset this fields?"
|
297 |
+
msgstr ""
|
298 |
+
|
299 |
+
#: includes/controller/class-wooccm-field.php:71
|
300 |
+
#: includes/controller/class-wooccm-field.php:98
|
301 |
+
#: includes/controller/class-wooccm-field.php:126
|
302 |
+
#: includes/controller/class-wooccm-field.php:141
|
303 |
+
#: includes/controller/class-wooccm-field.php:161
|
304 |
+
#: includes/controller/class-wooccm-field.php:177
|
305 |
+
msgid "Unknow error"
|
306 |
+
msgstr ""
|
307 |
+
|
308 |
+
#: includes/controller/class-wooccm-field.php:174
|
309 |
+
msgid "Undefined field id"
|
310 |
+
msgstr ""
|
311 |
+
|
312 |
+
#: includes/controller/class-wooccm-field.php:360
|
313 |
+
msgid "Select the position of the additional fields."
|
314 |
+
msgstr ""
|
315 |
+
|
316 |
+
#: includes/controller/class-wooccm-field.php:365
|
317 |
+
msgid "Before billing form"
|
318 |
+
msgstr ""
|
319 |
+
|
320 |
+
#: includes/controller/class-wooccm-field.php:366
|
321 |
+
msgid "After billing form"
|
322 |
+
msgstr ""
|
323 |
+
|
324 |
+
#: includes/controller/class-wooccm-field.php:367
|
325 |
+
msgid "Before order notes"
|
326 |
+
msgstr ""
|
327 |
+
|
328 |
+
#: includes/controller/class-wooccm-field.php:368
|
329 |
+
msgid "After order notes"
|
330 |
+
msgstr ""
|
331 |
+
|
332 |
+
#: includes/controller/class-wooccm-field.php:401
|
333 |
+
#: includes/controller/class-wooccm-field.php:429
|
334 |
+
#: includes/controller/class-wooccm-field.php:477
|
335 |
+
#, php-format
|
336 |
+
msgid "ID: %s | Field Type: %s"
|
337 |
+
msgstr ""
|
338 |
+
|
339 |
+
#: includes/controller/class-wooccm-field.php:401
|
340 |
+
#: includes/controller/class-wooccm-field.php:429
|
341 |
+
#: includes/controller/class-wooccm-field.php:477
|
342 |
+
msgid "Generic"
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#: includes/controller/class-wooccm-field.php:454
|
346 |
+
#: includes/controller/class-wooccm-field.php:531
|
347 |
+
#: includes/view/backend/pages/additional.php:2
|
348 |
+
msgid "Additional"
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
#: includes/controller/class-wooccm-field.php:478
|
352 |
+
#: includes/view/backend/pages/modals/parts/info.php:30
|
353 |
+
#, php-format
|
354 |
+
msgid "Field %s"
|
355 |
+
msgstr ""
|
356 |
+
|
357 |
+
#: includes/controller/class-wooccm-field.php:517
|
358 |
+
#: includes/view/backend/pages/billing.php:2
|
359 |
+
msgid "Billing"
|
360 |
+
msgstr ""
|
361 |
+
|
362 |
+
#: includes/controller/class-wooccm-field.php:524
|
363 |
+
#: includes/view/backend/pages/shipping.php:2
|
364 |
+
msgid "Shipping"
|
365 |
+
msgstr ""
|
366 |
+
|
367 |
+
#: includes/controller/class-wooccm-order.php:54
|
368 |
+
msgid "Empty order id."
|
369 |
+
msgstr ""
|
370 |
+
|
371 |
+
#: includes/controller/class-wooccm-order.php:58
|
372 |
+
msgid "Invalid order id."
|
373 |
+
msgstr ""
|
374 |
+
|
375 |
+
#: includes/controller/class-wooccm-order.php:162
|
376 |
+
msgid "Order Files"
|
377 |
+
msgstr ""
|
378 |
+
|
379 |
+
#: includes/controller/class-wooccm-order.php:175
|
380 |
+
msgid "Add upload files"
|
381 |
+
msgstr ""
|
382 |
+
|
383 |
+
#: includes/controller/class-wooccm-order.php:196
|
384 |
+
msgid "Add upload files title"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
#: includes/controller/class-wooccm-order.php:200
|
388 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:80
|
389 |
+
#: templates/order/order-upload-files.php:2
|
390 |
+
msgid "Upload files"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
#: includes/controller/class-wooccm-order.php:240
|
394 |
+
#: includes/view/backend/pages/order.php:2
|
395 |
+
msgid "Order"
|
396 |
+
msgstr ""
|
397 |
+
|
398 |
+
#: includes/controller/class-wooccm-suggestions.php:27
|
399 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:37
|
400 |
+
#: includes/view/backend/pages/parts/header.php:3
|
401 |
+
msgid "Suggestions"
|
402 |
+
msgstr ""
|
403 |
+
|
404 |
+
#: includes/model/class-wooccm-field.php:134
|
405 |
+
msgid "Option"
|
406 |
+
msgstr ""
|
407 |
+
|
408 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:5
|
409 |
+
#: templates/order/order-upload-files.php:7
|
410 |
+
msgid "Image"
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:6
|
414 |
+
#: templates/order/order-upload-files.php:8
|
415 |
+
msgid "Filename"
|
416 |
+
msgstr ""
|
417 |
+
|
418 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:7
|
419 |
+
#: templates/order/order-upload-files.php:9
|
420 |
+
msgid "Dimensions"
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:8
|
424 |
+
#: templates/order/order-upload-files.php:10
|
425 |
+
msgid "Extension"
|
426 |
+
msgstr ""
|
427 |
+
|
428 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:39
|
429 |
+
#: templates/order/order-upload-files.php:37
|
430 |
+
msgid "Download"
|
431 |
+
msgstr ""
|
432 |
+
|
433 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:40
|
434 |
+
#: includes/view/backend/pages/parts/loop.php:115
|
435 |
+
#: templates/order/order-upload-files.php:38
|
436 |
+
msgid "Delete"
|
437 |
+
msgstr ""
|
438 |
+
|
439 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:46
|
440 |
+
#: templates/order/order-upload-files.php:44
|
441 |
+
msgid "No files have been uploaded to this order."
|
442 |
+
msgstr ""
|
443 |
+
|
444 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:55
|
445 |
+
#: templates/order/order-upload-files.php:53
|
446 |
+
msgid "Upload Files"
|
447 |
+
msgstr ""
|
448 |
+
|
449 |
+
#: includes/view/backend/meta-boxes/html-order-uploads.php:58
|
450 |
+
#: templates/order/order-upload-files.php:56
|
451 |
+
msgid "Save Changes"
|
452 |
+
msgstr ""
|
453 |
+
|
454 |
+
#: includes/view/backend/pages/additional.php:3
|
455 |
+
msgid "Additional fields"
|
456 |
+
msgstr ""
|
457 |
+
|
458 |
+
#: includes/view/backend/pages/additional.php:5
|
459 |
+
#: includes/view/backend/pages/advanced.php:5
|
460 |
+
#: includes/view/backend/pages/billing.php:5
|
461 |
+
#: includes/view/backend/pages/email.php:5
|
462 |
+
#: includes/view/backend/pages/shipping.php:5
|
463 |
+
#, php-format
|
464 |
+
msgid "Customize and manage the checkout %s fields."
|
465 |
+
msgstr ""
|
466 |
+
|
467 |
+
#: includes/view/backend/pages/advanced.php:3
|
468 |
+
msgid "Advanced settings"
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
#: includes/view/backend/pages/advanced.php:8
|
472 |
+
msgid ""
|
473 |
+
"This will permanently delete all WordPress Options associated with "
|
474 |
+
"WooCommerce Checkout Manager. Are you sure you want to proceed?"
|
475 |
+
msgstr ""
|
476 |
+
|
477 |
+
#: includes/view/backend/pages/advanced.php:8
|
478 |
+
msgid "Delete Options"
|
479 |
+
msgstr ""
|
480 |
+
|
481 |
+
#: includes/view/backend/pages/advanced.php:9
|
482 |
+
msgid ""
|
483 |
+
"This will permanently delete all WordPress Post meta associated with that is "
|
484 |
+
"linked to Orders. Are you sure you want to proceed?"
|
485 |
+
msgstr ""
|
486 |
+
|
487 |
+
#: includes/view/backend/pages/advanced.php:9
|
488 |
+
msgid "Delete Orders Post meta"
|
489 |
+
msgstr ""
|
490 |
+
|
491 |
+
#: includes/view/backend/pages/advanced.php:10
|
492 |
+
msgid ""
|
493 |
+
"This will permanently delete all WordPress Post meta associated with that is "
|
494 |
+
"linked to Users. Are you sure you want to proceed?"
|
495 |
+
msgstr ""
|
496 |
+
|
497 |
+
#: includes/view/backend/pages/advanced.php:10
|
498 |
+
msgid "Delete Users Post meta"
|
499 |
+
msgstr ""
|
500 |
+
|
501 |
+
#: includes/view/backend/pages/billing.php:3
|
502 |
+
msgid "Billing fields"
|
503 |
+
msgstr ""
|
504 |
+
|
505 |
+
#: includes/view/backend/pages/checkout.php:3
|
506 |
+
msgid "Checkout settings"
|
507 |
+
msgstr ""
|
508 |
+
|
509 |
+
#: includes/view/backend/pages/checkout.php:5
|
510 |
+
msgid "Customize and manage the checkout settings."
|
511 |
+
msgstr ""
|
512 |
+
|
513 |
+
#: includes/view/backend/pages/email.php:3
|
514 |
+
msgid "Email settings"
|
515 |
+
msgstr ""
|
516 |
+
|
517 |
+
#: includes/view/backend/pages/modals/parts/info.php:3
|
518 |
+
msgid "Saved."
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: includes/view/backend/pages/modals/parts/info.php:7
|
522 |
+
msgid "Field id"
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
+
#: includes/view/backend/pages/modals/parts/info.php:8
|
526 |
+
msgid "Field key"
|
527 |
+
msgstr ""
|
528 |
+
|
529 |
+
#: includes/view/backend/pages/modals/parts/info.php:10
|
530 |
+
msgid "Parent type"
|
531 |
+
msgstr ""
|
532 |
+
|
533 |
+
#: includes/view/backend/pages/modals/parts/info.php:17
|
534 |
+
msgid "Conditional"
|
535 |
+
msgstr ""
|
536 |
+
|
537 |
+
#: includes/view/backend/pages/modals/parts/info.php:19
|
538 |
+
msgid "Activate conditional field requirement."
|
539 |
+
msgstr ""
|
540 |
+
|
541 |
+
#: includes/view/backend/pages/modals/parts/info.php:24
|
542 |
+
msgid "Parent"
|
543 |
+
msgstr ""
|
544 |
+
|
545 |
+
#: includes/view/backend/pages/modals/parts/info.php:25
|
546 |
+
msgid "Select parent field…"
|
547 |
+
msgstr ""
|
548 |
+
|
549 |
+
#: includes/view/backend/pages/modals/parts/info.php:35
|
550 |
+
msgid "Select conditional parent field."
|
551 |
+
msgstr ""
|
552 |
+
|
553 |
+
#: includes/view/backend/pages/modals/parts/info.php:43
|
554 |
+
msgid "Value"
|
555 |
+
msgstr ""
|
556 |
+
|
557 |
+
#: includes/view/backend/pages/modals/parts/info.php:57
|
558 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:97
|
559 |
+
msgid "Preserve default country…"
|
560 |
+
msgstr ""
|
561 |
+
|
562 |
+
#: includes/view/backend/pages/modals/parts/info.php:66
|
563 |
+
msgid "Conditional parent value"
|
564 |
+
msgstr ""
|
565 |
+
|
566 |
+
#: includes/view/backend/pages/modals/parts/info.php:68
|
567 |
+
msgid "Show field if parent has this value."
|
568 |
+
msgstr ""
|
569 |
+
|
570 |
+
#: includes/view/backend/pages/modals/parts/info.php:74
|
571 |
+
msgid "View checkout page"
|
572 |
+
msgstr ""
|
573 |
+
|
574 |
+
#: includes/view/backend/pages/modals/parts/info.php:75
|
575 |
+
msgid "Get premium version"
|
576 |
+
msgstr ""
|
577 |
+
|
578 |
+
#: includes/view/backend/pages/modals/parts/info.php:76
|
579 |
+
msgid "View documentation"
|
580 |
+
msgstr ""
|
581 |
+
|
582 |
+
#: includes/view/backend/pages/modals/parts/main.php:12
|
583 |
+
msgid "Edit previous media item"
|
584 |
+
msgstr ""
|
585 |
+
|
586 |
+
#: includes/view/backend/pages/modals/parts/main.php:13
|
587 |
+
msgid "Edit next media item"
|
588 |
+
msgstr ""
|
589 |
+
|
590 |
+
#: includes/view/backend/pages/modals/parts/main.php:14
|
591 |
+
msgid "Close dialog"
|
592 |
+
msgstr ""
|
593 |
+
|
594 |
+
#: includes/view/backend/pages/modals/parts/main.php:17
|
595 |
+
msgid "Edit field"
|
596 |
+
msgstr ""
|
597 |
+
|
598 |
+
#: includes/view/backend/pages/modals/parts/main.php:17
|
599 |
+
msgid "New"
|
600 |
+
msgstr ""
|
601 |
+
|
602 |
+
#: includes/view/backend/pages/modals/parts/main.php:39
|
603 |
+
msgid "Save"
|
604 |
+
msgstr ""
|
605 |
+
|
606 |
+
#: includes/view/backend/pages/modals/parts/main.php:45
|
607 |
+
msgid "Close"
|
608 |
+
msgstr ""
|
609 |
+
|
610 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:4
|
611 |
+
#: includes/view/backend/pages/parts/loop.php:15
|
612 |
+
msgid "Listable"
|
613 |
+
msgstr ""
|
614 |
+
|
615 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:6
|
616 |
+
msgid "Display in View Orders screen"
|
617 |
+
msgstr ""
|
618 |
+
|
619 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:7
|
620 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:13
|
621 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:19
|
622 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:9
|
623 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:20
|
624 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:7
|
625 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:17
|
626 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:28
|
627 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:76
|
628 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:82
|
629 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:88
|
630 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:94
|
631 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:6
|
632 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:11
|
633 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:20
|
634 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:27
|
635 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:7
|
636 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:15
|
637 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:21
|
638 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:29
|
639 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:35
|
640 |
+
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:6
|
641 |
+
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:11
|
642 |
+
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:16
|
643 |
+
msgid "This is a premium feature"
|
644 |
+
msgstr ""
|
645 |
+
|
646 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:10
|
647 |
+
#: includes/view/backend/pages/parts/loop.php:16
|
648 |
+
msgid "Sortable"
|
649 |
+
msgstr ""
|
650 |
+
|
651 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:12
|
652 |
+
msgid "Allow Sorting on View Orders screen"
|
653 |
+
msgstr ""
|
654 |
+
|
655 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:16
|
656 |
+
#: includes/view/backend/pages/parts/loop.php:17
|
657 |
+
msgid "Filterable"
|
658 |
+
msgstr ""
|
659 |
+
|
660 |
+
#: includes/view/backend/pages/modals/parts/panel-admin.php:18
|
661 |
+
msgid "Allow Filtering on View Orders screen"
|
662 |
+
msgstr ""
|
663 |
+
|
664 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:4
|
665 |
+
msgid "Between days"
|
666 |
+
msgstr ""
|
667 |
+
|
668 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:15
|
669 |
+
msgid "Between dates"
|
670 |
+
msgstr ""
|
671 |
+
|
672 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:17
|
673 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker-limit.php:18
|
674 |
+
msgid "From… YYYY-MM-DD"
|
675 |
+
msgstr ""
|
676 |
+
|
677 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:4
|
678 |
+
msgid "Date format"
|
679 |
+
msgstr ""
|
680 |
+
|
681 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:12
|
682 |
+
msgid "Date limit"
|
683 |
+
msgstr ""
|
684 |
+
|
685 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:14
|
686 |
+
msgid "Since current date"
|
687 |
+
msgstr ""
|
688 |
+
|
689 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:15
|
690 |
+
msgid "Between fixed dates"
|
691 |
+
msgstr ""
|
692 |
+
|
693 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:22
|
694 |
+
msgid "Days disable"
|
695 |
+
msgstr ""
|
696 |
+
|
697 |
+
#: includes/view/backend/pages/modals/parts/panel-datepicker.php:23
|
698 |
+
msgid "Disable week days"
|
699 |
+
msgstr ""
|
700 |
+
|
701 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:4
|
702 |
+
msgid "Show for roles"
|
703 |
+
msgstr ""
|
704 |
+
|
705 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:5
|
706 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:13
|
707 |
+
msgid "Filter by roles"
|
708 |
+
msgstr ""
|
709 |
+
|
710 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:12
|
711 |
+
msgid "Hide for roles"
|
712 |
+
msgstr ""
|
713 |
+
|
714 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:23
|
715 |
+
msgid "More"
|
716 |
+
msgstr ""
|
717 |
+
|
718 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:25
|
719 |
+
msgid "Apply conditions event it there is more than one product"
|
720 |
+
msgstr ""
|
721 |
+
|
722 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:31
|
723 |
+
msgid "Show for products"
|
724 |
+
msgstr ""
|
725 |
+
|
726 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:32
|
727 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:40
|
728 |
+
msgid "Filter by product"
|
729 |
+
msgstr ""
|
730 |
+
|
731 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:39
|
732 |
+
msgid "Hide for products"
|
733 |
+
msgstr ""
|
734 |
+
|
735 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:50
|
736 |
+
msgid "Show for category"
|
737 |
+
msgstr ""
|
738 |
+
|
739 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:51
|
740 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:61
|
741 |
+
msgid "Filter by categories"
|
742 |
+
msgstr ""
|
743 |
+
|
744 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:60
|
745 |
+
msgid "Hide for category"
|
746 |
+
msgstr ""
|
747 |
+
|
748 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:73
|
749 |
+
msgid "Hide on account"
|
750 |
+
msgstr ""
|
751 |
+
|
752 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:75
|
753 |
+
msgid "Hide this field on the account page"
|
754 |
+
msgstr ""
|
755 |
+
|
756 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:79
|
757 |
+
msgid "Hide on checkout"
|
758 |
+
msgstr ""
|
759 |
+
|
760 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:81
|
761 |
+
msgid "Hide this field on the checkout page"
|
762 |
+
msgstr ""
|
763 |
+
|
764 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:85
|
765 |
+
msgid "Hide on emails"
|
766 |
+
msgstr ""
|
767 |
+
|
768 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:87
|
769 |
+
msgid "Hide this field on the user email"
|
770 |
+
msgstr ""
|
771 |
+
|
772 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:91
|
773 |
+
msgid "Hide on orders"
|
774 |
+
msgstr ""
|
775 |
+
|
776 |
+
#: includes/view/backend/pages/modals/parts/panel-display.php:93
|
777 |
+
msgid "Hide this field on the user order"
|
778 |
+
msgstr ""
|
779 |
+
|
780 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:4
|
781 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:9
|
782 |
+
msgid "Name"
|
783 |
+
msgstr ""
|
784 |
+
|
785 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:6
|
786 |
+
msgid "You can't change the slug of default fields."
|
787 |
+
msgstr ""
|
788 |
+
|
789 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:7
|
790 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:10
|
791 |
+
msgid "myfield"
|
792 |
+
msgstr ""
|
793 |
+
|
794 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:9
|
795 |
+
msgid "Currently is not possible to change the name of the fields."
|
796 |
+
msgstr ""
|
797 |
+
|
798 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:16
|
799 |
+
#: includes/view/backend/pages/parts/loop.php:12
|
800 |
+
msgid "Type"
|
801 |
+
msgstr ""
|
802 |
+
|
803 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:28
|
804 |
+
msgid "Type of the checkout field."
|
805 |
+
msgstr ""
|
806 |
+
|
807 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:32
|
808 |
+
msgid "Picker Type"
|
809 |
+
msgstr ""
|
810 |
+
|
811 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:34
|
812 |
+
msgid "Farbtastic"
|
813 |
+
msgstr ""
|
814 |
+
|
815 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:35
|
816 |
+
msgid "Iris"
|
817 |
+
msgstr ""
|
818 |
+
|
819 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:42
|
820 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:12
|
821 |
+
#: includes/view/backend/pages/parts/loop.php:13
|
822 |
+
msgid "Label"
|
823 |
+
msgstr ""
|
824 |
+
|
825 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:43
|
826 |
+
msgid "My Field Name"
|
827 |
+
msgstr ""
|
828 |
+
|
829 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:44
|
830 |
+
msgid "Label text of the checkout field."
|
831 |
+
msgstr ""
|
832 |
+
|
833 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:48
|
834 |
+
#: includes/view/backend/pages/parts/loop.php:14
|
835 |
+
msgid "Placeholder"
|
836 |
+
msgstr ""
|
837 |
+
|
838 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:49
|
839 |
+
msgid "This is a placeholder"
|
840 |
+
msgstr ""
|
841 |
+
|
842 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:50
|
843 |
+
msgid "Placeholder text of the checkout field."
|
844 |
+
msgstr ""
|
845 |
+
|
846 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:55
|
847 |
+
msgid "Button"
|
848 |
+
msgstr ""
|
849 |
+
|
850 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:56
|
851 |
+
msgid "Upload your files"
|
852 |
+
msgstr ""
|
853 |
+
|
854 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:57
|
855 |
+
msgid "Text for the button name."
|
856 |
+
msgstr ""
|
857 |
+
|
858 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:71
|
859 |
+
msgid "Enter a default value (optional)"
|
860 |
+
msgstr ""
|
861 |
+
|
862 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:73
|
863 |
+
msgid "Default value of the checkout field."
|
864 |
+
msgstr ""
|
865 |
+
|
866 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:84
|
867 |
+
msgid "Choose the allowed types…"
|
868 |
+
msgstr ""
|
869 |
+
|
870 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:110
|
871 |
+
msgid "Country"
|
872 |
+
msgstr ""
|
873 |
+
|
874 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:111
|
875 |
+
msgid "Select country…"
|
876 |
+
msgstr ""
|
877 |
+
|
878 |
+
#: includes/view/backend/pages/modals/parts/panel-general.php:122
|
879 |
+
msgid "Extra class"
|
880 |
+
msgstr ""
|
881 |
+
|
882 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:8
|
883 |
+
msgid "Select all"
|
884 |
+
msgstr ""
|
885 |
+
|
886 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:15
|
887 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:4
|
888 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:20
|
889 |
+
msgid "Price"
|
890 |
+
msgstr ""
|
891 |
+
|
892 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:16
|
893 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:20
|
894 |
+
msgid "This is a premium feature."
|
895 |
+
msgstr ""
|
896 |
+
|
897 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:19
|
898 |
+
msgid "Taxable"
|
899 |
+
msgstr ""
|
900 |
+
|
901 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:65
|
902 |
+
msgid "Add new option"
|
903 |
+
msgstr ""
|
904 |
+
|
905 |
+
#: includes/view/backend/pages/modals/parts/panel-options.php:66
|
906 |
+
msgid "Delete selected"
|
907 |
+
msgstr ""
|
908 |
+
|
909 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:10
|
910 |
+
msgid "My Custom Charge"
|
911 |
+
msgstr ""
|
912 |
+
|
913 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:14
|
914 |
+
msgid "Total"
|
915 |
+
msgstr ""
|
916 |
+
|
917 |
+
#: includes/view/backend/pages/modals/parts/panel-price.php:25
|
918 |
+
msgid "Tax"
|
919 |
+
msgstr ""
|
920 |
+
|
921 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:4
|
922 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:12
|
923 |
+
msgid "Select2"
|
924 |
+
msgstr ""
|
925 |
+
|
926 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:6
|
927 |
+
msgid "Enhance select behaviour with select2."
|
928 |
+
msgstr ""
|
929 |
+
|
930 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:12
|
931 |
+
msgid "Allow clear"
|
932 |
+
msgstr ""
|
933 |
+
|
934 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:14
|
935 |
+
msgid "Provides support for clearable selections."
|
936 |
+
msgstr ""
|
937 |
+
|
938 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:18
|
939 |
+
msgid "Allow search"
|
940 |
+
msgstr ""
|
941 |
+
|
942 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:20
|
943 |
+
msgid "Display the search box for options."
|
944 |
+
msgstr ""
|
945 |
+
|
946 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:26
|
947 |
+
msgid "Select on close"
|
948 |
+
msgstr ""
|
949 |
+
|
950 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:28
|
951 |
+
msgid "Implements automatic selection when the dropdown is closed."
|
952 |
+
msgstr ""
|
953 |
+
|
954 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:32
|
955 |
+
msgid "Close on select"
|
956 |
+
msgstr ""
|
957 |
+
|
958 |
+
#: includes/view/backend/pages/modals/parts/panel-select2.php:34
|
959 |
+
msgid "Controls whether the dropdown is closed after a selection is made."
|
960 |
+
msgstr ""
|
961 |
+
|
962 |
+
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:4
|
963 |
+
msgid "Hour start"
|
964 |
+
msgstr ""
|
965 |
+
|
966 |
+
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:9
|
967 |
+
msgid "Hour end"
|
968 |
+
msgstr ""
|
969 |
+
|
970 |
+
#: includes/view/backend/pages/modals/parts/panel-timepicker.php:14
|
971 |
+
msgid "Minutes interval"
|
972 |
+
msgstr ""
|
973 |
+
|
974 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:3
|
975 |
+
msgid "General"
|
976 |
+
msgstr ""
|
977 |
+
|
978 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:7
|
979 |
+
msgid "Options"
|
980 |
+
msgstr ""
|
981 |
+
|
982 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:16
|
983 |
+
msgid "Display"
|
984 |
+
msgstr ""
|
985 |
+
|
986 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:25
|
987 |
+
msgid "Timepicker"
|
988 |
+
msgstr ""
|
989 |
+
|
990 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:30
|
991 |
+
msgid "Datepicker"
|
992 |
+
msgstr ""
|
993 |
+
|
994 |
+
#: includes/view/backend/pages/modals/parts/tabs.php:34
|
995 |
+
msgid "Admin"
|
996 |
+
msgstr ""
|
997 |
+
|
998 |
+
#: includes/view/backend/pages/order.php:3
|
999 |
+
msgid "Order settings"
|
1000 |
+
msgstr ""
|
1001 |
+
|
1002 |
+
#: includes/view/backend/pages/order.php:5
|
1003 |
+
msgid "Customize and manage the order settings."
|
1004 |
+
msgstr ""
|
1005 |
+
|
1006 |
+
#: includes/view/backend/pages/parts/actions.php:3
|
1007 |
+
msgid "+ Add New Field"
|
1008 |
+
msgstr ""
|
1009 |
+
|
1010 |
+
#: includes/view/backend/pages/parts/actions.php:4
|
1011 |
+
msgid "Import"
|
1012 |
+
msgstr ""
|
1013 |
+
|
1014 |
+
#: includes/view/backend/pages/parts/actions.php:5
|
1015 |
+
msgid "Reset"
|
1016 |
+
msgstr ""
|
1017 |
+
|
1018 |
+
#: includes/view/backend/pages/parts/header.php:5
|
1019 |
+
msgid ""
|
1020 |
+
"Thanks for using our product! We recommend these extensions that will add "
|
1021 |
+
"new features to stand out your business and improve your sales."
|
1022 |
+
msgstr ""
|
1023 |
+
|
1024 |
+
#: includes/view/backend/pages/parts/header.php:8
|
1025 |
+
msgid "Purchase"
|
1026 |
+
msgstr ""
|
1027 |
+
|
1028 |
+
#: includes/view/backend/pages/parts/header.php:9
|
1029 |
+
#: includes/view/backend/pages/parts/tabs.php:3
|
1030 |
+
msgid "Documentation"
|
1031 |
+
msgstr ""
|
1032 |
+
|
1033 |
+
#. Author of the plugin/theme
|
1034 |
+
#: includes/view/backend/pages/parts/header.php:25
|
1035 |
+
msgid "QuadLayers"
|
1036 |
+
msgstr ""
|
1037 |
+
|
1038 |
+
#: includes/view/backend/pages/parts/loop.php:9
|
1039 |
+
msgid "Required"
|
1040 |
+
msgstr ""
|
1041 |
+
|
1042 |
+
#: includes/view/backend/pages/parts/loop.php:10
|
1043 |
+
msgid "Position"
|
1044 |
+
msgstr ""
|
1045 |
+
|
1046 |
+
#: includes/view/backend/pages/parts/loop.php:18
|
1047 |
+
msgid "Disabled"
|
1048 |
+
msgstr ""
|
1049 |
+
|
1050 |
+
#: includes/view/backend/pages/parts/loop.php:29
|
1051 |
+
#, php-format
|
1052 |
+
msgid "Move the \"%s\" payment method up"
|
1053 |
+
msgstr ""
|
1054 |
+
|
1055 |
+
#: includes/view/backend/pages/parts/loop.php:29
|
1056 |
+
msgid "Move up"
|
1057 |
+
msgstr ""
|
1058 |
+
|
1059 |
+
#: includes/view/backend/pages/parts/loop.php:30
|
1060 |
+
#, php-format
|
1061 |
+
msgid "Move the \"%s\" payment method down"
|
1062 |
+
msgstr ""
|
1063 |
+
|
1064 |
+
#: includes/view/backend/pages/parts/loop.php:30
|
1065 |
+
msgid "Move down"
|
1066 |
+
msgstr ""
|
1067 |
+
|
1068 |
+
#: includes/view/backend/pages/parts/loop.php:38
|
1069 |
+
#: includes/view/backend/pages/parts/loop.php:56
|
1070 |
+
#: includes/view/backend/pages/parts/loop.php:103
|
1071 |
+
#, php-format
|
1072 |
+
msgid "The \"%s\" field currently enabled"
|
1073 |
+
msgstr ""
|
1074 |
+
|
1075 |
+
#: includes/view/backend/pages/parts/loop.php:40
|
1076 |
+
#: includes/view/backend/pages/parts/loop.php:58
|
1077 |
+
#: includes/view/backend/pages/parts/loop.php:105
|
1078 |
+
#, php-format
|
1079 |
+
msgid "The \"%s\" field currently disabled"
|
1080 |
+
msgstr ""
|
1081 |
+
|
1082 |
+
#: includes/view/backend/pages/parts/loop.php:47
|
1083 |
+
msgid "Wide"
|
1084 |
+
msgstr ""
|
1085 |
+
|
1086 |
+
#: includes/view/backend/pages/parts/loop.php:48
|
1087 |
+
msgid "Left"
|
1088 |
+
msgstr ""
|
1089 |
+
|
1090 |
+
#: includes/view/backend/pages/parts/loop.php:49
|
1091 |
+
msgid "Right"
|
1092 |
+
msgstr ""
|
1093 |
+
|
1094 |
+
#: includes/view/backend/pages/parts/loop.php:111
|
1095 |
+
#: includes/view/backend/pages/parts/loop.php:115
|
1096 |
+
msgid "Edit checkout field"
|
1097 |
+
msgstr ""
|
1098 |
+
|
1099 |
+
#: includes/view/backend/pages/parts/loop.php:111
|
1100 |
+
msgid "Edit"
|
1101 |
+
msgstr ""
|
1102 |
+
|
1103 |
+
#: includes/view/backend/pages/premium.php:8
|
1104 |
+
#, php-format
|
1105 |
+
msgid ""
|
1106 |
+
"%s allows you to customize, add, edit and delete fields displayed on the "
|
1107 |
+
"checkout page. With the premium version you can also create conditional "
|
1108 |
+
"fields and include custom fees based on the checkout fields."
|
1109 |
+
msgstr ""
|
1110 |
+
|
1111 |
+
#: includes/view/backend/pages/premium.php:11
|
1112 |
+
msgid "Purchase Now"
|
1113 |
+
msgstr ""
|
1114 |
+
|
1115 |
+
#: includes/view/backend/pages/premium.php:12
|
1116 |
+
msgid "Get Support"
|
1117 |
+
msgstr ""
|
1118 |
+
|
1119 |
+
#: includes/view/backend/pages/premium.php:16
|
1120 |
+
msgid "Add checkout fees"
|
1121 |
+
msgstr ""
|
1122 |
+
|
1123 |
+
#: includes/view/backend/pages/premium.php:18
|
1124 |
+
#, php-format
|
1125 |
+
msgid ""
|
1126 |
+
"%s allows you to include fees to each custom or core field. Fees can be "
|
1127 |
+
"fixed or percentage amounts based on checkout total."
|
1128 |
+
msgstr ""
|
1129 |
+
|
1130 |
+
#: includes/view/backend/pages/premium.php:22
|
1131 |
+
msgid "Remove account fields"
|
1132 |
+
msgstr ""
|
1133 |
+
|
1134 |
+
#: includes/view/backend/pages/premium.php:24
|
1135 |
+
msgid ""
|
1136 |
+
"By default all fields attached to the billing or shipping sections are "
|
1137 |
+
"included in the edit address area of the user account page. With the premium "
|
1138 |
+
"version, you can hide the fields on the checkout or my account page."
|
1139 |
+
msgstr ""
|
1140 |
+
|
1141 |
+
#: includes/view/backend/pages/premium.php:28
|
1142 |
+
msgid "Enhance select fields"
|
1143 |
+
msgstr ""
|
1144 |
+
|
1145 |
+
#: includes/view/backend/pages/premium.php:30
|
1146 |
+
msgid ""
|
1147 |
+
"The enhance options allow you to improve the behavior of the select and "
|
1148 |
+
"multiselect fields with the select2 jquery plugin."
|
1149 |
+
msgstr ""
|
1150 |
+
|
1151 |
+
#: includes/view/backend/pages/premium.php:45
|
1152 |
+
msgid "Display on admin list orders"
|
1153 |
+
msgstr ""
|
1154 |
+
|
1155 |
+
#: includes/view/backend/pages/premium.php:47
|
1156 |
+
msgid ""
|
1157 |
+
"This option allows you to display the fields in the WooCommerce order list."
|
1158 |
+
msgstr ""
|
1159 |
+
|
1160 |
+
#: includes/view/backend/pages/premium.php:51
|
1161 |
+
msgid "Allow sorting on admin list orders"
|
1162 |
+
msgstr ""
|
1163 |
+
|
1164 |
+
#: includes/view/backend/pages/premium.php:53
|
1165 |
+
msgid ""
|
1166 |
+
"This option allows you to sort the WooCommerce orders list based on the "
|
1167 |
+
"field values."
|
1168 |
+
msgstr ""
|
1169 |
+
|
1170 |
+
#: includes/view/backend/pages/premium.php:57
|
1171 |
+
msgid "Allow filtering on admin list orders"
|
1172 |
+
msgstr ""
|
1173 |
+
|
1174 |
+
#: includes/view/backend/pages/premium.php:59
|
1175 |
+
msgid ""
|
1176 |
+
"This option allows you to add a search field to filter the options based on "
|
1177 |
+
"the selected values."
|
1178 |
+
msgstr ""
|
1179 |
+
|
1180 |
+
#: includes/view/backend/pages/shipping.php:3
|
1181 |
+
msgid "Shipping fields"
|
1182 |
+
msgstr ""
|
1183 |
+
|
1184 |
+
#: includes/view/frontend/class-wooccm-fields-additional.php:26
|
1185 |
+
#, php-format
|
1186 |
+
msgid "%s is a required field."
|
1187 |
+
msgstr ""
|
1188 |
+
|
1189 |
+
#: includes/view/frontend/class-wooccm-fields-filters.php:27
|
1190 |
+
msgid "required"
|
1191 |
+
msgstr ""
|
1192 |
+
|
1193 |
+
#: includes/view/frontend/class-wooccm-fields-filters.php:29
|
1194 |
+
msgid "optional"
|
1195 |
+
msgstr ""
|
1196 |
+
|
1197 |
+
#: templates/order/order-custom-fields.php:1
|
1198 |
+
msgid "Custom fields"
|
1199 |
+
msgstr ""
|
1200 |
+
|
1201 |
+
#: templates/order/order-upload-files.php:6
|
1202 |
+
msgid "ID"
|
1203 |
+
msgstr ""
|
1204 |
+
|
1205 |
+
#: templates/order/order-upload-files.php:11
|
1206 |
+
msgid "Actions"
|
1207 |
+
msgstr ""
|
1208 |
+
|
1209 |
+
#. Plugin Name of the plugin/theme
|
1210 |
+
msgid "WooCommerce Checkout Manager"
|
1211 |
+
msgstr ""
|
1212 |
+
|
1213 |
+
#. Description of the plugin/theme
|
1214 |
+
msgid "Manages WooCommerce Checkout, the advanced way."
|
1215 |
+
msgstr ""
|
1216 |
+
|
1217 |
+
#. Author URI of the plugin/theme
|
1218 |
+
msgid "https://www.quadlayers.com"
|
1219 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/
|
|
4 |
Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 5.4.0
|
7 |
-
Stable tag: 5.0.
|
8 |
WC requires at least: 3.0
|
9 |
WC tested up to: 4.0
|
10 |
License: GPLv2 or later
|
@@ -107,6 +107,9 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
|
|
107 |
|
108 |
== Changelog ==
|
109 |
|
|
|
|
|
|
|
110 |
= 5.0.3 =
|
111 |
* Fix: woocommerce checkout checkbox required
|
112 |
|
4 |
Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 5.4.0
|
7 |
+
Stable tag: 5.0.4
|
8 |
WC requires at least: 3.0
|
9 |
WC tested up to: 4.0
|
10 |
License: GPLv2 or later
|
107 |
|
108 |
== Changelog ==
|
109 |
|
110 |
+
= 5.0.4 =
|
111 |
+
* Fix: woocommerce checkout datepicker required
|
112 |
+
|
113 |
= 5.0.3 =
|
114 |
* Fix: woocommerce checkout checkbox required
|
115 |
|
templates/order/order-custom-fields.php
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
<h2 class="woocommerce-order-details__title"><?php echo ($title = get_option('wooccm_order_custom_fields_title', false)) ? esc_html($title) : esc_html__('Custom fields', 'woocommerce-checkout-manager'); ?></h2>
|
2 |
-
<table class="woocommerce-table shop_table order_details">
|
3 |
-
<tbody>
|
4 |
-
<?php
|
5 |
-
if (count($checkout = WC()->checkout->get_checkout_fields())):
|
6 |
-
foreach ($checkout as $field_type => $fields) :
|
7 |
-
foreach ($fields as $key => $field) :
|
8 |
-
if (isset(WOOCCM()->$field_type)) :
|
9 |
-
?>
|
10 |
-
<?php if (!in_array($field['name'], WOOCCM()->$field_type->get_defaults()) && empty($field['hide_order'])) : ?>
|
11 |
-
<?php if ($value = get_post_meta($order_id, sprintf('_%s', $key), true)): ?>
|
12 |
-
<tr id="tr-<?php echo esc_attr($key); ?>">
|
13 |
-
<th>
|
14 |
-
<?php echo esc_html($field['label']); ?>
|
15 |
-
</th>
|
16 |
-
<td>
|
17 |
-
<?php echo esc_html($value); ?>
|
18 |
-
</td>
|
19 |
-
</tr>
|
20 |
-
<?php endif; ?>
|
21 |
-
<?php endif; ?>
|
22 |
-
<?php endif; ?>
|
23 |
-
<?php endforeach; ?>
|
24 |
-
<?php endforeach; ?>
|
25 |
-
<?php endif; ?>
|
26 |
-
</tbody>
|
27 |
</table>
|
1 |
+
<h2 class="woocommerce-order-details__title"><?php echo ($title = get_option('wooccm_order_custom_fields_title', false)) ? esc_html($title) : esc_html__('Custom fields', 'woocommerce-checkout-manager'); ?></h2>
|
2 |
+
<table class="woocommerce-table shop_table order_details">
|
3 |
+
<tbody>
|
4 |
+
<?php
|
5 |
+
if (count($checkout = WC()->checkout->get_checkout_fields())):
|
6 |
+
foreach ($checkout as $field_type => $fields) :
|
7 |
+
foreach ($fields as $key => $field) :
|
8 |
+
if (isset(WOOCCM()->$field_type)) :
|
9 |
+
?>
|
10 |
+
<?php if (!in_array($field['name'], WOOCCM()->$field_type->get_defaults()) && empty($field['hide_order'])) : ?>
|
11 |
+
<?php if ($value = get_post_meta($order_id, sprintf('_%s', $key), true)): ?>
|
12 |
+
<tr id="tr-<?php echo esc_attr($key); ?>">
|
13 |
+
<th>
|
14 |
+
<?php echo esc_html($field['label']); ?>
|
15 |
+
</th>
|
16 |
+
<td>
|
17 |
+
<?php echo esc_html($value); ?>
|
18 |
+
</td>
|
19 |
+
</tr>
|
20 |
+
<?php endif; ?>
|
21 |
+
<?php endif; ?>
|
22 |
+
<?php endif; ?>
|
23 |
+
<?php endforeach; ?>
|
24 |
+
<?php endforeach; ?>
|
25 |
+
<?php endif; ?>
|
26 |
+
</tbody>
|
27 |
</table>
|
templates/order/order-upload-files.php
CHANGED
@@ -1,58 +1,58 @@
|
|
1 |
-
<div class="wooccm_order_attachments_wrapper">
|
2 |
-
<h2 class="woocommerce-order-details__title"><?php echo ($title = get_option('wooccm_order_upload_files_title', false)) ? esc_html($title) : esc_html__('Uploaded files', 'woocommerce-checkout-manager'); ?></h2>
|
3 |
-
<table class="woocommerce_order_items shop_table">
|
4 |
-
<thead>
|
5 |
-
<tr>
|
6 |
-
<th><?php _e('File', 'woocommerce-checkout-manager'); ?></th>
|
7 |
-
<th><?php _e('Filename', 'woocommerce-checkout-manager'); ?></th>
|
8 |
-
<th><?php _e('Dimensions', 'woocommerce-checkout-manager'); ?></th>
|
9 |
-
<th><?php _e('Extension', ' woocommerce-checkout-manager'); ?></th>
|
10 |
-
<th class="column-actions"><?php _e('Actions', 'woocommerce-checkout-manager'); ?></th>
|
11 |
-
</tr>
|
12 |
-
</thead>
|
13 |
-
<tbody class="product_images">
|
14 |
-
<?php
|
15 |
-
if (!empty($attachments)) :
|
16 |
-
foreach ($attachments as $attachment_id) :
|
17 |
-
$image_attributes = wp_get_attachment_url($attachment_id);
|
18 |
-
$image_attributes2 = wp_get_attachment_image_src($attachment_id);
|
19 |
-
$filename = basename($image_attributes);
|
20 |
-
$wp_filetype = wp_check_filetype($filename);
|
21 |
-
?>
|
22 |
-
<tr class="image">
|
23 |
-
<td><?php echo wp_get_attachment_link($attachment_id, '', false, false, wp_get_attachment_image($attachment_id, array(75, 75), false)); ?></td>
|
24 |
-
<td><?php echo wp_get_attachment_link($attachment_id, '', false, false, preg_replace('/\.[^.]+$/', '', $filename)); ?></td>
|
25 |
-
<td>
|
26 |
-
<?php
|
27 |
-
if ($image_attributes2[1] == '') {
|
28 |
-
echo '-';
|
29 |
-
} else {
|
30 |
-
echo $image_attributes2[1] . ' x ' . $image_attributes2[2];
|
31 |
-
}
|
32 |
-
?>
|
33 |
-
</td>
|
34 |
-
<td><?php echo strtoupper($wp_filetype['ext']); ?></td>
|
35 |
-
<td class="column-actions">
|
36 |
-
<!--<a href="<?php echo esc_url($image_attributes2[0]); ?>" target="_blank" class="button"><?php esc_html_e('Download', 'woocommerce-checkout-manager'); ?></a>-->
|
37 |
-
<a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr($attachment_id); ?>" data-tip="<?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></a>
|
38 |
-
</td>
|
39 |
-
</tr>
|
40 |
-
<?php endforeach; ?>
|
41 |
-
<?php else: ?>
|
42 |
-
<tr>
|
43 |
-
<td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
|
44 |
-
</tr>
|
45 |
-
<?php endif; ?>
|
46 |
-
</tbody>
|
47 |
-
</table>
|
48 |
-
<input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
49 |
-
<input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
50 |
-
<p class="order-upload">
|
51 |
-
<a style="float: left; margin: 0 10px 0 0;" class="button alt fileinput-button">
|
52 |
-
<span><?php _e('Upload Files', 'woocommerce-checkout-manager'); ?></span>
|
53 |
-
<input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
|
54 |
-
</a>
|
55 |
-
<input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php _e('Save Changes', 'woocommerce-checkout-manager'); ?>" disabled="disabled">
|
56 |
-
<span class="wooccm_upload_results"></span>
|
57 |
-
</p>
|
58 |
</div>
|
1 |
+
<div class="wooccm_order_attachments_wrapper">
|
2 |
+
<h2 class="woocommerce-order-details__title"><?php echo ($title = get_option('wooccm_order_upload_files_title', false)) ? esc_html($title) : esc_html__('Uploaded files', 'woocommerce-checkout-manager'); ?></h2>
|
3 |
+
<table class="woocommerce_order_items shop_table">
|
4 |
+
<thead>
|
5 |
+
<tr>
|
6 |
+
<th><?php _e('File', 'woocommerce-checkout-manager'); ?></th>
|
7 |
+
<th><?php _e('Filename', 'woocommerce-checkout-manager'); ?></th>
|
8 |
+
<th><?php _e('Dimensions', 'woocommerce-checkout-manager'); ?></th>
|
9 |
+
<th><?php _e('Extension', ' woocommerce-checkout-manager'); ?></th>
|
10 |
+
<th class="column-actions"><?php _e('Actions', 'woocommerce-checkout-manager'); ?></th>
|
11 |
+
</tr>
|
12 |
+
</thead>
|
13 |
+
<tbody class="product_images">
|
14 |
+
<?php
|
15 |
+
if (!empty($attachments)) :
|
16 |
+
foreach ($attachments as $attachment_id) :
|
17 |
+
$image_attributes = wp_get_attachment_url($attachment_id);
|
18 |
+
$image_attributes2 = wp_get_attachment_image_src($attachment_id);
|
19 |
+
$filename = basename($image_attributes);
|
20 |
+
$wp_filetype = wp_check_filetype($filename);
|
21 |
+
?>
|
22 |
+
<tr class="image">
|
23 |
+
<td><?php echo wp_get_attachment_link($attachment_id, '', false, false, wp_get_attachment_image($attachment_id, array(75, 75), false)); ?></td>
|
24 |
+
<td><?php echo wp_get_attachment_link($attachment_id, '', false, false, preg_replace('/\.[^.]+$/', '', $filename)); ?></td>
|
25 |
+
<td>
|
26 |
+
<?php
|
27 |
+
if ($image_attributes2[1] == '') {
|
28 |
+
echo '-';
|
29 |
+
} else {
|
30 |
+
echo $image_attributes2[1] . ' x ' . $image_attributes2[2];
|
31 |
+
}
|
32 |
+
?>
|
33 |
+
</td>
|
34 |
+
<td><?php echo strtoupper($wp_filetype['ext']); ?></td>
|
35 |
+
<td class="column-actions">
|
36 |
+
<!--<a href="<?php echo esc_url($image_attributes2[0]); ?>" target="_blank" class="button"><?php esc_html_e('Download', 'woocommerce-checkout-manager'); ?></a>-->
|
37 |
+
<a class="button wooccm_delete_attachment" data-attachment_id="<?php echo esc_attr($attachment_id); ?>" data-tip="<?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?>"><?php esc_html_e('Delete', 'woocommerce-checkout-manager'); ?></a>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
<?php endforeach; ?>
|
41 |
+
<?php else: ?>
|
42 |
+
<tr>
|
43 |
+
<td colspan="6" style="text-align:left;"><?php esc_html_e('No files have been uploaded to this order.', 'woocommerce-checkout-manager'); ?></td>
|
44 |
+
</tr>
|
45 |
+
<?php endif; ?>
|
46 |
+
</tbody>
|
47 |
+
</table>
|
48 |
+
<input type="hidden" id="delete_attachments_ids" name="delete_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
49 |
+
<input type="hidden" id="all_attachments_ids" name="all_attachments_ids" value="<?php echo esc_attr(implode(',', $attachments)); ?>" />
|
50 |
+
<p class="order-upload">
|
51 |
+
<a style="float: left; margin: 0 10px 0 0;" class="button alt fileinput-button">
|
52 |
+
<span><?php _e('Upload Files', 'woocommerce-checkout-manager'); ?></span>
|
53 |
+
<input data-order_id="<?php echo esc_attr($order->get_id()); ?>" type="file" name="wooccm_order_attachment_upload" id="wooccm_order_attachment_upload" multiple />
|
54 |
+
</a>
|
55 |
+
<input type="button" id="wooccm_order_attachment_update" class="button button-secondary" value="<?php _e('Save Changes', 'woocommerce-checkout-manager'); ?>" disabled="disabled">
|
56 |
+
<span class="wooccm_upload_results"></span>
|
57 |
+
</p>
|
58 |
</div>
|
woocommerce-checkout-manager.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Plugin Name: WooCommerce Checkout Manager
|
5 |
* Description: Manages WooCommerce Checkout, the advanced way.
|
6 |
-
* Version: 5.0.
|
7 |
* Author: QuadLayers
|
8 |
* Author URI: https://www.quadlayers.com
|
9 |
* Copyright: 2019 QuadLayers (https://www.quadlayers.com)
|
@@ -17,7 +17,7 @@ if (!defined('WOOCCM_PLUGIN_NAME')) {
|
|
17 |
define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
|
18 |
}
|
19 |
if (!defined('WOOCCM_PLUGIN_VERSION')) {
|
20 |
-
define('WOOCCM_PLUGIN_VERSION', '5.0.
|
21 |
}
|
22 |
if (!defined('WOOCCM_PLUGIN_FILE')) {
|
23 |
define('WOOCCM_PLUGIN_FILE', __FILE__);
|
3 |
/**
|
4 |
* Plugin Name: WooCommerce Checkout Manager
|
5 |
* Description: Manages WooCommerce Checkout, the advanced way.
|
6 |
+
* Version: 5.0.4
|
7 |
* Author: QuadLayers
|
8 |
* Author URI: https://www.quadlayers.com
|
9 |
* Copyright: 2019 QuadLayers (https://www.quadlayers.com)
|
17 |
define('WOOCCM_PLUGIN_NAME', 'WooCommerce Checkout Manager');
|
18 |
}
|
19 |
if (!defined('WOOCCM_PLUGIN_VERSION')) {
|
20 |
+
define('WOOCCM_PLUGIN_VERSION', '5.0.4');
|
21 |
}
|
22 |
if (!defined('WOOCCM_PLUGIN_FILE')) {
|
23 |
define('WOOCCM_PLUGIN_FILE', __FILE__);
|