Version Description
- Fix: woocommerce product addons compatibility
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Direct Checkout |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- assets/qlwcdc.css +79 -79
- assets/qlwcdc.js +309 -293
- assets/qlwcdc.min.css +1 -1
- assets/qlwcdc.min.js +5 -2
- includes/archives.php +272 -272
- includes/checkout.php +261 -261
- includes/general.php +183 -183
- includes/products.php +528 -503
- includes/purchase.php +119 -119
- languages/woocommerce-direct-checkout-es_ES.po +545 -545
- languages/woocommerce-direct-checkout.pot +518 -518
- readme.txt +4 -1
- woocommerce-direct-checkout.php +480 -480
assets/qlwcdc.css
CHANGED
@@ -1,80 +1,80 @@
|
|
1 |
-
#qlwcdc_quick_view_modal.modal {
|
2 |
-
display: none;
|
3 |
-
position: fixed;
|
4 |
-
z-index: 999999;
|
5 |
-
left: 0;
|
6 |
-
top: 0;
|
7 |
-
width: 100%;
|
8 |
-
height: 100%;
|
9 |
-
overflow: auto;
|
10 |
-
background-color: rgb(0,0,0);
|
11 |
-
background-color: rgba(0,0,0,0.4);
|
12 |
-
}
|
13 |
-
|
14 |
-
#qlwcdc_quick_view_modal.modal.open,
|
15 |
-
#qlwcdc_quick_view_modal.modal.closing,
|
16 |
-
#qlwcdc_quick_view_modal.modal.opening {
|
17 |
-
display: block;
|
18 |
-
}
|
19 |
-
|
20 |
-
#qlwcdc_quick_view_modal .modal-dialog {
|
21 |
-
display: flex;
|
22 |
-
height: 100%;
|
23 |
-
width: 100%;
|
24 |
-
}
|
25 |
-
|
26 |
-
#qlwcdc_quick_view_modal .modal-content {
|
27 |
-
top: -30px;
|
28 |
-
opacity: 0;
|
29 |
-
transform: scale(2,2);
|
30 |
-
position: relative;
|
31 |
-
width: 80%;
|
32 |
-
max-width: 860px;
|
33 |
-
background-color: #fff;
|
34 |
-
margin: auto;
|
35 |
-
padding: 0;
|
36 |
-
border: 1px solid rgba(0,0,0,0.1);
|
37 |
-
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1), 0 6px 20px 0 rgba(0,0,0,0.1);
|
38 |
-
border-radius: 5px;
|
39 |
-
transition: all 400ms cubic-bezier(0.215, 0.61, 0.355, 1), opacity 300ms ease-in;
|
40 |
-
}
|
41 |
-
|
42 |
-
#qlwcdc_quick_view_modal.modal.open .modal-content {
|
43 |
-
top: 0;
|
44 |
-
opacity: 1;
|
45 |
-
transform: scale(1,1);
|
46 |
-
}
|
47 |
-
|
48 |
-
#qlwcdc_quick_view_modal .modal-header,
|
49 |
-
#qlwcdc_quick_view_modal .modal-footer,
|
50 |
-
#qlwcdc_quick_view_modal .modal-body {
|
51 |
-
padding: 2em;
|
52 |
-
clear: both;
|
53 |
-
overflow: hidden;
|
54 |
-
}
|
55 |
-
|
56 |
-
#qlwcdc_quick_view_modal .modal-header,
|
57 |
-
#qlwcdc_quick_view_modal .modal-footer {
|
58 |
-
background-color: #eee;
|
59 |
-
}
|
60 |
-
|
61 |
-
#qlwcdc_quick_view_modal .close {
|
62 |
-
color: #aaa;
|
63 |
-
float: right;
|
64 |
-
font-size: 28px;
|
65 |
-
font-weight: bold;
|
66 |
-
}
|
67 |
-
|
68 |
-
#qlwcdc_quick_view_modal .close:hover,
|
69 |
-
#qlwcdc_quick_view_modal .close:focus {
|
70 |
-
color: black;
|
71 |
-
text-decoration: none;
|
72 |
-
cursor: pointer;
|
73 |
-
}
|
74 |
-
|
75 |
-
#qlwcdc_quick_view_modal.modal .single-product div.product .images,
|
76 |
-
#qlwcdc_quick_view_modal.modal .single-product div.product .summary,
|
77 |
-
#qlwcdc_quick_view_modal.modal .single-product div.product .woocommerce-product-gallery {
|
78 |
-
margin-top: 0;
|
79 |
-
margin-bottom: 0;
|
80 |
Â
}
|
1 |
+
#qlwcdc_quick_view_modal.modal {
|
2 |
+
display: none;
|
3 |
+
position: fixed;
|
4 |
+
z-index: 999999;
|
5 |
+
left: 0;
|
6 |
+
top: 0;
|
7 |
+
width: 100%;
|
8 |
+
height: 100%;
|
9 |
+
overflow: auto;
|
10 |
+
background-color: rgb(0,0,0);
|
11 |
+
background-color: rgba(0,0,0,0.4);
|
12 |
+
}
|
13 |
+
|
14 |
+
#qlwcdc_quick_view_modal.modal.open,
|
15 |
+
#qlwcdc_quick_view_modal.modal.closing,
|
16 |
+
#qlwcdc_quick_view_modal.modal.opening {
|
17 |
+
display: block;
|
18 |
+
}
|
19 |
+
|
20 |
+
#qlwcdc_quick_view_modal .modal-dialog {
|
21 |
+
display: flex;
|
22 |
+
height: 100%;
|
23 |
+
width: 100%;
|
24 |
+
}
|
25 |
+
|
26 |
+
#qlwcdc_quick_view_modal .modal-content {
|
27 |
+
top: -30px;
|
28 |
+
opacity: 0;
|
29 |
+
transform: scale(2,2);
|
30 |
+
position: relative;
|
31 |
+
width: 80%;
|
32 |
+
max-width: 860px;
|
33 |
+
background-color: #fff;
|
34 |
+
margin: auto;
|
35 |
+
padding: 0;
|
36 |
+
border: 1px solid rgba(0,0,0,0.1);
|
37 |
+
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1), 0 6px 20px 0 rgba(0,0,0,0.1);
|
38 |
+
border-radius: 5px;
|
39 |
+
transition: all 400ms cubic-bezier(0.215, 0.61, 0.355, 1), opacity 300ms ease-in;
|
40 |
+
}
|
41 |
+
|
42 |
+
#qlwcdc_quick_view_modal.modal.open .modal-content {
|
43 |
+
top: 0;
|
44 |
+
opacity: 1;
|
45 |
+
transform: scale(1,1);
|
46 |
+
}
|
47 |
+
|
48 |
+
#qlwcdc_quick_view_modal .modal-header,
|
49 |
+
#qlwcdc_quick_view_modal .modal-footer,
|
50 |
+
#qlwcdc_quick_view_modal .modal-body {
|
51 |
+
padding: 2em;
|
52 |
+
clear: both;
|
53 |
+
overflow: hidden;
|
54 |
+
}
|
55 |
+
|
56 |
+
#qlwcdc_quick_view_modal .modal-header,
|
57 |
+
#qlwcdc_quick_view_modal .modal-footer {
|
58 |
+
background-color: #eee;
|
59 |
+
}
|
60 |
+
|
61 |
+
#qlwcdc_quick_view_modal .close {
|
62 |
+
color: #aaa;
|
63 |
+
float: right;
|
64 |
+
font-size: 28px;
|
65 |
+
font-weight: bold;
|
66 |
+
}
|
67 |
+
|
68 |
+
#qlwcdc_quick_view_modal .close:hover,
|
69 |
+
#qlwcdc_quick_view_modal .close:focus {
|
70 |
+
color: black;
|
71 |
+
text-decoration: none;
|
72 |
+
cursor: pointer;
|
73 |
+
}
|
74 |
+
|
75 |
+
#qlwcdc_quick_view_modal.modal .single-product div.product .images,
|
76 |
+
#qlwcdc_quick_view_modal.modal .single-product div.product .summary,
|
77 |
+
#qlwcdc_quick_view_modal.modal .single-product div.product .woocommerce-product-gallery {
|
78 |
+
margin-top: 0;
|
79 |
+
margin-bottom: 0;
|
80 |
Â
}
|
assets/qlwcdc.js
CHANGED
@@ -1,294 +1,310 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
var
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
$response
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
$(
|
152 |
-
},
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
}
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
}
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
294 |
Â
})(jQuery);
|
1 |
+
/**
|
2 |
+
* Version: 2.1.2
|
3 |
+
*/
|
4 |
+
|
5 |
+
(function ($) {
|
6 |
+
|
7 |
+
var timeout;
|
8 |
+
var delay = 1000;
|
9 |
+
var is_blocked = function ($node) {
|
10 |
+
return $node.is('.processing') || $node.parents('.processing').length;
|
11 |
+
};
|
12 |
+
var block = function ($node) {
|
13 |
+
if (!is_blocked($node)) {
|
14 |
+
$node.addClass('processing').block({
|
15 |
+
message: null,
|
16 |
+
overlayCSS: {
|
17 |
+
background: '#fff',
|
18 |
+
opacity: 0.6
|
19 |
+
}
|
20 |
+
});
|
21 |
+
}
|
22 |
+
};
|
23 |
+
var unblock = function ($node) {
|
24 |
+
$node.removeClass('processing').unblock();
|
25 |
+
};
|
26 |
+
$(document).on('click', '.qlwcdc_quick_view', function (e) {
|
27 |
+
e.stopPropagation();
|
28 |
+
e.preventDefault();
|
29 |
+
var product_id = $(this).data('product_id'),
|
30 |
+
$modal = $('#qlwcdc_quick_view_modal');
|
31 |
+
if (product_id && woocommerce_params.ajax_url) {
|
32 |
+
|
33 |
+
$.ajax({
|
34 |
+
type: 'post',
|
35 |
+
url: woocommerce_params.ajax_url,
|
36 |
+
data: {
|
37 |
+
action: 'qlwcdc_quick_view_modal',
|
38 |
+
nonce: qlwcdc.nonce,
|
39 |
+
product_id: product_id
|
40 |
+
},
|
41 |
+
complete: function (response) {
|
42 |
+
|
43 |
+
$modal.addClass('opening');
|
44 |
+
setTimeout(function () {
|
45 |
+
$modal.addClass('open');
|
46 |
+
$modal.removeClass('opening');
|
47 |
+
}, 50);
|
48 |
+
},
|
49 |
+
success: function (response) {
|
50 |
+
|
51 |
+
var $response = $(response);
|
52 |
+
$response.find('.woocommerce-product-gallery').each(function () {
|
53 |
+
$(this).wc_product_gallery();
|
54 |
+
});
|
55 |
+
$response.on('click', '.close', function (e) {
|
56 |
+
$modal.addClass('closing');
|
57 |
+
setTimeout(function () {
|
58 |
+
$modal.removeClass('open');
|
59 |
+
$modal.removeClass('closing');
|
60 |
+
}, 600);
|
61 |
+
});
|
62 |
+
$modal.find('.modal-content').replaceWith($response)
|
63 |
+
}
|
64 |
+
});
|
65 |
+
}
|
66 |
+
|
67 |
+
return false;
|
68 |
+
});
|
69 |
+
|
70 |
+
$('#qlwcdc_quick_view_modal').on('click', function (e) {
|
71 |
+
var $modal = $(this);
|
72 |
+
if (!$modal.closest('.modal-body').length) {
|
73 |
+
$modal.addClass('closing');
|
74 |
+
setTimeout(function () {
|
75 |
+
$modal.removeClass('open');
|
76 |
+
$modal.removeClass('closing');
|
77 |
+
}, 600);
|
78 |
+
}
|
79 |
+
});
|
80 |
+
|
81 |
+
$(document).on('submit', 'form.cart', function (e) {
|
82 |
+
|
83 |
+
var $button = $(e.delegateTarget.activeElement);
|
84 |
+
|
85 |
+
if ($button.hasClass('qlwcdc_quick_purchase')) {
|
86 |
+
|
87 |
+
var $form = $(this),
|
88 |
+
product_id = $form.find('[name=add-to-cart]').val() || 0,
|
89 |
+
variation_id = $form.find('[name=variation_id]').val() || 0,
|
90 |
+
quantity = $form.find('[name=quantity]').val() || 1,
|
91 |
+
addons = $form.find('.wc-pao-addon-field').serialize().replace(/\%5B%5D/g, '[]') || 0;
|
92 |
+
|
93 |
+
$button.attr('data-href', function (i, h) {
|
94 |
+
if (h.indexOf('?') != -1) {
|
95 |
+
$button.attr('data-href', $button.attr('data-href') + '&add-to-cart=' + product_id);
|
96 |
+
} else {
|
97 |
+
$button.attr('data-href', $button.attr('data-href') + '?add-to-cart=' + product_id);
|
98 |
+
}
|
99 |
+
});
|
100 |
+
|
101 |
+
if (variation_id) {
|
102 |
+
$button.attr('data-href', $button.attr('data-href') + '&variation_id=' + variation_id);
|
103 |
+
}
|
104 |
+
|
105 |
+
if (quantity) {
|
106 |
+
$button.attr('data-href', $button.attr('data-href') + '&quantity=' + quantity);
|
107 |
+
}
|
108 |
+
|
109 |
+
if (addons) {
|
110 |
+
$button.attr('data-href', $button.attr('data-href') + '&' + addons);
|
111 |
+
}
|
112 |
+
|
113 |
+
//console.log($button.attr('data-href'));
|
114 |
+
|
115 |
+
if ($button.attr('data-href') != 'undefined') {
|
116 |
+
|
117 |
+
window.location = $button.attr('data-href');
|
118 |
+
|
119 |
+
return false;
|
120 |
+
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
});
|
125 |
+
|
126 |
+
/*$(document).on('click', '.single_add_to_cart_button:not(.qlwcdc_quick_purchase):not(.disabled)', function (e) {
|
127 |
+
|
128 |
+
if (qlwcdc.add_product_cart !== 'no') {
|
129 |
+
|
130 |
+
var $thisbutton = $(this),
|
131 |
+
$form = $thisbutton.closest('form.cart'),
|
132 |
+
quantity = $form.find('input[name=quantity]').val() || 1,
|
133 |
+
product_id = $form.find('input[name=variation_id]').val() || $thisbutton.val();
|
134 |
+
|
135 |
+
if (product_id) {
|
136 |
+
|
137 |
+
e.preventDefault();
|
138 |
+
|
139 |
+
var data = {
|
140 |
+
'product_id': product_id,
|
141 |
+
'quantity': quantity
|
142 |
+
};
|
143 |
+
|
144 |
+
$(document.body).trigger('adding_to_cart', [$thisbutton, data]);
|
145 |
+
|
146 |
+
$.ajax({
|
147 |
+
type: 'POST',
|
148 |
+
url: woocommerce_params.wc_ajax_url.toString().replace('%%endpoint%%', 'add_to_cart'),
|
149 |
+
data: data,
|
150 |
+
beforeSend: function (response) {
|
151 |
+
$thisbutton.removeClass('added').addClass('loading');
|
152 |
+
},
|
153 |
+
complete: function (response) {
|
154 |
+
$thisbutton.addClass('added').removeClass('loading');
|
155 |
+
},
|
156 |
+
success: function (response) {
|
157 |
+
|
158 |
+
//if (response.error & response.product_url) {
|
159 |
+
// window.location = response.product_url;
|
160 |
+
// return;
|
161 |
+
//}
|
162 |
+
|
163 |
+
//console.log('test 2');
|
164 |
+
//console.log(data);
|
165 |
+
//console.log(response.cart_hash);
|
166 |
+
|
167 |
+
$(document.body).trigger('added_to_cart', [response.fragments, response.cart_hash, $thisbutton]);
|
168 |
+
},
|
169 |
+
});
|
170 |
+
|
171 |
+
return false;
|
172 |
+
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
});*/
|
177 |
+
|
178 |
+
/*$(document).bind('added_to_cart_message', function (e, cart) {
|
179 |
+
|
180 |
+
$.ajax({
|
181 |
+
type: 'POST',
|
182 |
+
url: woocommerce_params.ajax_url,
|
183 |
+
data: {
|
184 |
+
action: 'qlwcdc_add_product_cart_ajax_message',
|
185 |
+
'queried_object_id': qlwcdc.queried_object_id,
|
186 |
+
nonce: qlwcdc.nonce
|
187 |
+
},
|
188 |
+
beforeSend: function (response) {
|
189 |
+
block($('.woocommerce-notices-wrapper:first'));
|
190 |
+
},
|
191 |
+
complete: function (response) {
|
192 |
+
unblock($('.woocommerce-notices-wrapper:first'));
|
193 |
+
},
|
194 |
+
success: function (response) {
|
195 |
+
console.log(response);
|
196 |
+
if (response) {
|
197 |
+
$('.woocommerce-notices-wrapper:first').replaceWith(response);
|
198 |
+
}
|
199 |
+
},
|
200 |
+
});
|
201 |
+
});*/
|
202 |
+
|
203 |
+
$(document).on('keyup', '#qlwcdc_order_coupon_code', function (e) {
|
204 |
+
|
205 |
+
var $form = $(this),
|
206 |
+
$coupon = $(this).find('input[name="coupon_code"]'),
|
207 |
+
coupon_code = $coupon.val();
|
208 |
+
|
209 |
+
if (timeout) {
|
210 |
+
clearTimeout(timeout);
|
211 |
+
}
|
212 |
+
|
213 |
+
if (!coupon_code) {
|
214 |
+
return;
|
215 |
+
}
|
216 |
+
|
217 |
+
timeout = setTimeout(function () {
|
218 |
+
|
219 |
+
if ($form.is('.processing')) {
|
220 |
+
return false;
|
221 |
+
}
|
222 |
+
|
223 |
+
$form.addClass('processing').block({
|
224 |
+
message: null,
|
225 |
+
overlayCSS: {
|
226 |
+
background: '#fff',
|
227 |
+
opacity: 0.6
|
228 |
+
}
|
229 |
+
});
|
230 |
+
|
231 |
+
var data = {
|
232 |
+
security: wc_checkout_params.apply_coupon_nonce,
|
233 |
+
coupon_code: coupon_code
|
234 |
+
};
|
235 |
+
|
236 |
+
$.ajax({
|
237 |
+
type: 'POST',
|
238 |
+
url: wc_checkout_params.wc_ajax_url.toString().replace('%%endpoint%%', 'apply_coupon'),
|
239 |
+
data: data,
|
240 |
+
success: function (code) {
|
241 |
+
$form.removeClass('processing').unblock();
|
242 |
+
if (code) {
|
243 |
+
$coupon.before($(code).hide().fadeIn());
|
244 |
+
setTimeout(function () {
|
245 |
+
$(document.body).trigger('update_checkout', {update_shipping_method: false});
|
246 |
+
}, delay * 2);
|
247 |
+
}
|
248 |
+
},
|
249 |
+
dataType: 'html'
|
250 |
+
});
|
251 |
+
return false;
|
252 |
+
}, delay);
|
253 |
+
});
|
254 |
+
|
255 |
+
$('#order_review').on('change', 'input.qty', function (e) {
|
256 |
+
e.preventDefault();
|
257 |
+
var $qty = $(this);
|
258 |
+
setTimeout(function () {
|
259 |
+
|
260 |
+
var hash = $qty.attr('name').replace(/cart\[([\w]+)\]\[qty\]/g, "$1"),
|
261 |
+
qty = parseFloat($qty.val());
|
262 |
+
$.ajax({
|
263 |
+
type: 'post',
|
264 |
+
url: woocommerce_params.ajax_url,
|
265 |
+
data: {
|
266 |
+
action: 'qlwcdc_update_cart',
|
267 |
+
nonce: qlwcdc.nonce,
|
268 |
+
hash: hash,
|
269 |
+
quantity: qty
|
270 |
+
},
|
271 |
+
beforeSend: function (response) {
|
272 |
+
block($('#order_review'));
|
273 |
+
},
|
274 |
+
complete: function (response) {
|
275 |
+
unblock($('#order_review'));
|
276 |
+
},
|
277 |
+
success: function (response) {
|
278 |
+
if (response) {
|
279 |
+
$('#order_review').html($(response).html());
|
280 |
+
}
|
281 |
+
},
|
282 |
+
});
|
283 |
+
}, 400);
|
284 |
+
});
|
285 |
+
$('#order_review').on('click', 'a.remove', function (e) {
|
286 |
+
e.preventDefault();
|
287 |
+
var hash = $(this).data('cart_item_key');
|
288 |
+
$.ajax({
|
289 |
+
type: 'post',
|
290 |
+
url: woocommerce_params.ajax_url,
|
291 |
+
data: {
|
292 |
+
action: 'qlwcdc_update_cart',
|
293 |
+
nonce: qlwcdc.nonce,
|
294 |
+
quantity: 0,
|
295 |
+
hash: hash
|
296 |
+
},
|
297 |
+
beforeSend: function (response) {
|
298 |
+
block($('#order_review'));
|
299 |
+
},
|
300 |
+
complete: function (response) {
|
301 |
+
unblock($('#order_review'));
|
302 |
+
},
|
303 |
+
success: function (response) {
|
304 |
+
if (response) {
|
305 |
+
$('#order_review').html($(response).html());
|
306 |
+
}
|
307 |
+
},
|
308 |
+
});
|
309 |
+
});
|
310 |
Â
})(jQuery);
|
assets/qlwcdc.min.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
|
2 |
Â
#qlwcdc_quick_view_modal.modal{display:none;position:fixed;z-index:999999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,0.4)}#qlwcdc_quick_view_modal.modal.open,#qlwcdc_quick_view_modal.modal.closing,#qlwcdc_quick_view_modal.modal.opening{display:block}#qlwcdc_quick_view_modal .modal-dialog{display:flex;height:100%;width:100%}#qlwcdc_quick_view_modal .modal-content{top:-30px;opacity:0;transform:scale(2,2);position:relative;width:80%;max-width:860px;background-color:#fff;margin:auto;padding:0;border:1px solid rgba(0,0,0,0.1);box-shadow:0 4px 8px 0 rgba(0,0,0,0.1),0 6px 20px 0 rgba(0,0,0,0.1);border-radius:5px;transition:all 400ms cubic-bezier(0.215,0.61,0.355,1),opacity 300ms ease-in}#qlwcdc_quick_view_modal.modal.open .modal-content{top:0;opacity:1;transform:scale(1,1)}#qlwcdc_quick_view_modal .modal-header,#qlwcdc_quick_view_modal .modal-footer,#qlwcdc_quick_view_modal .modal-body{padding:2em;clear:both;overflow:hidden}#qlwcdc_quick_view_modal .modal-header,#qlwcdc_quick_view_modal .modal-footer{background-color:#eee}#qlwcdc_quick_view_modal .close{color:#aaa;float:right;font-size:28px;font-weight:bold}#qlwcdc_quick_view_modal .close:hover,#qlwcdc_quick_view_modal .close:focus{color:black;text-decoration:none;cursor:pointer}#qlwcdc_quick_view_modal.modal .single-product div.product .images,#qlwcdc_quick_view_modal.modal .single-product div.product .summary,#qlwcdc_quick_view_modal.modal .single-product div.product .woocommerce-product-gallery{margin-top:0;margin-bottom:0}
|
1 |
+
|
2 |
Â
#qlwcdc_quick_view_modal.modal{display:none;position:fixed;z-index:999999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,0.4)}#qlwcdc_quick_view_modal.modal.open,#qlwcdc_quick_view_modal.modal.closing,#qlwcdc_quick_view_modal.modal.opening{display:block}#qlwcdc_quick_view_modal .modal-dialog{display:flex;height:100%;width:100%}#qlwcdc_quick_view_modal .modal-content{top:-30px;opacity:0;transform:scale(2,2);position:relative;width:80%;max-width:860px;background-color:#fff;margin:auto;padding:0;border:1px solid rgba(0,0,0,0.1);box-shadow:0 4px 8px 0 rgba(0,0,0,0.1),0 6px 20px 0 rgba(0,0,0,0.1);border-radius:5px;transition:all 400ms cubic-bezier(0.215,0.61,0.355,1),opacity 300ms ease-in}#qlwcdc_quick_view_modal.modal.open .modal-content{top:0;opacity:1;transform:scale(1,1)}#qlwcdc_quick_view_modal .modal-header,#qlwcdc_quick_view_modal .modal-footer,#qlwcdc_quick_view_modal .modal-body{padding:2em;clear:both;overflow:hidden}#qlwcdc_quick_view_modal .modal-header,#qlwcdc_quick_view_modal .modal-footer{background-color:#eee}#qlwcdc_quick_view_modal .close{color:#aaa;float:right;font-size:28px;font-weight:bold}#qlwcdc_quick_view_modal .close:hover,#qlwcdc_quick_view_modal .close:focus{color:black;text-decoration:none;cursor:pointer}#qlwcdc_quick_view_modal.modal .single-product div.product .images,#qlwcdc_quick_view_modal.modal .single-product div.product .summary,#qlwcdc_quick_view_modal.modal .single-product div.product .woocommerce-product-gallery{margin-top:0;margin-bottom:0}
|
assets/qlwcdc.min.js
CHANGED
@@ -1,2 +1,5 @@
|
|
1 |
-
|
2 |
-
|
Â
|
|
Â
|
|
Â
|
1 |
+
/**
|
2 |
+
* Version: 2.1.2
|
3 |
+
*/
|
4 |
+
|
5 |
+
(function(d){var c;var b=1000;var e=function(g){return g.is(".processing")||g.parents(".processing").length};var f=function(g){if(!e(g)){g.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(g){g.removeClass("processing").unblock()};d(document).on("click",".qlwcdc_quick_view",function(i){i.stopPropagation();i.preventDefault();var h=d(this).data("product_id"),g=d("#qlwcdc_quick_view_modal");if(h&&woocommerce_params.ajax_url){d.ajax({type:"post",url:woocommerce_params.ajax_url,data:{action:"qlwcdc_quick_view_modal",nonce:qlwcdc.nonce,product_id:h},complete:function(j){g.addClass("opening");setTimeout(function(){g.addClass("open");g.removeClass("opening")},50)},success:function(k){var j=d(k);j.find(".woocommerce-product-gallery").each(function(){d(this).wc_product_gallery()});j.on("click",".close",function(l){g.addClass("closing");setTimeout(function(){g.removeClass("open");g.removeClass("closing")},600)});g.find(".modal-content").replaceWith(j)}})}return false});d("#qlwcdc_quick_view_modal").on("click",function(h){var g=d(this);if(!g.closest(".modal-body").length){g.addClass("closing");setTimeout(function(){g.removeClass("open");g.removeClass("closing")},600)}});d(document).on("submit","form.cart",function(m){var j=d(m.delegateTarget.activeElement);if(j.hasClass("qlwcdc_quick_purchase")){var g=d(this),h=g.find("[name=add-to-cart]").val()||0,i=g.find("[name=variation_id]").val()||0,l=g.find("[name=quantity]").val()||1,k=g.find(".wc-pao-addon-field").serialize().replace(/\%5B%5D/g,"[]")||0;j.attr("data-href",function(n,o){if(o.indexOf("?")!=-1){j.attr("data-href",j.attr("data-href")+"&add-to-cart="+h)}else{j.attr("data-href",j.attr("data-href")+"?add-to-cart="+h)}});if(i){j.attr("data-href",j.attr("data-href")+"&variation_id="+i)}if(l){j.attr("data-href",j.attr("data-href")+"&quantity="+l)}if(k){j.attr("data-href",j.attr("data-href")+"&"+k)}if(j.attr("data-href")!="undefined"){window.location=j.attr("data-href");return false}}});d(document).on("keyup","#qlwcdc_order_coupon_code",function(j){var h=d(this),i=d(this).find('input[name="coupon_code"]'),g=i.val();if(c){clearTimeout(c)}if(!g){return}c=setTimeout(function(){if(h.is(".processing")){return false}h.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}});var k={security:wc_checkout_params.apply_coupon_nonce,coupon_code:g};d.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","apply_coupon"),data:k,success:function(l){h.removeClass("processing").unblock();if(l){i.before(d(l).hide().fadeIn());setTimeout(function(){d(document.body).trigger("update_checkout",{update_shipping_method:false})},b*2)}},dataType:"html"});return false},b)});d("#order_review").on("change","input.qty",function(h){h.preventDefault();var g=d(this);setTimeout(function(){var i=g.attr("name").replace(/cart\[([\w]+)\]\[qty\]/g,"$1"),j=parseFloat(g.val());d.ajax({type:"post",url:woocommerce_params.ajax_url,data:{action:"qlwcdc_update_cart",nonce:qlwcdc.nonce,hash:i,quantity:j},beforeSend:function(k){f(d("#order_review"))},complete:function(k){a(d("#order_review"))},success:function(k){if(k){d("#order_review").html(d(k).html())}},})},400)});d("#order_review").on("click","a.remove",function(h){h.preventDefault();var g=d(this).data("cart_item_key");d.ajax({type:"post",url:woocommerce_params.ajax_url,data:{action:"qlwcdc_update_cart",nonce:qlwcdc.nonce,quantity:0,hash:g},beforeSend:function(i){f(d("#order_review"))},complete:function(i){a(d("#order_review"))},success:function(i){if(i){d("#order_review").html(d(i).html())}},})})})(jQuery);
|
includes/archives.php
CHANGED
@@ -1,273 +1,273 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
die('-1');
|
5 |
-
}
|
6 |
-
|
7 |
-
if (!class_exists('QLWCDC_Archives')) {
|
8 |
-
|
9 |
-
class QLWCDC_Archives extends QLWCDC {
|
10 |
-
|
11 |
-
protected static $instance;
|
12 |
-
|
13 |
-
public static function instance() {
|
14 |
-
if (!isset(self::$instance)) {
|
15 |
-
self::$instance = new self();
|
16 |
-
self::$instance->init();
|
17 |
-
}
|
18 |
-
return self::$instance;
|
19 |
-
}
|
20 |
-
|
21 |
-
function add_section($sections) {
|
22 |
-
|
23 |
-
$sections['archives'] = __('Archives', 'woocommerce-direct-checkout');
|
24 |
-
|
25 |
-
return $sections;
|
26 |
-
}
|
27 |
-
|
28 |
-
function add_fields($fields) {
|
29 |
-
|
30 |
-
global $current_section;
|
31 |
-
|
32 |
-
if ('archives' == $current_section) {
|
33 |
-
|
34 |
-
$fields = array(
|
35 |
-
'qlwcdc_section_title' => array(
|
36 |
-
'name' => __('Archives', 'woocommerce-direct-checkout'),
|
37 |
-
'type' => 'title',
|
38 |
-
'id' => 'qlwcdc_archives_section_title'
|
39 |
-
),
|
40 |
-
/*'add_archive_cart' => array(
|
41 |
-
'name' => __('Add to cart', 'woocommerce-direct-checkout'),
|
42 |
-
'desc_tip' => __('Add to cart button behaviour for single products in archives.', 'woocommerce-direct-checkout'),
|
43 |
-
'id' => 'qlwcdc_add_archive_cart',
|
44 |
-
'type' => 'select',
|
45 |
-
'class' => 'chosen_select',
|
46 |
-
'options' => array(
|
47 |
-
'no' => __('Reload', 'woocommerce-direct-checkout'),
|
48 |
-
'ajax' => __('Ajax', 'woocommerce-direct-checkout'),
|
49 |
-
'redirect' => __('Redirect', 'woocommerce-direct-checkout'),
|
50 |
-
),
|
51 |
-
'default' => 'no',
|
52 |
-
),
|
53 |
-
'add_archive_cart_ajax_button' => array(
|
54 |
-
'name' => __('Added to cart button', 'woocommerce-direct-checkout'),
|
55 |
-
'desc_tip' => __('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
|
56 |
-
'id' => 'qlwcdc_add_archive_cart_ajax_button',
|
57 |
-
'type' => 'select',
|
58 |
-
'options' => array(
|
59 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
60 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
61 |
-
),
|
62 |
-
'default' => 'no',
|
63 |
-
),
|
64 |
-
'add_archive_cart_ajax_message' => array(
|
65 |
-
'name' => __('Added to cart alert', 'woocommerce-direct-checkout'),
|
66 |
-
'desc_tip' => __('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
|
67 |
-
'id' => 'qlwcdc_add_archive_cart_ajax_message',
|
68 |
-
'type' => 'select',
|
69 |
-
'class' => 'chosen_select',
|
70 |
-
'options' => array(
|
71 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
72 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
73 |
-
),
|
74 |
-
'default' => 'yes',
|
75 |
-
),
|
76 |
-
'add_archive_cart_redirect_page' => array(
|
77 |
-
'name' => __('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
78 |
-
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
79 |
-
'id' => 'qlwcdc_add_archive_cart_redirect_page',
|
80 |
-
'type' => 'select',
|
81 |
-
'class' => 'chosen_select',
|
82 |
-
'options' => array(
|
83 |
-
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
84 |
-
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
85 |
-
'url' => __('Custom URL', 'woocommerce-direct-checkout'),
|
86 |
-
),
|
87 |
-
'default' => 'cart',
|
88 |
-
),
|
89 |
-
'add_archive_cart_redirect_url' => array(
|
90 |
-
'name' => __('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
91 |
-
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
92 |
-
'id' => 'qlwcdc_add_archive_cart_redirect_url',
|
93 |
-
'type' => 'text',
|
94 |
-
'placeholder' => wc_get_checkout_url(),
|
95 |
-
),*/
|
96 |
-
'add_archive_text' => array(
|
97 |
-
'name' => __('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
98 |
-
'desc_tip' => __('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
99 |
-
'id' => 'qlwcdc_add_archive_text',
|
100 |
-
'type' => 'select',
|
101 |
-
'class' => 'chosen_select',
|
102 |
-
'options' => array(
|
103 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
104 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
105 |
-
),
|
106 |
-
'default' => 'no',
|
107 |
-
),
|
108 |
-
'add_archive_text_in' => array(
|
109 |
-
'name' => __('Replace Add to cart text in', 'woocommerce-direct-checkout'),
|
110 |
-
'desc_tip' => __('Replace "Add to cart" text in product types.', 'woocommerce-direct-checkout'),
|
111 |
-
'id' => 'qlwcdc_add_archive_text_in',
|
112 |
-
'type' => 'multiselect',
|
113 |
-
'class' => 'chosen_select',
|
114 |
-
'options' => array(
|
115 |
-
'simple' => __('Simple Products', 'woocommerce-direct-checkout'),
|
116 |
-
'grouped' => __('Grouped Products', 'woocommerce-direct-checkout'),
|
117 |
-
'virtual' => __('Virtual Products', 'woocommerce-direct-checkout'),
|
118 |
-
'variable' => __('Variable Products', 'woocommerce-direct-checkout'),
|
119 |
-
'downloadable' => __('Downloadable Products', 'woocommerce-direct-checkout'),
|
120 |
-
),
|
121 |
-
'default' => array('simple'),
|
122 |
-
),
|
123 |
-
'add_archive_text_content' => array(
|
124 |
-
'name' => __('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
125 |
-
'desc_tip' => __('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
126 |
-
'id' => 'qlwcdc_add_archive_text_content',
|
127 |
-
'type' => 'text',
|
128 |
-
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout'),
|
129 |
-
),
|
130 |
-
'add_archive_quick_view' => array(
|
131 |
-
'name' => __('Add quick view button', 'woocommerce-direct-checkout'),
|
132 |
-
'desc_tip' => __('Add product quick view modal button.', 'woocommerce-direct-checkout'),
|
133 |
-
'id' => 'qlwcdc_add_archive_quick_view',
|
134 |
-
'type' => 'select',
|
135 |
-
'class' => 'chosen_select qlwcdc-premium-field',
|
136 |
-
'options' => array(
|
137 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
138 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
139 |
-
),
|
140 |
-
'default' => 'no',
|
141 |
-
),
|
142 |
-
'qlwcdc_section_end' => array(
|
143 |
-
'type' => 'sectionend',
|
144 |
-
'id' => 'qlwcdc_archives_section_end'
|
145 |
-
)
|
146 |
-
);
|
147 |
-
}
|
148 |
-
|
149 |
-
return $fields;
|
150 |
-
}
|
151 |
-
|
152 |
-
function add_settings() {
|
153 |
-
|
154 |
-
global $current_section;
|
155 |
-
|
156 |
-
if ('' == $current_section) {
|
157 |
-
woocommerce_admin_fields($this->add_fields());
|
158 |
-
}
|
159 |
-
}
|
160 |
-
|
161 |
-
/*function add_to_cart_redirect($url) {
|
162 |
-
|
163 |
-
if (is_shop() || is_product_category() || is_product_tag()) {
|
164 |
-
|
165 |
-
if ('redirect' === get_option('qlwcdc_add_archive_cart')) {
|
166 |
-
|
167 |
-
if ('cart' === get_option('qlwcdc_add_archive_cart_redirect_page')) {
|
168 |
-
$url = wc_get_cart_url();
|
169 |
-
}
|
170 |
-
|
171 |
-
if ('checkout' === get_option('qlwcdc_add_archive_cart_redirect_page')) {
|
172 |
-
$url = wc_get_checkout_url();
|
173 |
-
}
|
174 |
-
|
175 |
-
if ('url' === get_option('qlwcdc_add_archive_cart_redirect_page')) {
|
176 |
-
$url = get_option('qlwcdc_add_archive_cart_redirect_url');
|
177 |
-
}
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
return $url;
|
182 |
-
}*/
|
183 |
-
|
184 |
-
/*function added_to_cart_button() {
|
185 |
-
if (!is_product() && 'no' === get_option('qlwcdc_add_archive_cart_ajax_button', 'no')) {
|
186 |
-
?>
|
187 |
-
<style>
|
188 |
-
.added_to_cart.wc-forward {
|
189 |
-
display: none!important;
|
190 |
-
}
|
191 |
-
</style>
|
192 |
-
<?php
|
193 |
-
|
194 |
-
}
|
195 |
-
}*/
|
196 |
-
|
197 |
-
/*function added_to_cart_message($product_id) {
|
198 |
-
|
199 |
-
if (!is_product() && 'ajax' === get_option('qlwcdc_add_archive_cart', 'no') && 'yes' === get_option('qlwcdc_add_archive_cart_ajax_message', 'yes')) {
|
200 |
-
|
201 |
-
$quantity = empty($_POST['quantity']) ? 1 : wc_stock_amount($_POST['quantity']);
|
202 |
-
|
203 |
-
wc_add_to_cart_message(array($product_id => $quantity), true);
|
204 |
-
}
|
205 |
-
}*/
|
206 |
-
|
207 |
-
/*function added_to_cart_message_js($product_id) {
|
208 |
-
|
209 |
-
if (!is_product() && 'ajax' === get_option('qlwcdc_add_archive_cart') && 'yes' === get_option('qlwcdc_add_archive_cart_ajax_message')) {
|
210 |
-
?>
|
211 |
-
<script>
|
212 |
-
(function ($) {
|
213 |
-
$(document).bind('added_to_cart', function (e, cart) {
|
214 |
-
$(document.body).trigger('added_to_cart_message', [e, cart]);
|
215 |
-
});
|
216 |
-
})(jQuery);
|
217 |
-
</script>
|
218 |
-
<?php
|
219 |
-
|
220 |
-
}
|
221 |
-
}*/
|
222 |
-
|
223 |
-
function add_archive_text($text, $product) {
|
224 |
-
|
225 |
-
if ('yes' === get_option('qlwcdc_add_archive_text')) {
|
226 |
-
if ($product->is_type(get_option('qlwcdc_add_archive_text_in', array()))) {
|
227 |
-
$text = esc_html__(get_option('qlwcdc_add_archive_text_content'));
|
228 |
-
}
|
229 |
-
}
|
230 |
-
|
231 |
-
return $text;
|
232 |
-
}
|
233 |
-
|
234 |
-
/*function woocommerce_enable_ajax_add_to_cart($val) {
|
235 |
-
|
236 |
-
if ('no' !== get_option('qlwcdc_add_archive_cart', 'no')) {
|
237 |
-
$val = 'yes';
|
238 |
-
} else {
|
239 |
-
$val = 'no';
|
240 |
-
}
|
241 |
-
|
242 |
-
return $val;
|
243 |
-
}*/
|
244 |
-
|
245 |
-
/*function woocommerce_cart_redirect_after_add($val) {
|
246 |
-
|
247 |
-
if (is_shop() || is_product_category() || is_product_tag()) {
|
248 |
-
if ('redirect' === get_option('qlwcdc_add_archive_cart', 'no')) {
|
249 |
-
$val = 'yes';
|
250 |
-
} else {
|
251 |
-
$val = 'no';
|
252 |
-
}
|
253 |
-
}
|
254 |
-
|
255 |
-
return $val;
|
256 |
-
}*/
|
257 |
-
|
258 |
-
function init() {
|
259 |
-
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
260 |
-
add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
|
261 |
-
//add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
|
262 |
-
//add_filter('woocommerce_before_shop_loop', array($this, 'added_to_cart_button'));
|
263 |
-
//add_filter('woocommerce_after_shop_loop', array($this, 'added_to_cart_message_js'));
|
264 |
-
//add_action('woocommerce_ajax_added_to_cart', array($this, 'added_to_cart_message'));
|
265 |
-
add_filter('woocommerce_product_add_to_cart_text', array($this, 'add_archive_text'), 10, 2);
|
266 |
-
//add_filter('option_woocommerce_enable_ajax_add_to_cart', array($this, 'woocommerce_enable_ajax_add_to_cart'));
|
267 |
-
//add_filter('option_woocommerce_cart_redirect_after_add', array($this, 'woocommerce_cart_redirect_after_add'));
|
268 |
-
}
|
269 |
-
|
270 |
-
}
|
271 |
-
|
272 |
-
QLWCDC_Archives::instance();
|
273 |
Â
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
die('-1');
|
5 |
+
}
|
6 |
+
|
7 |
+
if (!class_exists('QLWCDC_Archives')) {
|
8 |
+
|
9 |
+
class QLWCDC_Archives extends QLWCDC {
|
10 |
+
|
11 |
+
protected static $instance;
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (!isset(self::$instance)) {
|
15 |
+
self::$instance = new self();
|
16 |
+
self::$instance->init();
|
17 |
+
}
|
18 |
+
return self::$instance;
|
19 |
+
}
|
20 |
+
|
21 |
+
function add_section($sections) {
|
22 |
+
|
23 |
+
$sections['archives'] = __('Archives', 'woocommerce-direct-checkout');
|
24 |
+
|
25 |
+
return $sections;
|
26 |
+
}
|
27 |
+
|
28 |
+
function add_fields($fields) {
|
29 |
+
|
30 |
+
global $current_section;
|
31 |
+
|
32 |
+
if ('archives' == $current_section) {
|
33 |
+
|
34 |
+
$fields = array(
|
35 |
+
'qlwcdc_section_title' => array(
|
36 |
+
'name' => __('Archives', 'woocommerce-direct-checkout'),
|
37 |
+
'type' => 'title',
|
38 |
+
'id' => 'qlwcdc_archives_section_title'
|
39 |
+
),
|
40 |
+
/*'add_archive_cart' => array(
|
41 |
+
'name' => __('Add to cart', 'woocommerce-direct-checkout'),
|
42 |
+
'desc_tip' => __('Add to cart button behaviour for single products in archives.', 'woocommerce-direct-checkout'),
|
43 |
+
'id' => 'qlwcdc_add_archive_cart',
|
44 |
+
'type' => 'select',
|
45 |
+
'class' => 'chosen_select',
|
46 |
+
'options' => array(
|
47 |
+
'no' => __('Reload', 'woocommerce-direct-checkout'),
|
48 |
+
'ajax' => __('Ajax', 'woocommerce-direct-checkout'),
|
49 |
+
'redirect' => __('Redirect', 'woocommerce-direct-checkout'),
|
50 |
+
),
|
51 |
+
'default' => 'no',
|
52 |
+
),
|
53 |
+
'add_archive_cart_ajax_button' => array(
|
54 |
+
'name' => __('Added to cart button', 'woocommerce-direct-checkout'),
|
55 |
+
'desc_tip' => __('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
|
56 |
+
'id' => 'qlwcdc_add_archive_cart_ajax_button',
|
57 |
+
'type' => 'select',
|
58 |
+
'options' => array(
|
59 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
60 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
61 |
+
),
|
62 |
+
'default' => 'no',
|
63 |
+
),
|
64 |
+
'add_archive_cart_ajax_message' => array(
|
65 |
+
'name' => __('Added to cart alert', 'woocommerce-direct-checkout'),
|
66 |
+
'desc_tip' => __('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
|
67 |
+
'id' => 'qlwcdc_add_archive_cart_ajax_message',
|
68 |
+
'type' => 'select',
|
69 |
+
'class' => 'chosen_select',
|
70 |
+
'options' => array(
|
71 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
72 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
73 |
+
),
|
74 |
+
'default' => 'yes',
|
75 |
+
),
|
76 |
+
'add_archive_cart_redirect_page' => array(
|
77 |
+
'name' => __('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
78 |
+
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
79 |
+
'id' => 'qlwcdc_add_archive_cart_redirect_page',
|
80 |
+
'type' => 'select',
|
81 |
+
'class' => 'chosen_select',
|
82 |
+
'options' => array(
|
83 |
+
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
84 |
+
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
85 |
+
'url' => __('Custom URL', 'woocommerce-direct-checkout'),
|
86 |
+
),
|
87 |
+
'default' => 'cart',
|
88 |
+
),
|
89 |
+
'add_archive_cart_redirect_url' => array(
|
90 |
+
'name' => __('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
91 |
+
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
92 |
+
'id' => 'qlwcdc_add_archive_cart_redirect_url',
|
93 |
+
'type' => 'text',
|
94 |
+
'placeholder' => wc_get_checkout_url(),
|
95 |
+
),*/
|
96 |
+
'add_archive_text' => array(
|
97 |
+
'name' => __('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
98 |
+
'desc_tip' => __('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
99 |
+
'id' => 'qlwcdc_add_archive_text',
|
100 |
+
'type' => 'select',
|
101 |
+
'class' => 'chosen_select',
|
102 |
+
'options' => array(
|
103 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
104 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
105 |
+
),
|
106 |
+
'default' => 'no',
|
107 |
+
),
|
108 |
+
'add_archive_text_in' => array(
|
109 |
+
'name' => __('Replace Add to cart text in', 'woocommerce-direct-checkout'),
|
110 |
+
'desc_tip' => __('Replace "Add to cart" text in product types.', 'woocommerce-direct-checkout'),
|
111 |
+
'id' => 'qlwcdc_add_archive_text_in',
|
112 |
+
'type' => 'multiselect',
|
113 |
+
'class' => 'chosen_select',
|
114 |
+
'options' => array(
|
115 |
+
'simple' => __('Simple Products', 'woocommerce-direct-checkout'),
|
116 |
+
'grouped' => __('Grouped Products', 'woocommerce-direct-checkout'),
|
117 |
+
'virtual' => __('Virtual Products', 'woocommerce-direct-checkout'),
|
118 |
+
'variable' => __('Variable Products', 'woocommerce-direct-checkout'),
|
119 |
+
'downloadable' => __('Downloadable Products', 'woocommerce-direct-checkout'),
|
120 |
+
),
|
121 |
+
'default' => array('simple'),
|
122 |
+
),
|
123 |
+
'add_archive_text_content' => array(
|
124 |
+
'name' => __('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
125 |
+
'desc_tip' => __('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
126 |
+
'id' => 'qlwcdc_add_archive_text_content',
|
127 |
+
'type' => 'text',
|
128 |
+
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout'),
|
129 |
+
),
|
130 |
+
'add_archive_quick_view' => array(
|
131 |
+
'name' => __('Add quick view button', 'woocommerce-direct-checkout'),
|
132 |
+
'desc_tip' => __('Add product quick view modal button.', 'woocommerce-direct-checkout'),
|
133 |
+
'id' => 'qlwcdc_add_archive_quick_view',
|
134 |
+
'type' => 'select',
|
135 |
+
'class' => 'chosen_select qlwcdc-premium-field',
|
136 |
+
'options' => array(
|
137 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
138 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
139 |
+
),
|
140 |
+
'default' => 'no',
|
141 |
+
),
|
142 |
+
'qlwcdc_section_end' => array(
|
143 |
+
'type' => 'sectionend',
|
144 |
+
'id' => 'qlwcdc_archives_section_end'
|
145 |
+
)
|
146 |
+
);
|
147 |
+
}
|
148 |
+
|
149 |
+
return $fields;
|
150 |
+
}
|
151 |
+
|
152 |
+
function add_settings() {
|
153 |
+
|
154 |
+
global $current_section;
|
155 |
+
|
156 |
+
if ('' == $current_section) {
|
157 |
+
woocommerce_admin_fields($this->add_fields());
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
/*function add_to_cart_redirect($url) {
|
162 |
+
|
163 |
+
if (is_shop() || is_product_category() || is_product_tag()) {
|
164 |
+
|
165 |
+
if ('redirect' === get_option('qlwcdc_add_archive_cart')) {
|
166 |
+
|
167 |
+
if ('cart' === get_option('qlwcdc_add_archive_cart_redirect_page')) {
|
168 |
+
$url = wc_get_cart_url();
|
169 |
+
}
|
170 |
+
|
171 |
+
if ('checkout' === get_option('qlwcdc_add_archive_cart_redirect_page')) {
|
172 |
+
$url = wc_get_checkout_url();
|
173 |
+
}
|
174 |
+
|
175 |
+
if ('url' === get_option('qlwcdc_add_archive_cart_redirect_page')) {
|
176 |
+
$url = get_option('qlwcdc_add_archive_cart_redirect_url');
|
177 |
+
}
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
return $url;
|
182 |
+
}*/
|
183 |
+
|
184 |
+
/*function added_to_cart_button() {
|
185 |
+
if (!is_product() && 'no' === get_option('qlwcdc_add_archive_cart_ajax_button', 'no')) {
|
186 |
+
?>
|
187 |
+
<style>
|
188 |
+
.added_to_cart.wc-forward {
|
189 |
+
display: none!important;
|
190 |
+
}
|
191 |
+
</style>
|
192 |
+
<?php
|
193 |
+
|
194 |
+
}
|
195 |
+
}*/
|
196 |
+
|
197 |
+
/*function added_to_cart_message($product_id) {
|
198 |
+
|
199 |
+
if (!is_product() && 'ajax' === get_option('qlwcdc_add_archive_cart', 'no') && 'yes' === get_option('qlwcdc_add_archive_cart_ajax_message', 'yes')) {
|
200 |
+
|
201 |
+
$quantity = empty($_POST['quantity']) ? 1 : wc_stock_amount($_POST['quantity']);
|
202 |
+
|
203 |
+
wc_add_to_cart_message(array($product_id => $quantity), true);
|
204 |
+
}
|
205 |
+
}*/
|
206 |
+
|
207 |
+
/*function added_to_cart_message_js($product_id) {
|
208 |
+
|
209 |
+
if (!is_product() && 'ajax' === get_option('qlwcdc_add_archive_cart') && 'yes' === get_option('qlwcdc_add_archive_cart_ajax_message')) {
|
210 |
+
?>
|
211 |
+
<script>
|
212 |
+
(function ($) {
|
213 |
+
$(document).bind('added_to_cart', function (e, cart) {
|
214 |
+
$(document.body).trigger('added_to_cart_message', [e, cart]);
|
215 |
+
});
|
216 |
+
})(jQuery);
|
217 |
+
</script>
|
218 |
+
<?php
|
219 |
+
|
220 |
+
}
|
221 |
+
}*/
|
222 |
+
|
223 |
+
function add_archive_text($text, $product) {
|
224 |
+
|
225 |
+
if ('yes' === get_option('qlwcdc_add_archive_text')) {
|
226 |
+
if ($product->is_type(get_option('qlwcdc_add_archive_text_in', array()))) {
|
227 |
+
$text = esc_html__(get_option('qlwcdc_add_archive_text_content'));
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
return $text;
|
232 |
+
}
|
233 |
+
|
234 |
+
/*function woocommerce_enable_ajax_add_to_cart($val) {
|
235 |
+
|
236 |
+
if ('no' !== get_option('qlwcdc_add_archive_cart', 'no')) {
|
237 |
+
$val = 'yes';
|
238 |
+
} else {
|
239 |
+
$val = 'no';
|
240 |
+
}
|
241 |
+
|
242 |
+
return $val;
|
243 |
+
}*/
|
244 |
+
|
245 |
+
/*function woocommerce_cart_redirect_after_add($val) {
|
246 |
+
|
247 |
+
if (is_shop() || is_product_category() || is_product_tag()) {
|
248 |
+
if ('redirect' === get_option('qlwcdc_add_archive_cart', 'no')) {
|
249 |
+
$val = 'yes';
|
250 |
+
} else {
|
251 |
+
$val = 'no';
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
return $val;
|
256 |
+
}*/
|
257 |
+
|
258 |
+
function init() {
|
259 |
+
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
260 |
+
add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
|
261 |
+
//add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
|
262 |
+
//add_filter('woocommerce_before_shop_loop', array($this, 'added_to_cart_button'));
|
263 |
+
//add_filter('woocommerce_after_shop_loop', array($this, 'added_to_cart_message_js'));
|
264 |
+
//add_action('woocommerce_ajax_added_to_cart', array($this, 'added_to_cart_message'));
|
265 |
+
add_filter('woocommerce_product_add_to_cart_text', array($this, 'add_archive_text'), 10, 2);
|
266 |
+
//add_filter('option_woocommerce_enable_ajax_add_to_cart', array($this, 'woocommerce_enable_ajax_add_to_cart'));
|
267 |
+
//add_filter('option_woocommerce_cart_redirect_after_add', array($this, 'woocommerce_cart_redirect_after_add'));
|
268 |
+
}
|
269 |
+
|
270 |
+
}
|
271 |
+
|
272 |
+
QLWCDC_Archives::instance();
|
273 |
Â
}
|
includes/checkout.php
CHANGED
@@ -1,262 +1,262 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
die('-1');
|
5 |
-
}
|
6 |
-
|
7 |
-
if (!class_exists('QLWCDC_Checkout')) {
|
8 |
-
|
9 |
-
class QLWCDC_Checkout {
|
10 |
-
|
11 |
-
protected static $instance;
|
12 |
-
|
13 |
-
public static function instance() {
|
14 |
-
if (!isset(self::$instance)) {
|
15 |
-
self::$instance = new self();
|
16 |
-
self::$instance->init();
|
17 |
-
}
|
18 |
-
return self::$instance;
|
19 |
-
}
|
20 |
-
|
21 |
-
function add_section($sections) {
|
22 |
-
|
23 |
-
$sections['checkout'] = __('Checkout', 'woocommerce-direct-checkout');
|
24 |
-
|
25 |
-
return $sections;
|
26 |
-
}
|
27 |
-
|
28 |
-
function add_fields($settings) {
|
29 |
-
|
30 |
-
global $current_section;
|
31 |
-
|
32 |
-
if ('checkout' == $current_section) {
|
33 |
-
|
34 |
-
$settings = array(
|
35 |
-
'section_title' => array(
|
36 |
-
'name' => __('Checkout', 'woocommerce-direct-checkout'),
|
37 |
-
'type' => 'title',
|
38 |
-
'id' => 'section_title'
|
39 |
-
),
|
40 |
-
'add_checkout_cart' => array(
|
41 |
-
'name' => __('Add cart to checkout', 'woocommerce-direct-checkout'),
|
42 |
-
'desc_tip' => __('Simplifies the checkout process including the shopping cart page inside checkout.', 'woocommerce-direct-checkout'),
|
43 |
-
'id' => 'qlwcdc_add_checkout_cart',
|
44 |
-
'type' => 'select',
|
45 |
-
'class' => 'chosen_select',
|
46 |
-
'options' => array(
|
47 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
48 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
49 |
-
),
|
50 |
-
'default' => 'no',
|
51 |
-
),
|
52 |
-
'add_checkout_cart_fields' => array(
|
53 |
-
'name' => __('Add cart to checkout fields', 'woocommerce-direct-checkout'),
|
54 |
-
'desc_tip' => __('Include this fields inside the checkout cart.', 'woocommerce-direct-checkout'),
|
55 |
-
'id' => 'qlwcdc_add_checkout_cart_fields',
|
56 |
-
'type' => 'multiselect',
|
57 |
-
'class' => 'chosen_select',
|
58 |
-
'options' => array(
|
59 |
-
'remove' => __('Remove', 'woocommerce-direct-checkout'),
|
60 |
-
'thumbnail' => __('Thumbnail', 'woocommerce-direct-checkout'),
|
61 |
-
'name' => __('Name', 'woocommerce-direct-checkout'),
|
62 |
-
'price' => __('Price', 'woocommerce-direct-checkout'),
|
63 |
-
'qty' => __('Quantity', 'woocommerce-direct-checkout'),
|
64 |
-
),
|
65 |
-
'default' => array(
|
66 |
-
0 => 'remove',
|
67 |
-
1 => 'thumbnail',
|
68 |
-
2 => 'price',
|
69 |
-
3 => 'qty',
|
70 |
-
)
|
71 |
-
),
|
72 |
-
'remove_checkout_coupon_form' => array(
|
73 |
-
'name' => __('Remove checkout coupon form', 'woocommerce-direct-checkout'),
|
74 |
-
'desc_tip' => __('Simplifies the checkout process removing the coupon form.', 'woocommerce-direct-checkout'),
|
75 |
-
'id' => 'qlwcdc_remove_checkout_coupon_form',
|
76 |
-
'type' => 'select',
|
77 |
-
'class' => 'chosen_select',
|
78 |
-
'options' => array(
|
79 |
-
'no' => __('Leave coupon form', 'woocommerce-direct-checkout'),
|
80 |
-
'remove' => __('Remove coupon form', 'woocommerce-direct-checkout'),
|
81 |
-
'toggle' => __('Remove coupon toggle', 'woocommerce-direct-checkout'),
|
82 |
-
'checkout' => __('Move to checkout order', 'woocommerce-direct-checkout'),
|
83 |
-
),
|
84 |
-
'default' => 'no',
|
85 |
-
),
|
86 |
-
'add_checkout_cart_class' => array(
|
87 |
-
'name' => __('Add custom class to cart table', 'woocommerce-direct-checkout'),
|
88 |
-
'desc_tip' => __('Add a custom class to the cart table form in the checkot.', 'woocommerce-direct-checkout'),
|
89 |
-
'id' => 'qlwcdc_add_checkout_cart_class',
|
90 |
-
'type' => 'text',
|
91 |
-
'default' => ''
|
92 |
-
),
|
93 |
-
'remove_checkout_fields' => array(
|
94 |
-
'name' => __('Remove checkout fields', 'qlwe'),
|
95 |
-
'desc_tip' => __('Simplifies the checkout process removing the unnecessary checkout fields.', 'qlwe'),
|
96 |
-
'id' => 'qlwcdc_remove_checkout_fields',
|
97 |
-
'type' => 'multiselect',
|
98 |
-
'class' => 'chosen_select',
|
99 |
-
'options' => array(
|
100 |
-
'first_name' => __('First Name', 'qlwe'),
|
101 |
-
'last_name' => __('Last Name', 'qlwe'),
|
102 |
-
'country' => __('Country', 'qlwe'),
|
103 |
-
'state' => __('State', 'qlwe'),
|
104 |
-
'city' => __('City', 'qlwe'),
|
105 |
-
'postcode' => __('Postcode', 'qlwe'),
|
106 |
-
'address_1' => __('Address 1', 'qlwe'),
|
107 |
-
'address_2' => __('Address 2', 'qlwe'),
|
108 |
-
'company' => __('Company', 'qlwe'),
|
109 |
-
'phone' => __('Phone', 'qlwe'),
|
110 |
-
),
|
111 |
-
'default' => array(
|
112 |
-
0 => 'phone',
|
113 |
-
1 => 'company',
|
114 |
-
2 => 'address_2',
|
115 |
-
)
|
116 |
-
),
|
117 |
-
'remove_checkout_shipping_address' => array(
|
118 |
-
'name' => __('Remove checkout shipping address', 'woocommerce-direct-checkout'),
|
119 |
-
'desc_tip' => __('Simplifies the checkout process removing the shipping address.', 'woocommerce-direct-checkout'),
|
120 |
-
'id' => 'qlwcdc_remove_checkout_shipping_address',
|
121 |
-
'type' => 'select',
|
122 |
-
'class' => 'chosen_select',
|
123 |
-
'options' => array(
|
124 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
125 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
126 |
-
),
|
127 |
-
'default' => 'no',
|
128 |
-
),
|
129 |
-
'remove_checkout_order_comments' => array(
|
130 |
-
'name' => __('Remove checkout order comments', 'woocommerce-direct-checkout'),
|
131 |
-
'desc_tip' => __('Simplifies the checkout process removing the order notes.', 'woocommerce-direct-checkout'),
|
132 |
-
'id' => 'qlwcdc_remove_checkout_order_comments',
|
133 |
-
'type' => 'select',
|
134 |
-
'class' => 'chosen_select',
|
135 |
-
'options' => array(
|
136 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
137 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
138 |
-
),
|
139 |
-
'default' => 'no',
|
140 |
-
),
|
141 |
-
'remove_checkout_privacy_policy_text' => array(
|
142 |
-
'name' => __('Remove checkout policy text', 'woocommerce-direct-checkout'),
|
143 |
-
'desc_tip' => __('Simplifies the checkout process removing the policy text.', 'woocommerce-direct-checkout'),
|
144 |
-
'id' => 'qlwcdc_remove_checkout_privacy_policy_text',
|
145 |
-
'type' => 'select',
|
146 |
-
'class' => 'chosen_select qlwcdc-premium-field',
|
147 |
-
'options' => array(
|
148 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
149 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
150 |
-
),
|
151 |
-
'default' => 'no',
|
152 |
-
),
|
153 |
-
'remove_checkout_terms_and_conditions' => array(
|
154 |
-
'name' => __('Remove checkout terms and conditions', 'woocommerce-direct-checkout'),
|
155 |
-
'desc_tip' => __('Simplifies the checkout process removing the terms and conditions.', 'woocommerce-direct-checkout'),
|
156 |
-
'id' => 'qlwcdc_remove_checkout_terms_and_conditions',
|
157 |
-
'type' => 'select',
|
158 |
-
'class' => 'chosen_select',
|
159 |
-
'options' => array(
|
160 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
161 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
162 |
-
),
|
163 |
-
'default' => 'no',
|
164 |
-
),
|
165 |
-
'remove_checkout_gateway_icon' => array(
|
166 |
-
'name' => __('Remove checkout gateway icons', 'woocommerce-direct-checkout'),
|
167 |
-
'desc_tip' => __('Simplifies the checkout view by removing the payment gateway icons.', 'woocommerce-direct-checkout'),
|
168 |
-
'id' => 'qlwcdc_remove_checkout_gateway_icon',
|
169 |
-
'type' => 'select',
|
170 |
-
'class' => 'chosen_select qlwcdc-premium-field',
|
171 |
-
'options' => array(
|
172 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
173 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
174 |
-
),
|
175 |
-
'default' => 'no',
|
176 |
-
),
|
177 |
-
'remove_checkout_columns' => array(
|
178 |
-
'name' => __('Remove checkout columns', 'woocommerce-direct-checkout'),
|
179 |
-
'desc_tip' => __('Try to remove the columns and display the checkout form and order review in one column.', 'woocommerce-direct-checkout'),
|
180 |
-
'id' => 'qlwcdc_remove_checkout_columns',
|
181 |
-
'type' => 'select',
|
182 |
-
'class' => 'chosen_select',
|
183 |
-
'options' => array(
|
184 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
185 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
186 |
-
),
|
187 |
-
'default' => 'no',
|
188 |
-
),
|
189 |
-
'remove_order_details_address' => array(
|
190 |
-
'name' => __('Remove order details address', 'woocommerce-direct-checkout'),
|
191 |
-
'desc_tip' => __('Remove the billing address of the customer in the order received page.', 'woocommerce-direct-checkout'),
|
192 |
-
'id' => 'qlwcdc_remove_order_details_address',
|
193 |
-
'type' => 'select',
|
194 |
-
'class' => 'chosen_select',
|
195 |
-
'options' => array(
|
196 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
197 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
198 |
-
),
|
199 |
-
'default' => 'no',
|
200 |
-
),
|
201 |
-
'section_end' => array(
|
202 |
-
'type' => 'sectionend',
|
203 |
-
'id' => 'wc_settings_tab_demo_section_end'
|
204 |
-
)
|
205 |
-
);
|
206 |
-
}
|
207 |
-
|
208 |
-
return $settings;
|
209 |
-
}
|
210 |
-
|
211 |
-
function remove_checkout_fields($fields) {
|
212 |
-
|
213 |
-
if ($remove = get_option('qlwcdc_remove_checkout_fields', array())) {
|
214 |
-
foreach ($remove as $id => $key) {
|
215 |
-
unset($fields['billing']['billing_' . $key]);
|
216 |
-
unset($fields['shipping']['shipping_' . $key]);
|
217 |
-
}
|
218 |
-
}
|
219 |
-
|
220 |
-
return $fields;
|
221 |
-
}
|
222 |
-
|
223 |
-
function remove_checkout_order_commens($return) {
|
224 |
-
|
225 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_order_comments')) {
|
226 |
-
$return = false;
|
227 |
-
}
|
228 |
-
|
229 |
-
return $return;
|
230 |
-
}
|
231 |
-
|
232 |
-
function remove_checkout_shipping_address($val) {
|
233 |
-
|
234 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_shipping_address')) {
|
235 |
-
$val = 'billing_only';
|
236 |
-
}
|
237 |
-
|
238 |
-
return $val;
|
239 |
-
}
|
240 |
-
|
241 |
-
function init() {
|
242 |
-
|
243 |
-
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
244 |
-
add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
|
245 |
-
add_filter('woocommerce_checkout_fields', array($this, 'remove_checkout_fields'));
|
246 |
-
add_filter('woocommerce_enable_order_notes_field', array($this, 'remove_checkout_order_commens'));
|
247 |
-
add_filter('option_woocommerce_ship_to_destination', array($this, 'remove_checkout_shipping_address'), 10, 3);
|
248 |
-
|
249 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_privacy_policy_text')) {
|
250 |
-
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20);
|
251 |
-
}
|
252 |
-
|
253 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_terms_and_conditions')) {
|
254 |
-
add_filter('woocommerce_checkout_show_terms', '__return_false');
|
255 |
-
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30);
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
}
|
260 |
-
|
261 |
-
QLWCDC_Checkout::instance();
|
262 |
Â
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
die('-1');
|
5 |
+
}
|
6 |
+
|
7 |
+
if (!class_exists('QLWCDC_Checkout')) {
|
8 |
+
|
9 |
+
class QLWCDC_Checkout {
|
10 |
+
|
11 |
+
protected static $instance;
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (!isset(self::$instance)) {
|
15 |
+
self::$instance = new self();
|
16 |
+
self::$instance->init();
|
17 |
+
}
|
18 |
+
return self::$instance;
|
19 |
+
}
|
20 |
+
|
21 |
+
function add_section($sections) {
|
22 |
+
|
23 |
+
$sections['checkout'] = __('Checkout', 'woocommerce-direct-checkout');
|
24 |
+
|
25 |
+
return $sections;
|
26 |
+
}
|
27 |
+
|
28 |
+
function add_fields($settings) {
|
29 |
+
|
30 |
+
global $current_section;
|
31 |
+
|
32 |
+
if ('checkout' == $current_section) {
|
33 |
+
|
34 |
+
$settings = array(
|
35 |
+
'section_title' => array(
|
36 |
+
'name' => __('Checkout', 'woocommerce-direct-checkout'),
|
37 |
+
'type' => 'title',
|
38 |
+
'id' => 'section_title'
|
39 |
+
),
|
40 |
+
'add_checkout_cart' => array(
|
41 |
+
'name' => __('Add cart to checkout', 'woocommerce-direct-checkout'),
|
42 |
+
'desc_tip' => __('Simplifies the checkout process including the shopping cart page inside checkout.', 'woocommerce-direct-checkout'),
|
43 |
+
'id' => 'qlwcdc_add_checkout_cart',
|
44 |
+
'type' => 'select',
|
45 |
+
'class' => 'chosen_select',
|
46 |
+
'options' => array(
|
47 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
48 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
49 |
+
),
|
50 |
+
'default' => 'no',
|
51 |
+
),
|
52 |
+
'add_checkout_cart_fields' => array(
|
53 |
+
'name' => __('Add cart to checkout fields', 'woocommerce-direct-checkout'),
|
54 |
+
'desc_tip' => __('Include this fields inside the checkout cart.', 'woocommerce-direct-checkout'),
|
55 |
+
'id' => 'qlwcdc_add_checkout_cart_fields',
|
56 |
+
'type' => 'multiselect',
|
57 |
+
'class' => 'chosen_select',
|
58 |
+
'options' => array(
|
59 |
+
'remove' => __('Remove', 'woocommerce-direct-checkout'),
|
60 |
+
'thumbnail' => __('Thumbnail', 'woocommerce-direct-checkout'),
|
61 |
+
'name' => __('Name', 'woocommerce-direct-checkout'),
|
62 |
+
'price' => __('Price', 'woocommerce-direct-checkout'),
|
63 |
+
'qty' => __('Quantity', 'woocommerce-direct-checkout'),
|
64 |
+
),
|
65 |
+
'default' => array(
|
66 |
+
0 => 'remove',
|
67 |
+
1 => 'thumbnail',
|
68 |
+
2 => 'price',
|
69 |
+
3 => 'qty',
|
70 |
+
)
|
71 |
+
),
|
72 |
+
'remove_checkout_coupon_form' => array(
|
73 |
+
'name' => __('Remove checkout coupon form', 'woocommerce-direct-checkout'),
|
74 |
+
'desc_tip' => __('Simplifies the checkout process removing the coupon form.', 'woocommerce-direct-checkout'),
|
75 |
+
'id' => 'qlwcdc_remove_checkout_coupon_form',
|
76 |
+
'type' => 'select',
|
77 |
+
'class' => 'chosen_select',
|
78 |
+
'options' => array(
|
79 |
+
'no' => __('Leave coupon form', 'woocommerce-direct-checkout'),
|
80 |
+
'remove' => __('Remove coupon form', 'woocommerce-direct-checkout'),
|
81 |
+
'toggle' => __('Remove coupon toggle', 'woocommerce-direct-checkout'),
|
82 |
+
'checkout' => __('Move to checkout order', 'woocommerce-direct-checkout'),
|
83 |
+
),
|
84 |
+
'default' => 'no',
|
85 |
+
),
|
86 |
+
'add_checkout_cart_class' => array(
|
87 |
+
'name' => __('Add custom class to cart table', 'woocommerce-direct-checkout'),
|
88 |
+
'desc_tip' => __('Add a custom class to the cart table form in the checkot.', 'woocommerce-direct-checkout'),
|
89 |
+
'id' => 'qlwcdc_add_checkout_cart_class',
|
90 |
+
'type' => 'text',
|
91 |
+
'default' => ''
|
92 |
+
),
|
93 |
+
'remove_checkout_fields' => array(
|
94 |
+
'name' => __('Remove checkout fields', 'qlwe'),
|
95 |
+
'desc_tip' => __('Simplifies the checkout process removing the unnecessary checkout fields.', 'qlwe'),
|
96 |
+
'id' => 'qlwcdc_remove_checkout_fields',
|
97 |
+
'type' => 'multiselect',
|
98 |
+
'class' => 'chosen_select',
|
99 |
+
'options' => array(
|
100 |
+
'first_name' => __('First Name', 'qlwe'),
|
101 |
+
'last_name' => __('Last Name', 'qlwe'),
|
102 |
+
'country' => __('Country', 'qlwe'),
|
103 |
+
'state' => __('State', 'qlwe'),
|
104 |
+
'city' => __('City', 'qlwe'),
|
105 |
+
'postcode' => __('Postcode', 'qlwe'),
|
106 |
+
'address_1' => __('Address 1', 'qlwe'),
|
107 |
+
'address_2' => __('Address 2', 'qlwe'),
|
108 |
+
'company' => __('Company', 'qlwe'),
|
109 |
+
'phone' => __('Phone', 'qlwe'),
|
110 |
+
),
|
111 |
+
'default' => array(
|
112 |
+
0 => 'phone',
|
113 |
+
1 => 'company',
|
114 |
+
2 => 'address_2',
|
115 |
+
)
|
116 |
+
),
|
117 |
+
'remove_checkout_shipping_address' => array(
|
118 |
+
'name' => __('Remove checkout shipping address', 'woocommerce-direct-checkout'),
|
119 |
+
'desc_tip' => __('Simplifies the checkout process removing the shipping address.', 'woocommerce-direct-checkout'),
|
120 |
+
'id' => 'qlwcdc_remove_checkout_shipping_address',
|
121 |
+
'type' => 'select',
|
122 |
+
'class' => 'chosen_select',
|
123 |
+
'options' => array(
|
124 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
125 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
126 |
+
),
|
127 |
+
'default' => 'no',
|
128 |
+
),
|
129 |
+
'remove_checkout_order_comments' => array(
|
130 |
+
'name' => __('Remove checkout order comments', 'woocommerce-direct-checkout'),
|
131 |
+
'desc_tip' => __('Simplifies the checkout process removing the order notes.', 'woocommerce-direct-checkout'),
|
132 |
+
'id' => 'qlwcdc_remove_checkout_order_comments',
|
133 |
+
'type' => 'select',
|
134 |
+
'class' => 'chosen_select',
|
135 |
+
'options' => array(
|
136 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
137 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
138 |
+
),
|
139 |
+
'default' => 'no',
|
140 |
+
),
|
141 |
+
'remove_checkout_privacy_policy_text' => array(
|
142 |
+
'name' => __('Remove checkout policy text', 'woocommerce-direct-checkout'),
|
143 |
+
'desc_tip' => __('Simplifies the checkout process removing the policy text.', 'woocommerce-direct-checkout'),
|
144 |
+
'id' => 'qlwcdc_remove_checkout_privacy_policy_text',
|
145 |
+
'type' => 'select',
|
146 |
+
'class' => 'chosen_select qlwcdc-premium-field',
|
147 |
+
'options' => array(
|
148 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
149 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
150 |
+
),
|
151 |
+
'default' => 'no',
|
152 |
+
),
|
153 |
+
'remove_checkout_terms_and_conditions' => array(
|
154 |
+
'name' => __('Remove checkout terms and conditions', 'woocommerce-direct-checkout'),
|
155 |
+
'desc_tip' => __('Simplifies the checkout process removing the terms and conditions.', 'woocommerce-direct-checkout'),
|
156 |
+
'id' => 'qlwcdc_remove_checkout_terms_and_conditions',
|
157 |
+
'type' => 'select',
|
158 |
+
'class' => 'chosen_select',
|
159 |
+
'options' => array(
|
160 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
161 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
162 |
+
),
|
163 |
+
'default' => 'no',
|
164 |
+
),
|
165 |
+
'remove_checkout_gateway_icon' => array(
|
166 |
+
'name' => __('Remove checkout gateway icons', 'woocommerce-direct-checkout'),
|
167 |
+
'desc_tip' => __('Simplifies the checkout view by removing the payment gateway icons.', 'woocommerce-direct-checkout'),
|
168 |
+
'id' => 'qlwcdc_remove_checkout_gateway_icon',
|
169 |
+
'type' => 'select',
|
170 |
+
'class' => 'chosen_select qlwcdc-premium-field',
|
171 |
+
'options' => array(
|
172 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
173 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
174 |
+
),
|
175 |
+
'default' => 'no',
|
176 |
+
),
|
177 |
+
'remove_checkout_columns' => array(
|
178 |
+
'name' => __('Remove checkout columns', 'woocommerce-direct-checkout'),
|
179 |
+
'desc_tip' => __('Try to remove the columns and display the checkout form and order review in one column.', 'woocommerce-direct-checkout'),
|
180 |
+
'id' => 'qlwcdc_remove_checkout_columns',
|
181 |
+
'type' => 'select',
|
182 |
+
'class' => 'chosen_select',
|
183 |
+
'options' => array(
|
184 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
185 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
186 |
+
),
|
187 |
+
'default' => 'no',
|
188 |
+
),
|
189 |
+
'remove_order_details_address' => array(
|
190 |
+
'name' => __('Remove order details address', 'woocommerce-direct-checkout'),
|
191 |
+
'desc_tip' => __('Remove the billing address of the customer in the order received page.', 'woocommerce-direct-checkout'),
|
192 |
+
'id' => 'qlwcdc_remove_order_details_address',
|
193 |
+
'type' => 'select',
|
194 |
+
'class' => 'chosen_select',
|
195 |
+
'options' => array(
|
196 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
197 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
198 |
+
),
|
199 |
+
'default' => 'no',
|
200 |
+
),
|
201 |
+
'section_end' => array(
|
202 |
+
'type' => 'sectionend',
|
203 |
+
'id' => 'wc_settings_tab_demo_section_end'
|
204 |
+
)
|
205 |
+
);
|
206 |
+
}
|
207 |
+
|
208 |
+
return $settings;
|
209 |
+
}
|
210 |
+
|
211 |
+
function remove_checkout_fields($fields) {
|
212 |
+
|
213 |
+
if ($remove = get_option('qlwcdc_remove_checkout_fields', array())) {
|
214 |
+
foreach ($remove as $id => $key) {
|
215 |
+
unset($fields['billing']['billing_' . $key]);
|
216 |
+
unset($fields['shipping']['shipping_' . $key]);
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
return $fields;
|
221 |
+
}
|
222 |
+
|
223 |
+
function remove_checkout_order_commens($return) {
|
224 |
+
|
225 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_order_comments')) {
|
226 |
+
$return = false;
|
227 |
+
}
|
228 |
+
|
229 |
+
return $return;
|
230 |
+
}
|
231 |
+
|
232 |
+
function remove_checkout_shipping_address($val) {
|
233 |
+
|
234 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_shipping_address')) {
|
235 |
+
$val = 'billing_only';
|
236 |
+
}
|
237 |
+
|
238 |
+
return $val;
|
239 |
+
}
|
240 |
+
|
241 |
+
function init() {
|
242 |
+
|
243 |
+
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
244 |
+
add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
|
245 |
+
add_filter('woocommerce_checkout_fields', array($this, 'remove_checkout_fields'));
|
246 |
+
add_filter('woocommerce_enable_order_notes_field', array($this, 'remove_checkout_order_commens'));
|
247 |
+
add_filter('option_woocommerce_ship_to_destination', array($this, 'remove_checkout_shipping_address'), 10, 3);
|
248 |
+
|
249 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_privacy_policy_text')) {
|
250 |
+
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20);
|
251 |
+
}
|
252 |
+
|
253 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_terms_and_conditions')) {
|
254 |
+
add_filter('woocommerce_checkout_show_terms', '__return_false');
|
255 |
+
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30);
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
}
|
260 |
+
|
261 |
+
QLWCDC_Checkout::instance();
|
262 |
Â
}
|
includes/general.php
CHANGED
@@ -1,184 +1,184 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
die('-1');
|
5 |
-
}
|
6 |
-
|
7 |
-
if (!class_exists('QLWCDC_General')) {
|
8 |
-
|
9 |
-
class QLWCDC_General {
|
10 |
-
|
11 |
-
protected static $instance;
|
12 |
-
|
13 |
-
public static function instance() {
|
14 |
-
if (!isset(self::$instance)) {
|
15 |
-
self::$instance = new self();
|
16 |
-
self::$instance->init();
|
17 |
-
}
|
18 |
-
return self::$instance;
|
19 |
-
}
|
20 |
-
|
21 |
-
function add_section($sections) {
|
22 |
-
|
23 |
-
$sections[''] = __('General', 'woocommerce-direct-checkout');
|
24 |
-
|
25 |
-
return $sections;
|
26 |
-
}
|
27 |
-
|
28 |
-
function add_fields($settings) {
|
29 |
-
|
30 |
-
global $current_section;
|
31 |
-
|
32 |
-
if ('' == $current_section) {
|
33 |
-
|
34 |
-
$settings = array(
|
35 |
-
'qlwcdc_section_title' => array(
|
36 |
-
'name' => __('General', 'woocommerce-direct-checkout'),
|
37 |
-
'type' => 'title',
|
38 |
-
'desc' => __('Simplifies the checkout process.', 'woocommerce-direct-checkout'),
|
39 |
-
'id' => 'qlwcdc_section_title'
|
40 |
-
),
|
41 |
-
'add_to_cart_message' => array(
|
42 |
-
'name' => __('Added to cart alert', 'woocommerce-direct-checkout'),
|
43 |
-
'desc_tip' => __('Replace "View Cart" alert with direct checkout.', 'woocommerce-direct-checkout'),
|
44 |
-
'id' => 'qlwcdc_add_to_cart_message',
|
45 |
-
'type' => 'select',
|
46 |
-
'class' => 'chosen_select',
|
47 |
-
'options' => array(
|
48 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
49 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
50 |
-
),
|
51 |
-
'default' => 'no',
|
52 |
-
),
|
53 |
-
'add_to_cart_link' => array(
|
54 |
-
'name' => __('Added to cart link', 'woocommerce-direct-checkout'),
|
55 |
-
'desc_tip' => __('Replace "View Cart" link with direct checkout.', 'woocommerce-direct-checkout'),
|
56 |
-
'id' => 'qlwcdc_add_to_cart_link',
|
57 |
-
'type' => 'select',
|
58 |
-
'class' => 'chosen_select',
|
59 |
-
'options' => array(
|
60 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
61 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
62 |
-
),
|
63 |
-
'default' => 'no',
|
64 |
-
),
|
65 |
-
'add_to_cart' => array(
|
66 |
-
'name' => __('Added to cart redirect', 'woocommerce-direct-checkout'),
|
67 |
-
'desc_tip' => __('Add to cart button behaviour.', 'woocommerce-direct-checkout'),
|
68 |
-
'id' => 'qlwcdc_add_to_cart',
|
69 |
-
'type' => 'select',
|
70 |
-
'class' => 'chosen_select',
|
71 |
-
'options' => array(
|
72 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
73 |
-
//'ajax' => __('Ajax', 'woocommerce-direct-checkout'),
|
74 |
-
'redirect' => __('Yes', 'woocommerce-direct-checkout'),
|
75 |
-
),
|
76 |
-
'default' => 'no',
|
77 |
-
),
|
78 |
-
/* 'add_to_cart_ajax_button' => array(
|
79 |
-
'name' => __('Added to cart button', 'woocommerce-direct-checkout'),
|
80 |
-
'desc_tip' => __('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
|
81 |
-
'id' => 'qlwcdc_add_to_cart_ajax_button',
|
82 |
-
'type' => 'select',
|
83 |
-
'options' => array(
|
84 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
85 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
86 |
-
),
|
87 |
-
'default' => 'no',
|
88 |
-
), */
|
89 |
-
/* 'add_to_cart_ajax_message' => array(
|
90 |
-
'name' => __('Added to cart alert', 'woocommerce-direct-checkout'),
|
91 |
-
'desc_tip' => __('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
|
92 |
-
'id' => 'qlwcdc_add_to_cart_ajax_message',
|
93 |
-
'type' => 'select',
|
94 |
-
'class' => 'chosen_select',
|
95 |
-
'options' => array(
|
96 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
97 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
98 |
-
),
|
99 |
-
'default' => 'yes',
|
100 |
-
), */
|
101 |
-
'add_to_cart_redirect_page' => array(
|
102 |
-
'name' => __('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
103 |
-
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
104 |
-
'id' => 'qlwcdc_add_to_cart_redirect_page',
|
105 |
-
'type' => 'select',
|
106 |
-
'class' => 'chosen_select',
|
107 |
-
'options' => array(
|
108 |
-
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
109 |
-
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
110 |
-
'url' => __('Custom URL', 'woocommerce-direct-checkout'),
|
111 |
-
),
|
112 |
-
'default' => 'cart',
|
113 |
-
),
|
114 |
-
'add_to_cart_redirect_url' => array(
|
115 |
-
'name' => __('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
116 |
-
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
117 |
-
'id' => 'qlwcdc_add_to_cart_redirect_url',
|
118 |
-
'type' => 'text',
|
119 |
-
'placeholder' => wc_get_checkout_url(),
|
120 |
-
),
|
121 |
-
'qlwcdc_section_end' => array(
|
122 |
-
'type' => 'sectionend',
|
123 |
-
'id' => 'qlwcdc_section_end'
|
124 |
-
)
|
125 |
-
);
|
126 |
-
}
|
127 |
-
|
128 |
-
return $settings;
|
129 |
-
}
|
130 |
-
|
131 |
-
function add_to_cart_params($params) {
|
132 |
-
|
133 |
-
if ('yes' === get_option('qlwcdc_add_to_cart_link')) {
|
134 |
-
$params['cart_url'] = wc_get_checkout_url();
|
135 |
-
$params['i18n_view_cart'] = esc_html__('Checkout', 'woocommerce-direct-checkout');
|
136 |
-
}
|
137 |
-
|
138 |
-
return $params;
|
139 |
-
}
|
140 |
-
|
141 |
-
function add_to_cart_message($message) {
|
142 |
-
|
143 |
-
if ('yes' === get_option('qlwcdc_add_to_cart_message')) {
|
144 |
-
|
145 |
-
$message = str_replace(wc_get_page_permalink('cart'), wc_get_page_permalink('checkout'), $message);
|
146 |
-
|
147 |
-
$message = str_replace(esc_html__('View cart', 'woocommerce'), esc_html__('Checkout', 'woocommerce'), $message);
|
148 |
-
}
|
149 |
-
|
150 |
-
return $message;
|
151 |
-
}
|
152 |
-
|
153 |
-
function add_to_cart_redirect($url) {
|
154 |
-
|
155 |
-
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
156 |
-
if ('cart' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
157 |
-
$url = wc_get_cart_url();
|
158 |
-
} elseif ('url' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
159 |
-
$url = get_option('qlwcdc_add_to_cart_redirect_url');
|
160 |
-
} else {
|
161 |
-
$url = wc_get_checkout_url();
|
162 |
-
}
|
163 |
-
}
|
164 |
-
|
165 |
-
return $url;
|
166 |
-
}
|
167 |
-
|
168 |
-
function init() {
|
169 |
-
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
170 |
-
add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
|
171 |
-
add_filter('woocommerce_get_script_data', array($this, 'add_to_cart_params'));
|
172 |
-
add_filter('wc_add_to_cart_message_html', array($this, 'add_to_cart_message'));
|
173 |
-
add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
|
174 |
-
|
175 |
-
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
176 |
-
add_filter('option_woocommerce_enable_ajax_add_to_cart', '__return_false');
|
177 |
-
add_filter('option_woocommerce_cart_redirect_after_add', '__return_false');
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
}
|
182 |
-
|
183 |
-
QLWCDC_General::instance();
|
184 |
Â
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
die('-1');
|
5 |
+
}
|
6 |
+
|
7 |
+
if (!class_exists('QLWCDC_General')) {
|
8 |
+
|
9 |
+
class QLWCDC_General {
|
10 |
+
|
11 |
+
protected static $instance;
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (!isset(self::$instance)) {
|
15 |
+
self::$instance = new self();
|
16 |
+
self::$instance->init();
|
17 |
+
}
|
18 |
+
return self::$instance;
|
19 |
+
}
|
20 |
+
|
21 |
+
function add_section($sections) {
|
22 |
+
|
23 |
+
$sections[''] = __('General', 'woocommerce-direct-checkout');
|
24 |
+
|
25 |
+
return $sections;
|
26 |
+
}
|
27 |
+
|
28 |
+
function add_fields($settings) {
|
29 |
+
|
30 |
+
global $current_section;
|
31 |
+
|
32 |
+
if ('' == $current_section) {
|
33 |
+
|
34 |
+
$settings = array(
|
35 |
+
'qlwcdc_section_title' => array(
|
36 |
+
'name' => __('General', 'woocommerce-direct-checkout'),
|
37 |
+
'type' => 'title',
|
38 |
+
'desc' => __('Simplifies the checkout process.', 'woocommerce-direct-checkout'),
|
39 |
+
'id' => 'qlwcdc_section_title'
|
40 |
+
),
|
41 |
+
'add_to_cart_message' => array(
|
42 |
+
'name' => __('Added to cart alert', 'woocommerce-direct-checkout'),
|
43 |
+
'desc_tip' => __('Replace "View Cart" alert with direct checkout.', 'woocommerce-direct-checkout'),
|
44 |
+
'id' => 'qlwcdc_add_to_cart_message',
|
45 |
+
'type' => 'select',
|
46 |
+
'class' => 'chosen_select',
|
47 |
+
'options' => array(
|
48 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
49 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
50 |
+
),
|
51 |
+
'default' => 'no',
|
52 |
+
),
|
53 |
+
'add_to_cart_link' => array(
|
54 |
+
'name' => __('Added to cart link', 'woocommerce-direct-checkout'),
|
55 |
+
'desc_tip' => __('Replace "View Cart" link with direct checkout.', 'woocommerce-direct-checkout'),
|
56 |
+
'id' => 'qlwcdc_add_to_cart_link',
|
57 |
+
'type' => 'select',
|
58 |
+
'class' => 'chosen_select',
|
59 |
+
'options' => array(
|
60 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
61 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
62 |
+
),
|
63 |
+
'default' => 'no',
|
64 |
+
),
|
65 |
+
'add_to_cart' => array(
|
66 |
+
'name' => __('Added to cart redirect', 'woocommerce-direct-checkout'),
|
67 |
+
'desc_tip' => __('Add to cart button behaviour.', 'woocommerce-direct-checkout'),
|
68 |
+
'id' => 'qlwcdc_add_to_cart',
|
69 |
+
'type' => 'select',
|
70 |
+
'class' => 'chosen_select',
|
71 |
+
'options' => array(
|
72 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
73 |
+
//'ajax' => __('Ajax', 'woocommerce-direct-checkout'),
|
74 |
+
'redirect' => __('Yes', 'woocommerce-direct-checkout'),
|
75 |
+
),
|
76 |
+
'default' => 'no',
|
77 |
+
),
|
78 |
+
/* 'add_to_cart_ajax_button' => array(
|
79 |
+
'name' => __('Added to cart button', 'woocommerce-direct-checkout'),
|
80 |
+
'desc_tip' => __('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
|
81 |
+
'id' => 'qlwcdc_add_to_cart_ajax_button',
|
82 |
+
'type' => 'select',
|
83 |
+
'options' => array(
|
84 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
85 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
86 |
+
),
|
87 |
+
'default' => 'no',
|
88 |
+
), */
|
89 |
+
/* 'add_to_cart_ajax_message' => array(
|
90 |
+
'name' => __('Added to cart alert', 'woocommerce-direct-checkout'),
|
91 |
+
'desc_tip' => __('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
|
92 |
+
'id' => 'qlwcdc_add_to_cart_ajax_message',
|
93 |
+
'type' => 'select',
|
94 |
+
'class' => 'chosen_select',
|
95 |
+
'options' => array(
|
96 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
97 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
98 |
+
),
|
99 |
+
'default' => 'yes',
|
100 |
+
), */
|
101 |
+
'add_to_cart_redirect_page' => array(
|
102 |
+
'name' => __('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
103 |
+
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
104 |
+
'id' => 'qlwcdc_add_to_cart_redirect_page',
|
105 |
+
'type' => 'select',
|
106 |
+
'class' => 'chosen_select',
|
107 |
+
'options' => array(
|
108 |
+
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
109 |
+
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
110 |
+
'url' => __('Custom URL', 'woocommerce-direct-checkout'),
|
111 |
+
),
|
112 |
+
'default' => 'cart',
|
113 |
+
),
|
114 |
+
'add_to_cart_redirect_url' => array(
|
115 |
+
'name' => __('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
116 |
+
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
117 |
+
'id' => 'qlwcdc_add_to_cart_redirect_url',
|
118 |
+
'type' => 'text',
|
119 |
+
'placeholder' => wc_get_checkout_url(),
|
120 |
+
),
|
121 |
+
'qlwcdc_section_end' => array(
|
122 |
+
'type' => 'sectionend',
|
123 |
+
'id' => 'qlwcdc_section_end'
|
124 |
+
)
|
125 |
+
);
|
126 |
+
}
|
127 |
+
|
128 |
+
return $settings;
|
129 |
+
}
|
130 |
+
|
131 |
+
function add_to_cart_params($params) {
|
132 |
+
|
133 |
+
if ('yes' === get_option('qlwcdc_add_to_cart_link')) {
|
134 |
+
$params['cart_url'] = wc_get_checkout_url();
|
135 |
+
$params['i18n_view_cart'] = esc_html__('Checkout', 'woocommerce-direct-checkout');
|
136 |
+
}
|
137 |
+
|
138 |
+
return $params;
|
139 |
+
}
|
140 |
+
|
141 |
+
function add_to_cart_message($message) {
|
142 |
+
|
143 |
+
if ('yes' === get_option('qlwcdc_add_to_cart_message')) {
|
144 |
+
|
145 |
+
$message = str_replace(wc_get_page_permalink('cart'), wc_get_page_permalink('checkout'), $message);
|
146 |
+
|
147 |
+
$message = str_replace(esc_html__('View cart', 'woocommerce'), esc_html__('Checkout', 'woocommerce'), $message);
|
148 |
+
}
|
149 |
+
|
150 |
+
return $message;
|
151 |
+
}
|
152 |
+
|
153 |
+
function add_to_cart_redirect($url) {
|
154 |
+
|
155 |
+
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
156 |
+
if ('cart' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
157 |
+
$url = wc_get_cart_url();
|
158 |
+
} elseif ('url' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
159 |
+
$url = get_option('qlwcdc_add_to_cart_redirect_url');
|
160 |
+
} else {
|
161 |
+
$url = wc_get_checkout_url();
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
return $url;
|
166 |
+
}
|
167 |
+
|
168 |
+
function init() {
|
169 |
+
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
170 |
+
add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
|
171 |
+
add_filter('woocommerce_get_script_data', array($this, 'add_to_cart_params'));
|
172 |
+
add_filter('wc_add_to_cart_message_html', array($this, 'add_to_cart_message'));
|
173 |
+
add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
|
174 |
+
|
175 |
+
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
176 |
+
add_filter('option_woocommerce_enable_ajax_add_to_cart', '__return_false');
|
177 |
+
add_filter('option_woocommerce_cart_redirect_after_add', '__return_false');
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
}
|
182 |
+
|
183 |
+
QLWCDC_General::instance();
|
184 |
Â
}
|
includes/products.php
CHANGED
@@ -1,504 +1,529 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
die('-1');
|
4 |
-
}
|
5 |
-
|
6 |
-
if (!class_exists('QLWCDC_Products')) {
|
7 |
-
|
8 |
-
class QLWCDC_Products extends QLWCDC {
|
9 |
-
|
10 |
-
protected static $instance;
|
11 |
-
var $product_fields;
|
12 |
-
|
13 |
-
function add_section($sections = array()) {
|
14 |
-
|
15 |
-
$sections['products'] = __('Products', 'woocommerce-direct-checkout');
|
16 |
-
|
17 |
-
return $sections;
|
18 |
-
}
|
19 |
-
|
20 |
-
function add_fields($fields) {
|
21 |
-
|
22 |
-
global $current_section;
|
23 |
-
|
24 |
-
if ('products' == $current_section) {
|
25 |
-
|
26 |
-
$fields = array(
|
27 |
-
'section_title' => array(
|
28 |
-
'name' => __('Products', 'woocommerce-direct-checkout'),
|
29 |
-
'type' => 'title',
|
30 |
-
'id' => 'qlwcdc_products_section_title'
|
31 |
-
),
|
32 |
-
/*'add_product_cart' => array(
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
'add_product_text' => array(
|
89 |
-
'name' => __('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
90 |
-
'desc_tip' => __('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
91 |
-
'id' => 'qlwcdc_add_product_text',
|
92 |
-
'type' => 'select',
|
93 |
-
'class' => 'chosen_select',
|
94 |
-
'options' => array(
|
95 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
96 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
97 |
-
),
|
98 |
-
'default' => 'no',
|
99 |
-
),
|
100 |
-
'add_product_text_content' => array(
|
101 |
-
'name' => __('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
102 |
-
'desc_tip' => __('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
103 |
-
'id' => 'qlwcdc_add_product_text_content',
|
104 |
-
'type' => 'text',
|
105 |
-
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout')
|
106 |
-
),
|
107 |
-
'add_product_quick_purchase' => array(
|
108 |
-
'name' => __('Add quick purchase button', 'woocommerce-direct-checkout'),
|
109 |
-
'desc_tip' => __('Add a quick purchase button to the products pages.', 'woocommerce-direct-checkout'),
|
110 |
-
'id' => 'qlwcdc_add_product_quick_purchase',
|
111 |
-
'type' => 'select',
|
112 |
-
'class' => 'chosen_select',
|
113 |
-
'options' => array(
|
114 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
115 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
116 |
-
),
|
117 |
-
'default' => 'no',
|
118 |
-
),
|
119 |
-
'add_product_quick_purchase_class' => array(
|
120 |
-
'name' => __('Add quick purchase class', 'woocommerce-direct-checkout'),
|
121 |
-
'desc_tip' => __('Add a custom class to the quick purchase button.', 'woocommerce-direct-checkout'),
|
122 |
-
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
123 |
-
'type' => 'text',
|
124 |
-
'default' => ''
|
125 |
-
),
|
126 |
-
'add_product_quick_purchase_to' => array(
|
127 |
-
'name' => __('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
128 |
-
'desc_tip' => __('Redirect the quick purchase button to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
129 |
-
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
130 |
-
'type' => 'select',
|
131 |
-
'class' => 'chosen_select',
|
132 |
-
'options' => array(
|
133 |
-
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
134 |
-
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
135 |
-
),
|
136 |
-
'default' => 'checkout',
|
137 |
-
),
|
138 |
-
'add_product_quick_purchase_text' => array(
|
139 |
-
'name' => __('Add quick purchase text', 'woocommerce-direct-checkout'),
|
140 |
-
'desc_tip' => __('Add a custom text to the quick purchase button.', 'woocommerce-direct-checkout'),
|
141 |
-
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
142 |
-
'type' => 'text',
|
143 |
-
'default' => esc_html__('Purchase Now', 'woocommerce-direct-checkout')
|
144 |
-
),
|
145 |
-
'add_product_default_attributes' => array(
|
146 |
-
'name' => __('Add default attributes in variable products', 'woocommerce-direct-checkout'),
|
147 |
-
'desc_tip' => __('Add default attributes in all variable products to avoid disabled Add to cart button.', 'woocommerce-direct-checkout'),
|
148 |
-
'id' => 'qlwcdc_add_product_default_attributes',
|
149 |
-
'type' => 'select',
|
150 |
-
'class' => 'chosen_select',
|
151 |
-
'options' => array(
|
152 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
153 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
154 |
-
),
|
155 |
-
'default' => 'no',
|
156 |
-
),
|
157 |
-
'section_end' => array(
|
158 |
-
'type' => 'sectionend',
|
159 |
-
'id' => 'qlwcdc_products_section_end'
|
160 |
-
)
|
161 |
-
);
|
162 |
-
}
|
163 |
-
|
164 |
-
return $fields;
|
165 |
-
}
|
166 |
-
|
167 |
-
function add_product_fields() {
|
168 |
-
|
169 |
-
global $thepostid;
|
170 |
-
|
171 |
-
if ($this->product_fields)
|
172 |
-
return;
|
173 |
-
|
174 |
-
// Fields
|
175 |
-
$this->product_fields = array(
|
176 |
-
/*'start_group',
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
'start_group',
|
238 |
-
array(
|
239 |
-
'label' => __('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
240 |
-
'desc_tip' => true,
|
241 |
-
'description' => __('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
242 |
-
'id' => 'qlwcdc_add_product_text',
|
243 |
-
'type' => 'select',
|
244 |
-
'options' => array(
|
245 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
246 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
247 |
-
),
|
248 |
-
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_text', 'no'),
|
249 |
-
),
|
250 |
-
array(
|
251 |
-
'label' => __('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
252 |
-
'desc_tip' => true,
|
253 |
-
'description' => __('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
254 |
-
'id' => 'qlwcdc_add_product_text_content',
|
255 |
-
'type' => 'text',
|
256 |
-
'placeholder' => get_option('qlwcdc_add_product_text_content'),
|
257 |
-
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_text_content'),
|
258 |
-
),
|
259 |
-
'start_group',
|
260 |
-
'end_group',
|
261 |
-
array(
|
262 |
-
'label' => __('Add quick purchase button', 'woocommerce-direct-checkout'),
|
263 |
-
'desc_tip' => true,
|
264 |
-
'description' => __('Add quick purchase button to single product page.', 'woocommerce-direct-checkout'),
|
265 |
-
'id' => 'qlwcdc_add_product_quick_purchase',
|
266 |
-
'class' => 'short',
|
267 |
-
'type' => 'select',
|
268 |
-
'options' => array(
|
269 |
-
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
270 |
-
'no' => __('No', 'woocommerce-direct-checkout'),
|
271 |
-
),
|
272 |
-
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase', 'no')
|
273 |
-
),
|
274 |
-
array(
|
275 |
-
'label' => __('Add quick purchase class', 'woocommerce-direct-checkout'),
|
276 |
-
'desc_tip' => true,
|
277 |
-
'description' => __('Add quick purchase custom class.', 'woocommerce-direct-checkout'),
|
278 |
-
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
279 |
-
'type' => 'text',
|
280 |
-
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_class'),
|
281 |
-
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_class'),
|
282 |
-
),
|
283 |
-
array(
|
284 |
-
'label' => __('Add quick purchase text', 'woocommerce-direct-checkout'),
|
285 |
-
'desc_tip' => true,
|
286 |
-
'description' => __('Add quick purchase custom text.', 'woocommerce-direct-checkout'),
|
287 |
-
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
288 |
-
'type' => 'text',
|
289 |
-
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_text'),
|
290 |
-
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_text'),
|
291 |
-
),
|
292 |
-
array(
|
293 |
-
'label' => __('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
294 |
-
'desc_tip' => true,
|
295 |
-
'description' => __('Redirect quick purchase to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
296 |
-
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
297 |
-
'type' => 'select',
|
298 |
-
'options' => array(
|
299 |
-
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
300 |
-
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
301 |
-
),
|
302 |
-
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_to', 'checkout'),
|
303 |
-
),
|
304 |
-
'end_group',
|
305 |
-
);
|
306 |
-
}
|
307 |
-
|
308 |
-
function add_product_tabs($tabs) {
|
309 |
-
|
310 |
-
$tabs[QLWCDC_DOMAIN] = array(
|
311 |
-
'label' => __('Direct Checkout', 'qlwdd'),
|
312 |
-
'target' => 'qlwcdc_options',
|
313 |
-
);
|
314 |
-
|
315 |
-
return $tabs;
|
316 |
-
}
|
317 |
-
|
318 |
-
function add_setting_field($field) {
|
319 |
-
|
320 |
-
if (!isset($field['id'])) {
|
321 |
-
if ($field == 'start_group') {
|
322 |
-
echo '<div class="options_group">';
|
323 |
-
} elseif ($field == 'end_group') {
|
324 |
-
echo '</div>';
|
325 |
-
}
|
326 |
-
} else {
|
327 |
-
|
328 |
-
if (function_exists($function = 'woocommerce_wp_' . $field['type'])) {
|
329 |
-
$function($field);
|
330 |
-
} elseif (function_exists($function = 'woocommerce_wp_' . $field['type'] . '_input')) {
|
331 |
-
$function($field);
|
332 |
-
} else {
|
333 |
-
woocommerce_wp_text_input($field);
|
334 |
-
}
|
335 |
-
}
|
336 |
-
}
|
337 |
-
|
338 |
-
function add_product_tab_content() {
|
339 |
-
|
340 |
-
$this->add_product_fields();
|
341 |
-
?>
|
342 |
-
<div id="qlwcdc_options" class="panel woocommerce_options_panel" style="display: none;">
|
343 |
-
<?php
|
344 |
-
foreach ($this->product_fields as $field) {
|
345 |
-
$this->add_setting_field($field);
|
346 |
-
}
|
347 |
-
?>
|
348 |
-
</div>
|
349 |
-
<?php
|
350 |
-
}
|
351 |
-
|
352 |
-
/*function added_to_cart_button() {
|
353 |
-
|
354 |
-
global $product;
|
355 |
-
|
356 |
-
if ('no' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart_ajax_button', 'no')) {
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
}
|
365 |
-
|
366 |
-
|
367 |
-
/*function add_to_cart_redirect($url) {
|
368 |
-
|
369 |
-
//return 'https://1326';
|
370 |
-
|
371 |
-
if (is_product()) {
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
}
|
388 |
-
|
389 |
-
return $url;
|
390 |
-
|
391 |
-
|
392 |
-
/*function added_to_cart_message_js() {
|
393 |
-
|
394 |
-
global $product;
|
395 |
-
|
396 |
-
if ('ajax' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart', 'no') && 'yes' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart_ajax_message', 'yes')) {
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
}
|
407 |
-
if ('redirect' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart', 'no')) {
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
}
|
420 |
-
|
421 |
-
|
422 |
-
function add_product_text($text, $product) {
|
423 |
-
|
424 |
-
if ('yes' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_text')) {
|
425 |
-
$text = esc_html__($this->get_product_option($product->get_id(), 'qlwcdc_add_product_text_content'), $text);
|
426 |
-
}
|
427 |
-
|
428 |
-
return $text;
|
429 |
-
}
|
430 |
-
|
431 |
-
/*function add_product_cart_ajax_message() {
|
432 |
-
|
433 |
-
global $wp_query;
|
434 |
-
|
435 |
-
if (!check_ajax_referer('woocommerce-direct-checkout', 'nonce', false)) {
|
436 |
-
|
437 |
-
}
|
438 |
-
|
439 |
-
if (isset($_POST['queried_object_id'])) {
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
}
|
450 |
-
|
451 |
-
ob_start();
|
452 |
-
|
453 |
-
woocommerce_output_all_notices();
|
454 |
-
|
455 |
-
$data = ob_get_clean();
|
456 |
-
|
457 |
-
wp_send_json($data);
|
458 |
-
|
459 |
-
|
460 |
-
/*function add_to_cart_class($class) {
|
461 |
-
|
462 |
-
if (is_product() && get_option('qlwcdc_add_product_ajax')) {
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
}
|
468 |
-
|
469 |
-
return $class;
|
470 |
-
|
471 |
-
|
472 |
-
/*function add_storefront_notices() {
|
473 |
-
if (is_product() && 'yes' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_ajax_message', 'no')) {
|
474 |
-
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
function
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
return
|
499 |
-
}
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
504 |
Â
}
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
die('-1');
|
4 |
+
}
|
5 |
+
|
6 |
+
if (!class_exists('QLWCDC_Products')) {
|
7 |
+
|
8 |
+
class QLWCDC_Products extends QLWCDC {
|
9 |
+
|
10 |
+
protected static $instance;
|
11 |
+
var $product_fields;
|
12 |
+
|
13 |
+
function add_section($sections = array()) {
|
14 |
+
|
15 |
+
$sections['products'] = __('Products', 'woocommerce-direct-checkout');
|
16 |
+
|
17 |
+
return $sections;
|
18 |
+
}
|
19 |
+
|
20 |
+
function add_fields($fields) {
|
21 |
+
|
22 |
+
global $current_section;
|
23 |
+
|
24 |
+
if ('products' == $current_section) {
|
25 |
+
|
26 |
+
$fields = array(
|
27 |
+
'section_title' => array(
|
28 |
+
'name' => __('Products', 'woocommerce-direct-checkout'),
|
29 |
+
'type' => 'title',
|
30 |
+
'id' => 'qlwcdc_products_section_title'
|
31 |
+
),
|
32 |
+
/* 'add_product_cart' => array(
|
33 |
+
'name' => __('Add to cart', 'woocommerce-direct-checkout'),
|
34 |
+
'desc_tip' => __('Add to cart button behaviour in products pages.', 'woocommerce-direct-checkout'),
|
35 |
+
'id' => 'qlwcdc_add_product_cart',
|
36 |
+
'type' => 'select',
|
37 |
+
'class' => 'chosen_select',
|
38 |
+
'options' => array(
|
39 |
+
'no' => __('Reload', 'woocommerce-direct-checkout'),
|
40 |
+
'ajax' => __('Ajax', 'woocommerce-direct-checkout'),
|
41 |
+
'redirect' => __('Redirect', 'woocommerce-direct-checkout'),
|
42 |
+
),
|
43 |
+
'default' => 'no',
|
44 |
+
),
|
45 |
+
'add_product_cart_ajax_button' => array(
|
46 |
+
'name' => __('Added to cart button', 'woocommerce-direct-checkout'),
|
47 |
+
'desc_tip' => __('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
|
48 |
+
'id' => 'qlwcdc_add_product_cart_ajax_button',
|
49 |
+
'type' => 'select',
|
50 |
+
'options' => array(
|
51 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
52 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
53 |
+
),
|
54 |
+
'default' => 'no',
|
55 |
+
),
|
56 |
+
'add_product_cart_ajax_message' => array(
|
57 |
+
'name' => __('Added to cart alert', 'woocommerce-direct-checkout'),
|
58 |
+
'desc_tip' => __('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
|
59 |
+
'id' => 'qlwcdc_add_product_cart_ajax_message',
|
60 |
+
'type' => 'select',
|
61 |
+
'class' => 'chosen_select',
|
62 |
+
'options' => array(
|
63 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
64 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
65 |
+
),
|
66 |
+
'default' => 'yes',
|
67 |
+
),
|
68 |
+
'add_product_cart_redirect_page' => array(
|
69 |
+
'name' => __('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
70 |
+
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
71 |
+
'id' => 'qlwcdc_add_product_cart_redirect_page',
|
72 |
+
'type' => 'select',
|
73 |
+
'class' => 'chosen_select',
|
74 |
+
'options' => array(
|
75 |
+
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
76 |
+
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
77 |
+
'url' => __('Custom URL', 'woocommerce-direct-checkout'),
|
78 |
+
),
|
79 |
+
'default' => 'cart',
|
80 |
+
),
|
81 |
+
'add_product_cart_redirect_url' => array(
|
82 |
+
'name' => __('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
83 |
+
'desc_tip' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
84 |
+
'id' => 'qlwcdc_add_product_cart_redirect_url',
|
85 |
+
'type' => 'text',
|
86 |
+
'placeholder' => wc_get_checkout_url(),
|
87 |
+
), */
|
88 |
+
'add_product_text' => array(
|
89 |
+
'name' => __('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
90 |
+
'desc_tip' => __('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
91 |
+
'id' => 'qlwcdc_add_product_text',
|
92 |
+
'type' => 'select',
|
93 |
+
'class' => 'chosen_select',
|
94 |
+
'options' => array(
|
95 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
96 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
97 |
+
),
|
98 |
+
'default' => 'no',
|
99 |
+
),
|
100 |
+
'add_product_text_content' => array(
|
101 |
+
'name' => __('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
102 |
+
'desc_tip' => __('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
103 |
+
'id' => 'qlwcdc_add_product_text_content',
|
104 |
+
'type' => 'text',
|
105 |
+
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout')
|
106 |
+
),
|
107 |
+
'add_product_quick_purchase' => array(
|
108 |
+
'name' => __('Add quick purchase button', 'woocommerce-direct-checkout'),
|
109 |
+
'desc_tip' => __('Add a quick purchase button to the products pages.', 'woocommerce-direct-checkout'),
|
110 |
+
'id' => 'qlwcdc_add_product_quick_purchase',
|
111 |
+
'type' => 'select',
|
112 |
+
'class' => 'chosen_select',
|
113 |
+
'options' => array(
|
114 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
115 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
116 |
+
),
|
117 |
+
'default' => 'no',
|
118 |
+
),
|
119 |
+
'add_product_quick_purchase_class' => array(
|
120 |
+
'name' => __('Add quick purchase class', 'woocommerce-direct-checkout'),
|
121 |
+
'desc_tip' => __('Add a custom class to the quick purchase button.', 'woocommerce-direct-checkout'),
|
122 |
+
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
123 |
+
'type' => 'text',
|
124 |
+
'default' => ''
|
125 |
+
),
|
126 |
+
'add_product_quick_purchase_to' => array(
|
127 |
+
'name' => __('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
128 |
+
'desc_tip' => __('Redirect the quick purchase button to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
129 |
+
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
130 |
+
'type' => 'select',
|
131 |
+
'class' => 'chosen_select',
|
132 |
+
'options' => array(
|
133 |
+
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
134 |
+
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
135 |
+
),
|
136 |
+
'default' => 'checkout',
|
137 |
+
),
|
138 |
+
'add_product_quick_purchase_text' => array(
|
139 |
+
'name' => __('Add quick purchase text', 'woocommerce-direct-checkout'),
|
140 |
+
'desc_tip' => __('Add a custom text to the quick purchase button.', 'woocommerce-direct-checkout'),
|
141 |
+
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
142 |
+
'type' => 'text',
|
143 |
+
'default' => esc_html__('Purchase Now', 'woocommerce-direct-checkout')
|
144 |
+
),
|
145 |
+
'add_product_default_attributes' => array(
|
146 |
+
'name' => __('Add default attributes in variable products', 'woocommerce-direct-checkout'),
|
147 |
+
'desc_tip' => __('Add default attributes in all variable products to avoid disabled Add to cart button.', 'woocommerce-direct-checkout'),
|
148 |
+
'id' => 'qlwcdc_add_product_default_attributes',
|
149 |
+
'type' => 'select',
|
150 |
+
'class' => 'chosen_select',
|
151 |
+
'options' => array(
|
152 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
153 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
154 |
+
),
|
155 |
+
'default' => 'no',
|
156 |
+
),
|
157 |
+
'section_end' => array(
|
158 |
+
'type' => 'sectionend',
|
159 |
+
'id' => 'qlwcdc_products_section_end'
|
160 |
+
)
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
return $fields;
|
165 |
+
}
|
166 |
+
|
167 |
+
function add_product_fields() {
|
168 |
+
|
169 |
+
global $thepostid;
|
170 |
+
|
171 |
+
if ($this->product_fields)
|
172 |
+
return;
|
173 |
+
|
174 |
+
// Fields
|
175 |
+
$this->product_fields = array(
|
176 |
+
/* 'start_group',
|
177 |
+
array(
|
178 |
+
'label' => __('Add to cart', 'woocommerce-direct-checkout'),
|
179 |
+
'desc_tip' => true,
|
180 |
+
'description' => __('Add to cart behaviour for this product.', 'woocommerce-direct-checkout'),
|
181 |
+
'id' => 'qlwcdc_add_product_cart',
|
182 |
+
'type' => 'select',
|
183 |
+
'options' => array(
|
184 |
+
'no' => __('Reload', 'woocommerce-direct-checkout'),
|
185 |
+
'ajax' => __('Ajax', 'woocommerce-direct-checkout'),
|
186 |
+
'redirect' => __('Redirect', 'woocommerce-direct-checkout'),
|
187 |
+
),
|
188 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_cart', 'no'),
|
189 |
+
),
|
190 |
+
array(
|
191 |
+
'label' => __('Ajax added to cart button', 'woocommerce-direct-checkout'),
|
192 |
+
'desc_tip' => true,
|
193 |
+
'description' => __('Display ajax added to cart button.', 'woocommerce-direct-checkout'),
|
194 |
+
'id' => 'qlwcdc_add_product_cart_ajax_button',
|
195 |
+
'type' => 'select',
|
196 |
+
'options' => array(
|
197 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
198 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
199 |
+
),
|
200 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_cart_ajax_button', 'no'),
|
201 |
+
),
|
202 |
+
array(
|
203 |
+
'label' => __('Ajax added to cart alert', 'woocommerce-direct-checkout'),
|
204 |
+
'desc_tip' => true,
|
205 |
+
'description' => __('Display ajax added to cart alert for this product.', 'woocommerce-direct-checkout'),
|
206 |
+
'id' => 'qlwcdc_add_product_cart_ajax_message',
|
207 |
+
'type' => 'select',
|
208 |
+
'options' => array(
|
209 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
210 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
211 |
+
),
|
212 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_cart_ajax_message', 'no'),
|
213 |
+
),
|
214 |
+
array(
|
215 |
+
'label' => __('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
216 |
+
'desc_tip' => true,
|
217 |
+
'description' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
218 |
+
'id' => 'qlwcdc_add_product_cart_redirect_page',
|
219 |
+
'type' => 'select',
|
220 |
+
'options' => array(
|
221 |
+
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
222 |
+
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
223 |
+
'url' => __('Custom URL', 'woocommerce-direct-checkout'),
|
224 |
+
),
|
225 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_cart_redirect_page', 'cart'),
|
226 |
+
),
|
227 |
+
array(
|
228 |
+
'label' => __('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
229 |
+
'desc_tip' => true,
|
230 |
+
'description' => __('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
231 |
+
'id' => 'qlwcdc_add_product_cart_redirect_url',
|
232 |
+
'type' => 'text',
|
233 |
+
'placeholder' => get_option('qlwcdc_add_product_cart_redirect_url'),
|
234 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_cart_redirect_url'),
|
235 |
+
),
|
236 |
+
'end_group', */
|
237 |
+
'start_group',
|
238 |
+
array(
|
239 |
+
'label' => __('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
240 |
+
'desc_tip' => true,
|
241 |
+
'description' => __('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
242 |
+
'id' => 'qlwcdc_add_product_text',
|
243 |
+
'type' => 'select',
|
244 |
+
'options' => array(
|
245 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
246 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
247 |
+
),
|
248 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_text', 'no'),
|
249 |
+
),
|
250 |
+
array(
|
251 |
+
'label' => __('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
252 |
+
'desc_tip' => true,
|
253 |
+
'description' => __('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
254 |
+
'id' => 'qlwcdc_add_product_text_content',
|
255 |
+
'type' => 'text',
|
256 |
+
'placeholder' => get_option('qlwcdc_add_product_text_content'),
|
257 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_text_content'),
|
258 |
+
),
|
259 |
+
'start_group',
|
260 |
+
'end_group',
|
261 |
+
array(
|
262 |
+
'label' => __('Add quick purchase button', 'woocommerce-direct-checkout'),
|
263 |
+
'desc_tip' => true,
|
264 |
+
'description' => __('Add quick purchase button to single product page.', 'woocommerce-direct-checkout'),
|
265 |
+
'id' => 'qlwcdc_add_product_quick_purchase',
|
266 |
+
'class' => 'short',
|
267 |
+
'type' => 'select',
|
268 |
+
'options' => array(
|
269 |
+
'yes' => __('Yes', 'woocommerce-direct-checkout'),
|
270 |
+
'no' => __('No', 'woocommerce-direct-checkout'),
|
271 |
+
),
|
272 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase', 'no')
|
273 |
+
),
|
274 |
+
array(
|
275 |
+
'label' => __('Add quick purchase class', 'woocommerce-direct-checkout'),
|
276 |
+
'desc_tip' => true,
|
277 |
+
'description' => __('Add quick purchase custom class.', 'woocommerce-direct-checkout'),
|
278 |
+
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
279 |
+
'type' => 'text',
|
280 |
+
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_class'),
|
281 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_class'),
|
282 |
+
),
|
283 |
+
array(
|
284 |
+
'label' => __('Add quick purchase text', 'woocommerce-direct-checkout'),
|
285 |
+
'desc_tip' => true,
|
286 |
+
'description' => __('Add quick purchase custom text.', 'woocommerce-direct-checkout'),
|
287 |
+
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
288 |
+
'type' => 'text',
|
289 |
+
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_text'),
|
290 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_text'),
|
291 |
+
),
|
292 |
+
array(
|
293 |
+
'label' => __('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
294 |
+
'desc_tip' => true,
|
295 |
+
'description' => __('Redirect quick purchase to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
296 |
+
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
297 |
+
'type' => 'select',
|
298 |
+
'options' => array(
|
299 |
+
'cart' => __('Cart', 'woocommerce-direct-checkout'),
|
300 |
+
'checkout' => __('Checkout', 'woocommerce-direct-checkout'),
|
301 |
+
),
|
302 |
+
'value' => $this->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_to', 'checkout'),
|
303 |
+
),
|
304 |
+
'end_group',
|
305 |
+
);
|
306 |
+
}
|
307 |
+
|
308 |
+
function add_product_tabs($tabs) {
|
309 |
+
|
310 |
+
$tabs[QLWCDC_DOMAIN] = array(
|
311 |
+
'label' => __('Direct Checkout', 'qlwdd'),
|
312 |
+
'target' => 'qlwcdc_options',
|
313 |
+
);
|
314 |
+
|
315 |
+
return $tabs;
|
316 |
+
}
|
317 |
+
|
318 |
+
function add_setting_field($field) {
|
319 |
+
|
320 |
+
if (!isset($field['id'])) {
|
321 |
+
if ($field == 'start_group') {
|
322 |
+
echo '<div class="options_group">';
|
323 |
+
} elseif ($field == 'end_group') {
|
324 |
+
echo '</div>';
|
325 |
+
}
|
326 |
+
} else {
|
327 |
+
|
328 |
+
if (function_exists($function = 'woocommerce_wp_' . $field['type'])) {
|
329 |
+
$function($field);
|
330 |
+
} elseif (function_exists($function = 'woocommerce_wp_' . $field['type'] . '_input')) {
|
331 |
+
$function($field);
|
332 |
+
} else {
|
333 |
+
woocommerce_wp_text_input($field);
|
334 |
+
}
|
335 |
+
}
|
336 |
+
}
|
337 |
+
|
338 |
+
function add_product_tab_content() {
|
339 |
+
|
340 |
+
$this->add_product_fields();
|
341 |
+
?>
|
342 |
+
<div id="qlwcdc_options" class="panel woocommerce_options_panel" style="display: none;">
|
343 |
+
<?php
|
344 |
+
foreach ($this->product_fields as $field) {
|
345 |
+
$this->add_setting_field($field);
|
346 |
+
}
|
347 |
+
?>
|
348 |
+
</div>
|
349 |
+
<?php
|
350 |
+
}
|
351 |
+
|
352 |
+
/* function added_to_cart_button() {
|
353 |
+
|
354 |
+
global $product;
|
355 |
+
|
356 |
+
if ('no' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart_ajax_button', 'no')) {
|
357 |
+
?>
|
358 |
+
<style>
|
359 |
+
.added_to_cart.wc-forward {
|
360 |
+
display: none!important;
|
361 |
+
}
|
362 |
+
</style>
|
363 |
+
<?php
|
364 |
+
}
|
365 |
+
} */
|
366 |
+
|
367 |
+
/* function add_to_cart_redirect($url) {
|
368 |
+
|
369 |
+
//return 'https://1326';
|
370 |
+
|
371 |
+
if (is_product()) {
|
372 |
+
|
373 |
+
if ('redirect' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart')) {
|
374 |
+
|
375 |
+
if ('cart' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_page')) {
|
376 |
+
$url = wc_get_cart_url();
|
377 |
+
}
|
378 |
+
|
379 |
+
if ('checkout' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_page')) {
|
380 |
+
$url = wc_get_checkout_url();
|
381 |
+
}
|
382 |
+
|
383 |
+
if ('url' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_page')) {
|
384 |
+
$url = $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_url');
|
385 |
+
}
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
return $url;
|
390 |
+
} */
|
391 |
+
|
392 |
+
/* function added_to_cart_message_js() {
|
393 |
+
|
394 |
+
global $product;
|
395 |
+
|
396 |
+
if ('ajax' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart', 'no') && 'yes' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart_ajax_message', 'yes')) {
|
397 |
+
?>
|
398 |
+
<script>
|
399 |
+
(function ($) {
|
400 |
+
$(document).bind('added_to_cart', function (e, cart) {
|
401 |
+
$(document.body).trigger('added_to_cart_message', [e, cart]);
|
402 |
+
});
|
403 |
+
})(jQuery);
|
404 |
+
</script>
|
405 |
+
<?php
|
406 |
+
}
|
407 |
+
if ('redirect' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart', 'no')) {
|
408 |
+
?>
|
409 |
+
<script>
|
410 |
+
(function ($) {
|
411 |
+
$(document).bind('added_to_cart', function (e, cart) {
|
412 |
+
if (wc_add_to_cart_params.cart_url !== undefined) {
|
413 |
+
window.location = wc_add_to_cart_params.cart_url;
|
414 |
+
}
|
415 |
+
});
|
416 |
+
})(jQuery);
|
417 |
+
</script>
|
418 |
+
<?php
|
419 |
+
}
|
420 |
+
} */
|
421 |
+
|
422 |
+
function add_product_text($text, $product) {
|
423 |
+
|
424 |
+
if ('yes' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_text')) {
|
425 |
+
$text = esc_html__($this->get_product_option($product->get_id(), 'qlwcdc_add_product_text_content'), $text);
|
426 |
+
}
|
427 |
+
|
428 |
+
return $text;
|
429 |
+
}
|
430 |
+
|
431 |
+
/* function add_product_cart_ajax_message() {
|
432 |
+
|
433 |
+
global $wp_query;
|
434 |
+
|
435 |
+
if (!check_ajax_referer('woocommerce-direct-checkout', 'nonce', false)) {
|
436 |
+
wp_send_json_error(esc_html__('Please reload page.', 'woocommerce-direct-checkout'));
|
437 |
+
}
|
438 |
+
|
439 |
+
if (isset($_POST['queried_object_id'])) {
|
440 |
+
|
441 |
+
$product_id = absint($_POST['queried_object_id']);
|
442 |
+
|
443 |
+
$args = array(
|
444 |
+
'p' => $product_id,
|
445 |
+
'post_type' => 'any'
|
446 |
+
);
|
447 |
+
|
448 |
+
$wp_query = new WP_Query($args);
|
449 |
+
}
|
450 |
+
|
451 |
+
ob_start();
|
452 |
+
|
453 |
+
woocommerce_output_all_notices();
|
454 |
+
|
455 |
+
$data = ob_get_clean();
|
456 |
+
|
457 |
+
wp_send_json($data);
|
458 |
+
} */
|
459 |
+
|
460 |
+
/* function add_to_cart_class($class) {
|
461 |
+
|
462 |
+
if (is_product() && get_option('qlwcdc_add_product_ajax')) {
|
463 |
+
$class = str_replace(' add_to_cart_button', ' single_add_to_cart_button', $class);
|
464 |
+
$class = str_replace('add_to_cart_button ', 'single_add_to_cart_button ', $class);
|
465 |
+
$class = str_replace(' ajax_add_to_cart', '', $class);
|
466 |
+
$class = str_replace('ajax_add_to_cart ', ' ', $class);
|
467 |
+
}
|
468 |
+
|
469 |
+
return $class;
|
470 |
+
} */
|
471 |
+
|
472 |
+
/* function add_storefront_notices() {
|
473 |
+
if (is_product() && 'yes' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_ajax_message', 'no')) {
|
474 |
+
woocommerce_output_all_notices();
|
475 |
+
}
|
476 |
+
} */
|
477 |
+
|
478 |
+
function validate_add_cart_item($passed, $product_id, $qty, $post_data = null) {
|
479 |
+
|
480 |
+
if (class_exists('WC_Product_Addons_Helper')) {
|
481 |
+
|
482 |
+
if (isset($_GET['add-to-cart']) && absint($_GET['add-to-cart']) > 0) {
|
483 |
+
|
484 |
+
$product_addons = WC_Product_Addons_Helper::get_product_addons($product_id);
|
485 |
+
|
486 |
+
if (is_array($product_addons) && !empty($product_addons)) {
|
487 |
+
|
488 |
+
foreach ($product_addons as $addon) {
|
489 |
+
|
490 |
+
if (isset($_GET['addon-' . $addon['field_name']])) {
|
491 |
+
$_POST['addon-' . $addon['field_name']] = $_GET['addon-' . $addon['field_name']];
|
492 |
+
}
|
493 |
+
}
|
494 |
+
}
|
495 |
+
}
|
496 |
+
}
|
497 |
+
|
498 |
+
return $passed;
|
499 |
+
}
|
500 |
+
|
501 |
+
function init() {
|
502 |
+
//add_action('wp_ajax_qlwcdc_add_product_cart_ajax_message', array($this, 'add_product_cart_ajax_message'));
|
503 |
+
//add_action('wp_ajax_nopriv_qlwcdc_add_product_cart_ajax_message', array($this, 'add_product_cart_ajax_message'));
|
504 |
+
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
505 |
+
add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
|
506 |
+
//add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
|
507 |
+
//add_filter('woocommerce_before_single_product', array($this, 'added_to_cart_button'));
|
508 |
+
//add_filter('woocommerce_after_single_product', array($this, 'added_to_cart_message_js'));
|
509 |
+
add_filter('woocommerce_product_data_tabs', array($this, 'add_product_tabs'));
|
510 |
+
add_action('woocommerce_product_data_panels', array($this, 'add_product_tab_content'));
|
511 |
+
add_filter('woocommerce_product_single_add_to_cart_text', array($this, 'add_product_text'), 10, 2);
|
512 |
+
//add_filter('add_to_cart_class', array($this, 'add_to_cart_class'));
|
513 |
+
//add_action('storefront_content_top', array($this, 'add_storefront_notices'));
|
514 |
+
// WooCommerce Product Addon Compatibility
|
515 |
+
add_filter('woocommerce_add_to_cart_validation', array($this, 'validate_add_cart_item'), -10, 4);
|
516 |
+
}
|
517 |
+
|
518 |
+
public static function instance() {
|
519 |
+
if (!isset(self::$instance)) {
|
520 |
+
self::$instance = new self();
|
521 |
+
self::$instance->init();
|
522 |
+
}
|
523 |
+
return self::$instance;
|
524 |
+
}
|
525 |
+
|
526 |
+
}
|
527 |
+
|
528 |
+
QLWCDC_Products::instance();
|
529 |
Â
}
|
includes/purchase.php
CHANGED
@@ -1,120 +1,120 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
die('-1');
|
4 |
-
}
|
5 |
-
|
6 |
-
if (!class_exists('QLWCDC_Purchase')) {
|
7 |
-
|
8 |
-
class QLWCDC_Purchase {
|
9 |
-
|
10 |
-
protected static $instance;
|
11 |
-
|
12 |
-
function add_section($sections) {
|
13 |
-
|
14 |
-
$sections['premium'] = __('Premium', 'woocommerce-direct-checkout');
|
15 |
-
|
16 |
-
return $sections;
|
17 |
-
}
|
18 |
-
|
19 |
-
function add_page() {
|
20 |
-
|
21 |
-
global $current_section, $hide_save_button;
|
22 |
-
|
23 |
-
if ('premium' == $current_section) {
|
24 |
-
$hide_save_button = true;
|
25 |
-
?>
|
26 |
-
<div class="wrap about-wrap full-width-layout qlwrap">
|
27 |
-
<div class="has-2-columns is-wider-left" style="max-width: 100%">
|
28 |
-
<div class="column">
|
29 |
-
<div class="welcome-header">
|
30 |
-
<h1><?php esc_html_e('Premium', 'woocommerce-direct-checkout'); ?></h1>
|
31 |
-
<div class="about-description">
|
32 |
-
<?php esc_html_e('WooCommerce Direct Checkout allows you to simplifies the checkout process by skipping the shopping cart page. This plugin allows you to redirect your customers directly to the checkout page and includes the cart inside the checkout page.', 'woocommerce-direct-checkout'); ?>
|
33 |
-
</div>
|
34 |
-
<br/>
|
35 |
-
<a class="button button-primary" target="_blank" href="<?php echo esc_url(QLWCDC_PURCHASE_URL); ?>"><?php esc_html_e('Purchase Now', 'woocommerce-direct-checkout'); ?></a>
|
36 |
-
<a class="button button-secondary" target="_blank" href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>"><?php esc_html_e('Get Support', 'woocommerce-direct-checkout'); ?></a>
|
37 |
-
</div>
|
38 |
-
<hr/>
|
39 |
-
<div class="feature-section" style="padding: 10px 0;">
|
40 |
-
<h3><?php esc_html_e('One page checkout', 'woocommerce-direct-checkout'); ?></h3>
|
41 |
-
<p>
|
42 |
-
<?php esc_html_e('WooCommerce Direct Checkout allows you to include the cart form in the checkout page allowing your users to edit the cart and confirm the order on the same page.', 'woocommerce-direct-checkout'); ?>
|
43 |
-
</p>
|
44 |
-
</div>
|
45 |
-
<div class="feature-section" style="padding: 10px 0;">
|
46 |
-
<h3><?php esc_html_e('Remove checkout fields', 'woocommerce-direct-checkout'); ?></h3>
|
47 |
-
<p>
|
48 |
-
<?php esc_html_e('Our checkout settings allow you to easily remove the unnecessary fields and reduce the user spend completing those fields like the order comments, shipping address, coupon form, policy text, and terms and conditions.', 'woocommerce-direct-checkout'); ?>
|
49 |
-
</p>
|
50 |
-
</div>
|
51 |
-
<div class="feature-section" style="padding: 10px 0;">
|
52 |
-
<h3><?php esc_html_e('Remove checkout columns', 'woocommerce-direct-checkout'); ?></h3>
|
53 |
-
<p>
|
54 |
-
<?php esc_html_e('This option allows you to simplify the checkout page by removing the two columns in the checkout page.', 'woocommerce-direct-checkout'); ?>
|
55 |
-
</p>
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
<div class="column">
|
59 |
-
<img src="<?php echo plugins_url('/assets/img/checkout.png', QLWCDC_PLUGIN_FILE); ?>">
|
60 |
-
</div>
|
61 |
-
</div>
|
62 |
-
<hr/>
|
63 |
-
<div class="has-2-columns is-wider-left" style="max-width: 100%">
|
64 |
-
<div class="column">
|
65 |
-
<div class="feature-section" style="padding: 10px 0;">
|
66 |
-
<h3><?php esc_html_e('Checkout redirect', 'woocommerce-direct-checkout'); ?></h3>
|
67 |
-
<p>
|
68 |
-
<?php esc_html_e('This option allows you to redirect your users directly to the checkout page reducing the total checkout process in one step.', 'woocommerce-direct-checkout'); ?>
|
69 |
-
</p>
|
70 |
-
</div>
|
71 |
-
<div class="feature-section" style="padding: 10px 0;">
|
72 |
-
<h3><?php esc_html_e('Quick purchase on single products', 'woocommerce-direct-checkout'); ?></h3>
|
73 |
-
<p>
|
74 |
-
<?php esc_html_e('If you want to give the option to the user to make a direct purchase or the default add to cart product you can include a direct purchase button to the products page.', 'woocommerce-direct-checkout'); ?>
|
75 |
-
</p>
|
76 |
-
</div>
|
77 |
-
<div class="feature-section" style="padding: 10px 0;">
|
78 |
-
<h3><?php esc_html_e('Quick view in product archives', 'woocommerce-direct-checkout'); ?></h3>
|
79 |
-
<p>
|
80 |
-
<?php esc_html_e('This option allows you to include a button which displays a quick view in the WooCommerce shop page and products categories.', 'woocommerce-direct-checkout'); ?>
|
81 |
-
</p>
|
82 |
-
<p>
|
83 |
-
<?php esc_html_e('This is especially useful for the variable products because it allows users to select the products attributes and include directly into the cart.', 'woocommerce-direct-checkout'); ?>
|
84 |
-
</p>
|
85 |
-
</div>
|
86 |
-
<div class="feature-section" style="padding: 10px 0;">
|
87 |
-
<hr/>
|
88 |
-
<h3><?php esc_html_e('Quick purchase', 'woocommerce-direct-checkout'); ?></h3>
|
89 |
-
<p>
|
90 |
-
<?php esc_html_e('The Quick purchase button allows you to include a direct button in the single products, variable, grouped and virtual products wich redirects user to the checkout page.', 'woocommerce-direct-checkout'); ?>
|
91 |
-
</p>
|
92 |
-
</div>
|
93 |
-
</div>
|
94 |
-
<div class="column">
|
95 |
-
<br/>
|
96 |
-
<img src="<?php echo plugins_url('/assets/img/modal.png', QLWCDC_PLUGIN_FILE); ?>">
|
97 |
-
</div>
|
98 |
-
</div>
|
99 |
-
</div>
|
100 |
-
<?php
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
function init() {
|
105 |
-
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
106 |
-
add_action('woocommerce_sections_qlwcdc', array($this, 'add_page'));
|
107 |
-
}
|
108 |
-
|
109 |
-
public static function instance() {
|
110 |
-
if (!isset(self::$instance)) {
|
111 |
-
self::$instance = new self();
|
112 |
-
self::$instance->init();
|
113 |
-
}
|
114 |
-
return self::$instance;
|
115 |
-
}
|
116 |
-
|
117 |
-
}
|
118 |
-
|
119 |
-
QLWCDC_Purchase::instance();
|
120 |
Â
}
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
die('-1');
|
4 |
+
}
|
5 |
+
|
6 |
+
if (!class_exists('QLWCDC_Purchase')) {
|
7 |
+
|
8 |
+
class QLWCDC_Purchase {
|
9 |
+
|
10 |
+
protected static $instance;
|
11 |
+
|
12 |
+
function add_section($sections) {
|
13 |
+
|
14 |
+
$sections['premium'] = __('Premium', 'woocommerce-direct-checkout');
|
15 |
+
|
16 |
+
return $sections;
|
17 |
+
}
|
18 |
+
|
19 |
+
function add_page() {
|
20 |
+
|
21 |
+
global $current_section, $hide_save_button;
|
22 |
+
|
23 |
+
if ('premium' == $current_section) {
|
24 |
+
$hide_save_button = true;
|
25 |
+
?>
|
26 |
+
<div class="wrap about-wrap full-width-layout qlwrap">
|
27 |
+
<div class="has-2-columns is-wider-left" style="max-width: 100%">
|
28 |
+
<div class="column">
|
29 |
+
<div class="welcome-header">
|
30 |
+
<h1><?php esc_html_e('Premium', 'woocommerce-direct-checkout'); ?></h1>
|
31 |
+
<div class="about-description">
|
32 |
+
<?php esc_html_e('WooCommerce Direct Checkout allows you to simplifies the checkout process by skipping the shopping cart page. This plugin allows you to redirect your customers directly to the checkout page and includes the cart inside the checkout page.', 'woocommerce-direct-checkout'); ?>
|
33 |
+
</div>
|
34 |
+
<br/>
|
35 |
+
<a class="button button-primary" target="_blank" href="<?php echo esc_url(QLWCDC_PURCHASE_URL); ?>"><?php esc_html_e('Purchase Now', 'woocommerce-direct-checkout'); ?></a>
|
36 |
+
<a class="button button-secondary" target="_blank" href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>"><?php esc_html_e('Get Support', 'woocommerce-direct-checkout'); ?></a>
|
37 |
+
</div>
|
38 |
+
<hr/>
|
39 |
+
<div class="feature-section" style="padding: 10px 0;">
|
40 |
+
<h3><?php esc_html_e('One page checkout', 'woocommerce-direct-checkout'); ?></h3>
|
41 |
+
<p>
|
42 |
+
<?php esc_html_e('WooCommerce Direct Checkout allows you to include the cart form in the checkout page allowing your users to edit the cart and confirm the order on the same page.', 'woocommerce-direct-checkout'); ?>
|
43 |
+
</p>
|
44 |
+
</div>
|
45 |
+
<div class="feature-section" style="padding: 10px 0;">
|
46 |
+
<h3><?php esc_html_e('Remove checkout fields', 'woocommerce-direct-checkout'); ?></h3>
|
47 |
+
<p>
|
48 |
+
<?php esc_html_e('Our checkout settings allow you to easily remove the unnecessary fields and reduce the user spend completing those fields like the order comments, shipping address, coupon form, policy text, and terms and conditions.', 'woocommerce-direct-checkout'); ?>
|
49 |
+
</p>
|
50 |
+
</div>
|
51 |
+
<div class="feature-section" style="padding: 10px 0;">
|
52 |
+
<h3><?php esc_html_e('Remove checkout columns', 'woocommerce-direct-checkout'); ?></h3>
|
53 |
+
<p>
|
54 |
+
<?php esc_html_e('This option allows you to simplify the checkout page by removing the two columns in the checkout page.', 'woocommerce-direct-checkout'); ?>
|
55 |
+
</p>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
<div class="column">
|
59 |
+
<img src="<?php echo plugins_url('/assets/img/checkout.png', QLWCDC_PLUGIN_FILE); ?>">
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<hr/>
|
63 |
+
<div class="has-2-columns is-wider-left" style="max-width: 100%">
|
64 |
+
<div class="column">
|
65 |
+
<div class="feature-section" style="padding: 10px 0;">
|
66 |
+
<h3><?php esc_html_e('Checkout redirect', 'woocommerce-direct-checkout'); ?></h3>
|
67 |
+
<p>
|
68 |
+
<?php esc_html_e('This option allows you to redirect your users directly to the checkout page reducing the total checkout process in one step.', 'woocommerce-direct-checkout'); ?>
|
69 |
+
</p>
|
70 |
+
</div>
|
71 |
+
<div class="feature-section" style="padding: 10px 0;">
|
72 |
+
<h3><?php esc_html_e('Quick purchase on single products', 'woocommerce-direct-checkout'); ?></h3>
|
73 |
+
<p>
|
74 |
+
<?php esc_html_e('If you want to give the option to the user to make a direct purchase or the default add to cart product you can include a direct purchase button to the products page.', 'woocommerce-direct-checkout'); ?>
|
75 |
+
</p>
|
76 |
+
</div>
|
77 |
+
<div class="feature-section" style="padding: 10px 0;">
|
78 |
+
<h3><?php esc_html_e('Quick view in product archives', 'woocommerce-direct-checkout'); ?></h3>
|
79 |
+
<p>
|
80 |
+
<?php esc_html_e('This option allows you to include a button which displays a quick view in the WooCommerce shop page and products categories.', 'woocommerce-direct-checkout'); ?>
|
81 |
+
</p>
|
82 |
+
<p>
|
83 |
+
<?php esc_html_e('This is especially useful for the variable products because it allows users to select the products attributes and include directly into the cart.', 'woocommerce-direct-checkout'); ?>
|
84 |
+
</p>
|
85 |
+
</div>
|
86 |
+
<div class="feature-section" style="padding: 10px 0;">
|
87 |
+
<hr/>
|
88 |
+
<h3><?php esc_html_e('Quick purchase', 'woocommerce-direct-checkout'); ?></h3>
|
89 |
+
<p>
|
90 |
+
<?php esc_html_e('The Quick purchase button allows you to include a direct button in the single products, variable, grouped and virtual products wich redirects user to the checkout page.', 'woocommerce-direct-checkout'); ?>
|
91 |
+
</p>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
<div class="column">
|
95 |
+
<br/>
|
96 |
+
<img src="<?php echo plugins_url('/assets/img/modal.png', QLWCDC_PLUGIN_FILE); ?>">
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
</div>
|
100 |
+
<?php
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
function init() {
|
105 |
+
add_filter('qlwcdc_add_sections', array($this, 'add_section'));
|
106 |
+
add_action('woocommerce_sections_qlwcdc', array($this, 'add_page'));
|
107 |
+
}
|
108 |
+
|
109 |
+
public static function instance() {
|
110 |
+
if (!isset(self::$instance)) {
|
111 |
+
self::$instance = new self();
|
112 |
+
self::$instance->init();
|
113 |
+
}
|
114 |
+
return self::$instance;
|
115 |
+
}
|
116 |
+
|
117 |
+
}
|
118 |
+
|
119 |
+
QLWCDC_Purchase::instance();
|
120 |
Â
}
|
languages/woocommerce-direct-checkout-es_ES.po
CHANGED
@@ -1,545 +1,545 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: WooCommerce Direct Checkout\n"
|
4 |
-
"POT-Creation-Date: 2019-04-11 19:16-0300\n"
|
5 |
-
"PO-Revision-Date: 2019-04-11 19:18-0300\n"
|
6 |
-
"Last-Translator: \n"
|
7 |
-
"Language-Team: \n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"X-Generator: Poedit 1.8.1\n"
|
12 |
-
"X-Poedit-Basepath: ..\n"
|
13 |
-
"X-Poedit-WPHeader: woocommerce-direct-checkout.php\n"
|
14 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
-
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
16 |
-
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
17 |
-
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
18 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
-
"Language: es_ES\n"
|
20 |
-
"X-Poedit-SearchPath-0: .\n"
|
21 |
-
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
-
|
23 |
-
#: includes/archives.php:23 includes/archives.php:36
|
24 |
-
msgid "Archives"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: includes/archives.php:97 includes/products.php:89 includes/products.php:239
|
28 |
-
msgid "Replace Add to cart text"
|
29 |
-
msgstr ""
|
30 |
-
|
31 |
-
#: includes/archives.php:98 includes/products.php:90 includes/products.php:241
|
32 |
-
msgid "Replace \"Add to cart\" text."
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: includes/archives.php:103 includes/archives.php:137
|
36 |
-
#: includes/checkout.php:47 includes/checkout.php:124
|
37 |
-
#: includes/checkout.php:136 includes/checkout.php:148
|
38 |
-
#: includes/checkout.php:160 includes/checkout.php:172
|
39 |
-
#: includes/checkout.php:184 includes/checkout.php:196 includes/general.php:48
|
40 |
-
#: includes/general.php:60 includes/general.php:74 includes/products.php:95
|
41 |
-
#: includes/products.php:114 includes/products.php:152
|
42 |
-
#: includes/products.php:245 includes/products.php:269
|
43 |
-
msgid "Yes"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#: includes/archives.php:104 includes/archives.php:138
|
47 |
-
#: includes/checkout.php:48 includes/checkout.php:125
|
48 |
-
#: includes/checkout.php:137 includes/checkout.php:149
|
49 |
-
#: includes/checkout.php:161 includes/checkout.php:173
|
50 |
-
#: includes/checkout.php:185 includes/checkout.php:197 includes/general.php:49
|
51 |
-
#: includes/general.php:61 includes/general.php:72 includes/products.php:96
|
52 |
-
#: includes/products.php:115 includes/products.php:153
|
53 |
-
#: includes/products.php:246 includes/products.php:270
|
54 |
-
msgid "No"
|
55 |
-
msgstr ""
|
56 |
-
|
57 |
-
#: includes/archives.php:109
|
58 |
-
msgid "Replace Add to cart text in"
|
59 |
-
msgstr ""
|
60 |
-
|
61 |
-
#: includes/archives.php:110
|
62 |
-
msgid "Replace \"Add to cart\" text in product types."
|
63 |
-
msgstr ""
|
64 |
-
|
65 |
-
#: includes/archives.php:115
|
66 |
-
msgid "Simple Products"
|
67 |
-
msgstr ""
|
68 |
-
|
69 |
-
#: includes/archives.php:116
|
70 |
-
msgid "Grouped Products"
|
71 |
-
msgstr ""
|
72 |
-
|
73 |
-
#: includes/archives.php:117
|
74 |
-
msgid "Virtual Products"
|
75 |
-
msgstr ""
|
76 |
-
|
77 |
-
#: includes/archives.php:118
|
78 |
-
msgid "Variable Products"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: includes/archives.php:119
|
82 |
-
msgid "Downloadable Products"
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: includes/archives.php:124 includes/products.php:101
|
86 |
-
#: includes/products.php:251
|
87 |
-
msgid "Replace Add to cart text content"
|
88 |
-
msgstr ""
|
89 |
-
|
90 |
-
#: includes/archives.php:125 includes/products.php:102
|
91 |
-
#: includes/products.php:253
|
92 |
-
msgid "Replace \"Add to cart\" text with this text."
|
93 |
-
msgstr ""
|
94 |
-
|
95 |
-
#: includes/archives.php:128 includes/products.php:105
|
96 |
-
msgid "Purchase"
|
97 |
-
msgstr ""
|
98 |
-
|
99 |
-
#: includes/archives.php:131
|
100 |
-
msgid "Add quick view button"
|
101 |
-
msgstr ""
|
102 |
-
|
103 |
-
#: includes/archives.php:132
|
104 |
-
msgid "Add product quick view modal button."
|
105 |
-
msgstr ""
|
106 |
-
|
107 |
-
#: includes/checkout.php:23 includes/checkout.php:36 includes/general.php:109
|
108 |
-
#: includes/general.php:135 includes/general.php:147 includes/products.php:134
|
109 |
-
#: includes/products.php:300
|
110 |
-
msgid "Checkout"
|
111 |
-
msgstr ""
|
112 |
-
|
113 |
-
#: includes/checkout.php:41
|
114 |
-
msgid "Add cart to checkout"
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
#: includes/checkout.php:42
|
118 |
-
msgid ""
|
119 |
-
"Simplifies the checkout process including the shopping cart page inside "
|
120 |
-
"checkout."
|
121 |
-
msgstr ""
|
122 |
-
|
123 |
-
#: includes/checkout.php:53
|
124 |
-
msgid "Add cart to checkout fields"
|
125 |
-
msgstr ""
|
126 |
-
|
127 |
-
#: includes/checkout.php:54
|
128 |
-
msgid "Include this fields inside the checkout cart."
|
129 |
-
msgstr ""
|
130 |
-
|
131 |
-
#: includes/checkout.php:59
|
132 |
-
msgid "Remove"
|
133 |
-
msgstr ""
|
134 |
-
|
135 |
-
#: includes/checkout.php:60
|
136 |
-
msgid "Thumbnail"
|
137 |
-
msgstr ""
|
138 |
-
|
139 |
-
#: includes/checkout.php:61
|
140 |
-
msgid "Name"
|
141 |
-
msgstr ""
|
142 |
-
|
143 |
-
#: includes/checkout.php:62
|
144 |
-
msgid "Price"
|
145 |
-
msgstr ""
|
146 |
-
|
147 |
-
#: includes/checkout.php:63
|
148 |
-
msgid "Quantity"
|
149 |
-
msgstr ""
|
150 |
-
|
151 |
-
#: includes/checkout.php:73
|
152 |
-
msgid "Remove checkout coupon form"
|
153 |
-
msgstr ""
|
154 |
-
|
155 |
-
#: includes/checkout.php:74
|
156 |
-
msgid "Simplifies the checkout process removing the coupon form."
|
157 |
-
msgstr ""
|
158 |
-
|
159 |
-
#: includes/checkout.php:79
|
160 |
-
msgid "Leave coupon form"
|
161 |
-
msgstr ""
|
162 |
-
|
163 |
-
#: includes/checkout.php:80
|
164 |
-
msgid "Remove coupon form"
|
165 |
-
msgstr ""
|
166 |
-
|
167 |
-
#: includes/checkout.php:81
|
168 |
-
msgid "Remove coupon toggle"
|
169 |
-
msgstr ""
|
170 |
-
|
171 |
-
#: includes/checkout.php:82
|
172 |
-
msgid "Move to checkout order"
|
173 |
-
msgstr ""
|
174 |
-
|
175 |
-
#: includes/checkout.php:87
|
176 |
-
msgid "Add custom class to cart table"
|
177 |
-
msgstr ""
|
178 |
-
|
179 |
-
#: includes/checkout.php:88
|
180 |
-
msgid "Add a custom class to the cart table form in the checkot."
|
181 |
-
msgstr ""
|
182 |
-
|
183 |
-
#: includes/checkout.php:94 includes/purchase.php:46
|
184 |
-
msgid "Remove checkout fields"
|
185 |
-
msgstr ""
|
186 |
-
|
187 |
-
#: includes/checkout.php:95
|
188 |
-
msgid ""
|
189 |
-
"Simplifies the checkout process removing the unnecessary checkout fields."
|
190 |
-
msgstr ""
|
191 |
-
|
192 |
-
#: includes/checkout.php:100
|
193 |
-
msgid "First Name"
|
194 |
-
msgstr ""
|
195 |
-
|
196 |
-
#: includes/checkout.php:101
|
197 |
-
msgid "Last Name"
|
198 |
-
msgstr ""
|
199 |
-
|
200 |
-
#: includes/checkout.php:102
|
201 |
-
msgid "Country"
|
202 |
-
msgstr ""
|
203 |
-
|
204 |
-
#: includes/checkout.php:103
|
205 |
-
msgid "State"
|
206 |
-
msgstr ""
|
207 |
-
|
208 |
-
#: includes/checkout.php:104
|
209 |
-
msgid "City"
|
210 |
-
msgstr ""
|
211 |
-
|
212 |
-
#: includes/checkout.php:105
|
213 |
-
msgid "Postcode"
|
214 |
-
msgstr ""
|
215 |
-
|
216 |
-
#: includes/checkout.php:106
|
217 |
-
msgid "Address 1"
|
218 |
-
msgstr ""
|
219 |
-
|
220 |
-
#: includes/checkout.php:107
|
221 |
-
msgid "Address 2"
|
222 |
-
msgstr ""
|
223 |
-
|
224 |
-
#: includes/checkout.php:108
|
225 |
-
msgid "Company"
|
226 |
-
msgstr ""
|
227 |
-
|
228 |
-
#: includes/checkout.php:109
|
229 |
-
msgid "Phone"
|
230 |
-
msgstr ""
|
231 |
-
|
232 |
-
#: includes/checkout.php:118
|
233 |
-
msgid "Remove checkout shipping address"
|
234 |
-
msgstr ""
|
235 |
-
|
236 |
-
#: includes/checkout.php:119
|
237 |
-
msgid "Simplifies the checkout process removing the shipping address."
|
238 |
-
msgstr ""
|
239 |
-
|
240 |
-
#: includes/checkout.php:130
|
241 |
-
msgid "Remove checkout order comments"
|
242 |
-
msgstr ""
|
243 |
-
|
244 |
-
#: includes/checkout.php:131
|
245 |
-
msgid "Simplifies the checkout process removing the order notes."
|
246 |
-
msgstr ""
|
247 |
-
|
248 |
-
#: includes/checkout.php:142
|
249 |
-
msgid "Remove checkout policy text"
|
250 |
-
msgstr ""
|
251 |
-
|
252 |
-
#: includes/checkout.php:143
|
253 |
-
msgid "Simplifies the checkout process removing the policy text."
|
254 |
-
msgstr ""
|
255 |
-
|
256 |
-
#: includes/checkout.php:154
|
257 |
-
msgid "Remove checkout terms and conditions"
|
258 |
-
msgstr ""
|
259 |
-
|
260 |
-
#: includes/checkout.php:155
|
261 |
-
msgid "Simplifies the checkout process removing the terms and conditions."
|
262 |
-
msgstr ""
|
263 |
-
|
264 |
-
#: includes/checkout.php:166
|
265 |
-
msgid "Remove checkout gateway icons"
|
266 |
-
msgstr ""
|
267 |
-
|
268 |
-
#: includes/checkout.php:167
|
269 |
-
msgid "Simplifies the checkout view by removing the payment gateway icons."
|
270 |
-
msgstr ""
|
271 |
-
|
272 |
-
#: includes/checkout.php:178 includes/purchase.php:52
|
273 |
-
msgid "Remove checkout columns"
|
274 |
-
msgstr ""
|
275 |
-
|
276 |
-
#: includes/checkout.php:179
|
277 |
-
msgid ""
|
278 |
-
"Try to remove the columns and display the checkout form and order review in "
|
279 |
-
"one column."
|
280 |
-
msgstr ""
|
281 |
-
|
282 |
-
#: includes/checkout.php:190
|
283 |
-
msgid "Remove order details address"
|
284 |
-
msgstr ""
|
285 |
-
|
286 |
-
#: includes/checkout.php:191
|
287 |
-
msgid "Remove the billing address of the customer in the order received page."
|
288 |
-
msgstr ""
|
289 |
-
|
290 |
-
#: includes/general.php:23 includes/general.php:36
|
291 |
-
msgid "General"
|
292 |
-
msgstr ""
|
293 |
-
|
294 |
-
#: includes/general.php:38
|
295 |
-
msgid "Simplifies the checkout process."
|
296 |
-
msgstr ""
|
297 |
-
|
298 |
-
#: includes/general.php:42
|
299 |
-
msgid "Added to cart alert"
|
300 |
-
msgstr ""
|
301 |
-
|
302 |
-
#: includes/general.php:43
|
303 |
-
msgid "Replace \"View Cart\" alert with direct checkout."
|
304 |
-
msgstr ""
|
305 |
-
|
306 |
-
#: includes/general.php:54
|
307 |
-
msgid "Added to cart link"
|
308 |
-
msgstr "Añadido a la carro enlace"
|
309 |
-
|
310 |
-
#: includes/general.php:55
|
311 |
-
msgid "Replace \"View Cart\" link with direct checkout."
|
312 |
-
msgstr ""
|
313 |
-
|
314 |
-
#: includes/general.php:66
|
315 |
-
msgid "Added to cart redirect"
|
316 |
-
msgstr ""
|
317 |
-
|
318 |
-
#: includes/general.php:67
|
319 |
-
msgid "Add to cart button behaviour."
|
320 |
-
msgstr ""
|
321 |
-
|
322 |
-
#: includes/general.php:102
|
323 |
-
msgid "Added to cart redirect to"
|
324 |
-
msgstr ""
|
325 |
-
|
326 |
-
#: includes/general.php:103 includes/general.php:116
|
327 |
-
msgid "Redirect to the cart or checkout page after successful addition."
|
328 |
-
msgstr ""
|
329 |
-
|
330 |
-
#: includes/general.php:108 includes/products.php:133
|
331 |
-
#: includes/products.php:299
|
332 |
-
msgid "Cart"
|
333 |
-
msgstr ""
|
334 |
-
|
335 |
-
#: includes/general.php:110
|
336 |
-
msgid "Custom URL"
|
337 |
-
msgstr ""
|
338 |
-
|
339 |
-
#: includes/general.php:115
|
340 |
-
msgid "Added to cart redirect to custom url"
|
341 |
-
msgstr ""
|
342 |
-
|
343 |
-
#: includes/general.php:147
|
344 |
-
msgid "View cart"
|
345 |
-
msgstr ""
|
346 |
-
|
347 |
-
#: includes/products.php:15 includes/products.php:28
|
348 |
-
msgid "Products"
|
349 |
-
msgstr ""
|
350 |
-
|
351 |
-
#: includes/products.php:108 includes/products.php:262
|
352 |
-
msgid "Add quick purchase button"
|
353 |
-
msgstr ""
|
354 |
-
|
355 |
-
#: includes/products.php:109
|
356 |
-
msgid "Add a quick purchase button to the products pages."
|
357 |
-
msgstr ""
|
358 |
-
|
359 |
-
#: includes/products.php:120 includes/products.php:275
|
360 |
-
msgid "Add quick purchase class"
|
361 |
-
msgstr ""
|
362 |
-
|
363 |
-
#: includes/products.php:121
|
364 |
-
msgid "Add a custom class to the quick purchase button."
|
365 |
-
msgstr ""
|
366 |
-
|
367 |
-
#: includes/products.php:127 includes/products.php:293
|
368 |
-
msgid "Redirect quick purchase to"
|
369 |
-
msgstr ""
|
370 |
-
|
371 |
-
#: includes/products.php:128
|
372 |
-
msgid "Redirect the quick purchase button to the cart or checkout page."
|
373 |
-
msgstr ""
|
374 |
-
|
375 |
-
#: includes/products.php:139 includes/products.php:284
|
376 |
-
msgid "Add quick purchase text"
|
377 |
-
msgstr ""
|
378 |
-
|
379 |
-
#: includes/products.php:140
|
380 |
-
msgid "Add a custom text to the quick purchase button."
|
381 |
-
msgstr ""
|
382 |
-
|
383 |
-
#: includes/products.php:143 includes/purchase.php:35
|
384 |
-
msgid "Purchase Now"
|
385 |
-
msgstr ""
|
386 |
-
|
387 |
-
#: includes/products.php:146
|
388 |
-
msgid "Add default attributes in variable products"
|
389 |
-
msgstr ""
|
390 |
-
|
391 |
-
#: includes/products.php:147
|
392 |
-
msgid ""
|
393 |
-
"Add default attributes in all variable products to avoid disabled Add to "
|
394 |
-
"cart button."
|
395 |
-
msgstr ""
|
396 |
-
|
397 |
-
#: includes/products.php:264
|
398 |
-
msgid "Add quick purchase button to single product page."
|
399 |
-
msgstr ""
|
400 |
-
|
401 |
-
#: includes/products.php:277
|
402 |
-
msgid "Add quick purchase custom class."
|
403 |
-
msgstr ""
|
404 |
-
|
405 |
-
#: includes/products.php:286
|
406 |
-
msgid "Add quick purchase custom text."
|
407 |
-
msgstr ""
|
408 |
-
|
409 |
-
#: includes/products.php:295
|
410 |
-
msgid "Redirect quick purchase to the cart or checkout page."
|
411 |
-
msgstr ""
|
412 |
-
|
413 |
-
#: includes/products.php:311 woocommerce-direct-checkout.php:198
|
414 |
-
#: woocommerce-direct-checkout.php:394
|
415 |
-
msgid "Direct Checkout"
|
416 |
-
msgstr ""
|
417 |
-
|
418 |
-
#: includes/purchase.php:14 includes/purchase.php:30
|
419 |
-
#: woocommerce-direct-checkout.php:174
|
420 |
-
msgid "Premium"
|
421 |
-
msgstr ""
|
422 |
-
|
423 |
-
#: includes/purchase.php:32
|
424 |
-
msgid ""
|
425 |
-
"WooCommerce Direct Checkout allows you to simplifies the checkout process by "
|
426 |
-
"skipping the shopping cart page. This plugin allows you to redirect your "
|
427 |
-
"customers directly to the checkout page and includes the cart inside the "
|
428 |
-
"checkout page."
|
429 |
-
msgstr ""
|
430 |
-
|
431 |
-
#: includes/purchase.php:36
|
432 |
-
msgid "Get Support"
|
433 |
-
msgstr ""
|
434 |
-
|
435 |
-
#: includes/purchase.php:40
|
436 |
-
msgid "One page checkout"
|
437 |
-
msgstr ""
|
438 |
-
|
439 |
-
#: includes/purchase.php:42
|
440 |
-
msgid ""
|
441 |
-
"WooCommerce Direct Checkout allows you to include the cart form in the "
|
442 |
-
"checkout page allowing your users to edit the cart and confirm the order on "
|
443 |
-
"the same page."
|
444 |
-
msgstr ""
|
445 |
-
|
446 |
-
#: includes/purchase.php:48
|
447 |
-
msgid ""
|
448 |
-
"Our checkout settings allow you to easily remove the unnecessary fields and "
|
449 |
-
"reduce the user spend completing those fields like the order comments, "
|
450 |
-
"shipping address, coupon form, policy text, and terms and conditions."
|
451 |
-
msgstr ""
|
452 |
-
|
453 |
-
#: includes/purchase.php:54
|
454 |
-
msgid ""
|
455 |
-
"This option allows you to simplify the checkout page by removing the two "
|
456 |
-
"columns in the checkout page."
|
457 |
-
msgstr ""
|
458 |
-
|
459 |
-
#: includes/purchase.php:66
|
460 |
-
msgid "Quick purchase"
|
461 |
-
msgstr ""
|
462 |
-
|
463 |
-
#: includes/purchase.php:68
|
464 |
-
msgid ""
|
465 |
-
"The Ajax add to cart option allows you to include single products, variable, "
|
466 |
-
"grouped and virtual products in the cart without the need to reload the "
|
467 |
-
"entire site each time."
|
468 |
-
msgstr ""
|
469 |
-
|
470 |
-
#: includes/purchase.php:76
|
471 |
-
msgid "Checkout redirect"
|
472 |
-
msgstr ""
|
473 |
-
|
474 |
-
#: includes/purchase.php:78
|
475 |
-
msgid ""
|
476 |
-
"This option allows you to redirect your users directly to the checkout page "
|
477 |
-
"reducing the total checkout process in one step."
|
478 |
-
msgstr ""
|
479 |
-
|
480 |
-
#: includes/purchase.php:82
|
481 |
-
msgid "Quick purchase on single products"
|
482 |
-
msgstr ""
|
483 |
-
|
484 |
-
#: includes/purchase.php:84
|
485 |
-
msgid ""
|
486 |
-
"If you want to give the option to the user to make a direct purchase or the "
|
487 |
-
"default add to cart product you can include a direct purchase button to the "
|
488 |
-
"products page."
|
489 |
-
msgstr ""
|
490 |
-
|
491 |
-
#: includes/purchase.php:88
|
492 |
-
msgid "Quick view in product archives"
|
493 |
-
msgstr ""
|
494 |
-
|
495 |
-
#: includes/purchase.php:90
|
496 |
-
msgid ""
|
497 |
-
"This option allows you to include a button which displays a quick view in "
|
498 |
-
"the WooCommerce shop page and products categories."
|
499 |
-
msgstr ""
|
500 |
-
|
501 |
-
#: includes/purchase.php:93
|
502 |
-
msgid ""
|
503 |
-
"This is especially useful for the variable products because it allows users "
|
504 |
-
"to select the products attributes and include directly into the cart."
|
505 |
-
msgstr ""
|
506 |
-
|
507 |
-
#: woocommerce-direct-checkout.php:123
|
508 |
-
#, php-format
|
509 |
-
msgid "Hello! This is the first update of the %s plugin by QuadLayers!"
|
510 |
-
msgstr ""
|
511 |
-
|
512 |
-
#: woocommerce-direct-checkout.php:125
|
513 |
-
msgid ""
|
514 |
-
"We've worked very much and very hard to release this great product. Your "
|
515 |
-
"feedback will boost our motivation and help us promote and continue to "
|
516 |
-
"improve this product."
|
517 |
-
msgstr ""
|
518 |
-
|
519 |
-
#: woocommerce-direct-checkout.php:128
|
520 |
-
msgid "Go Premium!"
|
521 |
-
msgstr ""
|
522 |
-
|
523 |
-
#: woocommerce-direct-checkout.php:131
|
524 |
-
msgid "Report a bug"
|
525 |
-
msgstr ""
|
526 |
-
|
527 |
-
#: woocommerce-direct-checkout.php:175
|
528 |
-
msgid "Settings"
|
529 |
-
msgstr ""
|
530 |
-
|
531 |
-
#. Plugin Name of the plugin/theme
|
532 |
-
msgid "WooCommerce Direct Checkout"
|
533 |
-
msgstr ""
|
534 |
-
|
535 |
-
#. Description of the plugin/theme
|
536 |
-
msgid "Simplifies the checkout process to improve your sales rate."
|
537 |
-
msgstr ""
|
538 |
-
|
539 |
-
#. Author of the plugin/theme
|
540 |
-
msgid "QuadLayers"
|
541 |
-
msgstr ""
|
542 |
-
|
543 |
-
#. Author URI of the plugin/theme
|
544 |
-
msgid "https://www.quadlayers.com"
|
545 |
-
msgstr ""
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WooCommerce Direct Checkout\n"
|
4 |
+
"POT-Creation-Date: 2019-04-11 19:16-0300\n"
|
5 |
+
"PO-Revision-Date: 2019-04-11 19:18-0300\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Generator: Poedit 1.8.1\n"
|
12 |
+
"X-Poedit-Basepath: ..\n"
|
13 |
+
"X-Poedit-WPHeader: woocommerce-direct-checkout.php\n"
|
14 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
15 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
16 |
+
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
17 |
+
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
18 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
+
"Language: es_ES\n"
|
20 |
+
"X-Poedit-SearchPath-0: .\n"
|
21 |
+
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
+
|
23 |
+
#: includes/archives.php:23 includes/archives.php:36
|
24 |
+
msgid "Archives"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: includes/archives.php:97 includes/products.php:89 includes/products.php:239
|
28 |
+
msgid "Replace Add to cart text"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: includes/archives.php:98 includes/products.php:90 includes/products.php:241
|
32 |
+
msgid "Replace \"Add to cart\" text."
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: includes/archives.php:103 includes/archives.php:137
|
36 |
+
#: includes/checkout.php:47 includes/checkout.php:124
|
37 |
+
#: includes/checkout.php:136 includes/checkout.php:148
|
38 |
+
#: includes/checkout.php:160 includes/checkout.php:172
|
39 |
+
#: includes/checkout.php:184 includes/checkout.php:196 includes/general.php:48
|
40 |
+
#: includes/general.php:60 includes/general.php:74 includes/products.php:95
|
41 |
+
#: includes/products.php:114 includes/products.php:152
|
42 |
+
#: includes/products.php:245 includes/products.php:269
|
43 |
+
msgid "Yes"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: includes/archives.php:104 includes/archives.php:138
|
47 |
+
#: includes/checkout.php:48 includes/checkout.php:125
|
48 |
+
#: includes/checkout.php:137 includes/checkout.php:149
|
49 |
+
#: includes/checkout.php:161 includes/checkout.php:173
|
50 |
+
#: includes/checkout.php:185 includes/checkout.php:197 includes/general.php:49
|
51 |
+
#: includes/general.php:61 includes/general.php:72 includes/products.php:96
|
52 |
+
#: includes/products.php:115 includes/products.php:153
|
53 |
+
#: includes/products.php:246 includes/products.php:270
|
54 |
+
msgid "No"
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
#: includes/archives.php:109
|
58 |
+
msgid "Replace Add to cart text in"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: includes/archives.php:110
|
62 |
+
msgid "Replace \"Add to cart\" text in product types."
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: includes/archives.php:115
|
66 |
+
msgid "Simple Products"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: includes/archives.php:116
|
70 |
+
msgid "Grouped Products"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: includes/archives.php:117
|
74 |
+
msgid "Virtual Products"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: includes/archives.php:118
|
78 |
+
msgid "Variable Products"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: includes/archives.php:119
|
82 |
+
msgid "Downloadable Products"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: includes/archives.php:124 includes/products.php:101
|
86 |
+
#: includes/products.php:251
|
87 |
+
msgid "Replace Add to cart text content"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: includes/archives.php:125 includes/products.php:102
|
91 |
+
#: includes/products.php:253
|
92 |
+
msgid "Replace \"Add to cart\" text with this text."
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: includes/archives.php:128 includes/products.php:105
|
96 |
+
msgid "Purchase"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: includes/archives.php:131
|
100 |
+
msgid "Add quick view button"
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: includes/archives.php:132
|
104 |
+
msgid "Add product quick view modal button."
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: includes/checkout.php:23 includes/checkout.php:36 includes/general.php:109
|
108 |
+
#: includes/general.php:135 includes/general.php:147 includes/products.php:134
|
109 |
+
#: includes/products.php:300
|
110 |
+
msgid "Checkout"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: includes/checkout.php:41
|
114 |
+
msgid "Add cart to checkout"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: includes/checkout.php:42
|
118 |
+
msgid ""
|
119 |
+
"Simplifies the checkout process including the shopping cart page inside "
|
120 |
+
"checkout."
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: includes/checkout.php:53
|
124 |
+
msgid "Add cart to checkout fields"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: includes/checkout.php:54
|
128 |
+
msgid "Include this fields inside the checkout cart."
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: includes/checkout.php:59
|
132 |
+
msgid "Remove"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: includes/checkout.php:60
|
136 |
+
msgid "Thumbnail"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: includes/checkout.php:61
|
140 |
+
msgid "Name"
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
#: includes/checkout.php:62
|
144 |
+
msgid "Price"
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
#: includes/checkout.php:63
|
148 |
+
msgid "Quantity"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
#: includes/checkout.php:73
|
152 |
+
msgid "Remove checkout coupon form"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: includes/checkout.php:74
|
156 |
+
msgid "Simplifies the checkout process removing the coupon form."
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#: includes/checkout.php:79
|
160 |
+
msgid "Leave coupon form"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: includes/checkout.php:80
|
164 |
+
msgid "Remove coupon form"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: includes/checkout.php:81
|
168 |
+
msgid "Remove coupon toggle"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#: includes/checkout.php:82
|
172 |
+
msgid "Move to checkout order"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: includes/checkout.php:87
|
176 |
+
msgid "Add custom class to cart table"
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: includes/checkout.php:88
|
180 |
+
msgid "Add a custom class to the cart table form in the checkot."
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
#: includes/checkout.php:94 includes/purchase.php:46
|
184 |
+
msgid "Remove checkout fields"
|
185 |
+
msgstr ""
|
186 |
+
|
187 |
+
#: includes/checkout.php:95
|
188 |
+
msgid ""
|
189 |
+
"Simplifies the checkout process removing the unnecessary checkout fields."
|
190 |
+
msgstr ""
|
191 |
+
|
192 |
+
#: includes/checkout.php:100
|
193 |
+
msgid "First Name"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: includes/checkout.php:101
|
197 |
+
msgid "Last Name"
|
198 |
+
msgstr ""
|
199 |
+
|
200 |
+
#: includes/checkout.php:102
|
201 |
+
msgid "Country"
|
202 |
+
msgstr ""
|
203 |
+
|
204 |
+
#: includes/checkout.php:103
|
205 |
+
msgid "State"
|
206 |
+
msgstr ""
|
207 |
+
|
208 |
+
#: includes/checkout.php:104
|
209 |
+
msgid "City"
|
210 |
+
msgstr ""
|
211 |
+
|
212 |
+
#: includes/checkout.php:105
|
213 |
+
msgid "Postcode"
|
214 |
+
msgstr ""
|
215 |
+
|
216 |
+
#: includes/checkout.php:106
|
217 |
+
msgid "Address 1"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: includes/checkout.php:107
|
221 |
+
msgid "Address 2"
|
222 |
+
msgstr ""
|
223 |
+
|
224 |
+
#: includes/checkout.php:108
|
225 |
+
msgid "Company"
|
226 |
+
msgstr ""
|
227 |
+
|
228 |
+
#: includes/checkout.php:109
|
229 |
+
msgid "Phone"
|
230 |
+
msgstr ""
|
231 |
+
|
232 |
+
#: includes/checkout.php:118
|
233 |
+
msgid "Remove checkout shipping address"
|
234 |
+
msgstr ""
|
235 |
+
|
236 |
+
#: includes/checkout.php:119
|
237 |
+
msgid "Simplifies the checkout process removing the shipping address."
|
238 |
+
msgstr ""
|
239 |
+
|
240 |
+
#: includes/checkout.php:130
|
241 |
+
msgid "Remove checkout order comments"
|
242 |
+
msgstr ""
|
243 |
+
|
244 |
+
#: includes/checkout.php:131
|
245 |
+
msgid "Simplifies the checkout process removing the order notes."
|
246 |
+
msgstr ""
|
247 |
+
|
248 |
+
#: includes/checkout.php:142
|
249 |
+
msgid "Remove checkout policy text"
|
250 |
+
msgstr ""
|
251 |
+
|
252 |
+
#: includes/checkout.php:143
|
253 |
+
msgid "Simplifies the checkout process removing the policy text."
|
254 |
+
msgstr ""
|
255 |
+
|
256 |
+
#: includes/checkout.php:154
|
257 |
+
msgid "Remove checkout terms and conditions"
|
258 |
+
msgstr ""
|
259 |
+
|
260 |
+
#: includes/checkout.php:155
|
261 |
+
msgid "Simplifies the checkout process removing the terms and conditions."
|
262 |
+
msgstr ""
|
263 |
+
|
264 |
+
#: includes/checkout.php:166
|
265 |
+
msgid "Remove checkout gateway icons"
|
266 |
+
msgstr ""
|
267 |
+
|
268 |
+
#: includes/checkout.php:167
|
269 |
+
msgid "Simplifies the checkout view by removing the payment gateway icons."
|
270 |
+
msgstr ""
|
271 |
+
|
272 |
+
#: includes/checkout.php:178 includes/purchase.php:52
|
273 |
+
msgid "Remove checkout columns"
|
274 |
+
msgstr ""
|
275 |
+
|
276 |
+
#: includes/checkout.php:179
|
277 |
+
msgid ""
|
278 |
+
"Try to remove the columns and display the checkout form and order review in "
|
279 |
+
"one column."
|
280 |
+
msgstr ""
|
281 |
+
|
282 |
+
#: includes/checkout.php:190
|
283 |
+
msgid "Remove order details address"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#: includes/checkout.php:191
|
287 |
+
msgid "Remove the billing address of the customer in the order received page."
|
288 |
+
msgstr ""
|
289 |
+
|
290 |
+
#: includes/general.php:23 includes/general.php:36
|
291 |
+
msgid "General"
|
292 |
+
msgstr ""
|
293 |
+
|
294 |
+
#: includes/general.php:38
|
295 |
+
msgid "Simplifies the checkout process."
|
296 |
+
msgstr ""
|
297 |
+
|
298 |
+
#: includes/general.php:42
|
299 |
+
msgid "Added to cart alert"
|
300 |
+
msgstr ""
|
301 |
+
|
302 |
+
#: includes/general.php:43
|
303 |
+
msgid "Replace \"View Cart\" alert with direct checkout."
|
304 |
+
msgstr ""
|
305 |
+
|
306 |
+
#: includes/general.php:54
|
307 |
+
msgid "Added to cart link"
|
308 |
+
msgstr "Añadido a la carro enlace"
|
309 |
+
|
310 |
+
#: includes/general.php:55
|
311 |
+
msgid "Replace \"View Cart\" link with direct checkout."
|
312 |
+
msgstr ""
|
313 |
+
|
314 |
+
#: includes/general.php:66
|
315 |
+
msgid "Added to cart redirect"
|
316 |
+
msgstr ""
|
317 |
+
|
318 |
+
#: includes/general.php:67
|
319 |
+
msgid "Add to cart button behaviour."
|
320 |
+
msgstr ""
|
321 |
+
|
322 |
+
#: includes/general.php:102
|
323 |
+
msgid "Added to cart redirect to"
|
324 |
+
msgstr ""
|
325 |
+
|
326 |
+
#: includes/general.php:103 includes/general.php:116
|
327 |
+
msgid "Redirect to the cart or checkout page after successful addition."
|
328 |
+
msgstr ""
|
329 |
+
|
330 |
+
#: includes/general.php:108 includes/products.php:133
|
331 |
+
#: includes/products.php:299
|
332 |
+
msgid "Cart"
|
333 |
+
msgstr ""
|
334 |
+
|
335 |
+
#: includes/general.php:110
|
336 |
+
msgid "Custom URL"
|
337 |
+
msgstr ""
|
338 |
+
|
339 |
+
#: includes/general.php:115
|
340 |
+
msgid "Added to cart redirect to custom url"
|
341 |
+
msgstr ""
|
342 |
+
|
343 |
+
#: includes/general.php:147
|
344 |
+
msgid "View cart"
|
345 |
+
msgstr ""
|
346 |
+
|
347 |
+
#: includes/products.php:15 includes/products.php:28
|
348 |
+
msgid "Products"
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
#: includes/products.php:108 includes/products.php:262
|
352 |
+
msgid "Add quick purchase button"
|
353 |
+
msgstr ""
|
354 |
+
|
355 |
+
#: includes/products.php:109
|
356 |
+
msgid "Add a quick purchase button to the products pages."
|
357 |
+
msgstr ""
|
358 |
+
|
359 |
+
#: includes/products.php:120 includes/products.php:275
|
360 |
+
msgid "Add quick purchase class"
|
361 |
+
msgstr ""
|
362 |
+
|
363 |
+
#: includes/products.php:121
|
364 |
+
msgid "Add a custom class to the quick purchase button."
|
365 |
+
msgstr ""
|
366 |
+
|
367 |
+
#: includes/products.php:127 includes/products.php:293
|
368 |
+
msgid "Redirect quick purchase to"
|
369 |
+
msgstr ""
|
370 |
+
|
371 |
+
#: includes/products.php:128
|
372 |
+
msgid "Redirect the quick purchase button to the cart or checkout page."
|
373 |
+
msgstr ""
|
374 |
+
|
375 |
+
#: includes/products.php:139 includes/products.php:284
|
376 |
+
msgid "Add quick purchase text"
|
377 |
+
msgstr ""
|
378 |
+
|
379 |
+
#: includes/products.php:140
|
380 |
+
msgid "Add a custom text to the quick purchase button."
|
381 |
+
msgstr ""
|
382 |
+
|
383 |
+
#: includes/products.php:143 includes/purchase.php:35
|
384 |
+
msgid "Purchase Now"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
#: includes/products.php:146
|
388 |
+
msgid "Add default attributes in variable products"
|
389 |
+
msgstr ""
|
390 |
+
|
391 |
+
#: includes/products.php:147
|
392 |
+
msgid ""
|
393 |
+
"Add default attributes in all variable products to avoid disabled Add to "
|
394 |
+
"cart button."
|
395 |
+
msgstr ""
|
396 |
+
|
397 |
+
#: includes/products.php:264
|
398 |
+
msgid "Add quick purchase button to single product page."
|
399 |
+
msgstr ""
|
400 |
+
|
401 |
+
#: includes/products.php:277
|
402 |
+
msgid "Add quick purchase custom class."
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
#: includes/products.php:286
|
406 |
+
msgid "Add quick purchase custom text."
|
407 |
+
msgstr ""
|
408 |
+
|
409 |
+
#: includes/products.php:295
|
410 |
+
msgid "Redirect quick purchase to the cart or checkout page."
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: includes/products.php:311 woocommerce-direct-checkout.php:198
|
414 |
+
#: woocommerce-direct-checkout.php:394
|
415 |
+
msgid "Direct Checkout"
|
416 |
+
msgstr ""
|
417 |
+
|
418 |
+
#: includes/purchase.php:14 includes/purchase.php:30
|
419 |
+
#: woocommerce-direct-checkout.php:174
|
420 |
+
msgid "Premium"
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
#: includes/purchase.php:32
|
424 |
+
msgid ""
|
425 |
+
"WooCommerce Direct Checkout allows you to simplifies the checkout process by "
|
426 |
+
"skipping the shopping cart page. This plugin allows you to redirect your "
|
427 |
+
"customers directly to the checkout page and includes the cart inside the "
|
428 |
+
"checkout page."
|
429 |
+
msgstr ""
|
430 |
+
|
431 |
+
#: includes/purchase.php:36
|
432 |
+
msgid "Get Support"
|
433 |
+
msgstr ""
|
434 |
+
|
435 |
+
#: includes/purchase.php:40
|
436 |
+
msgid "One page checkout"
|
437 |
+
msgstr ""
|
438 |
+
|
439 |
+
#: includes/purchase.php:42
|
440 |
+
msgid ""
|
441 |
+
"WooCommerce Direct Checkout allows you to include the cart form in the "
|
442 |
+
"checkout page allowing your users to edit the cart and confirm the order on "
|
443 |
+
"the same page."
|
444 |
+
msgstr ""
|
445 |
+
|
446 |
+
#: includes/purchase.php:48
|
447 |
+
msgid ""
|
448 |
+
"Our checkout settings allow you to easily remove the unnecessary fields and "
|
449 |
+
"reduce the user spend completing those fields like the order comments, "
|
450 |
+
"shipping address, coupon form, policy text, and terms and conditions."
|
451 |
+
msgstr ""
|
452 |
+
|
453 |
+
#: includes/purchase.php:54
|
454 |
+
msgid ""
|
455 |
+
"This option allows you to simplify the checkout page by removing the two "
|
456 |
+
"columns in the checkout page."
|
457 |
+
msgstr ""
|
458 |
+
|
459 |
+
#: includes/purchase.php:66
|
460 |
+
msgid "Quick purchase"
|
461 |
+
msgstr ""
|
462 |
+
|
463 |
+
#: includes/purchase.php:68
|
464 |
+
msgid ""
|
465 |
+
"The Ajax add to cart option allows you to include single products, variable, "
|
466 |
+
"grouped and virtual products in the cart without the need to reload the "
|
467 |
+
"entire site each time."
|
468 |
+
msgstr ""
|
469 |
+
|
470 |
+
#: includes/purchase.php:76
|
471 |
+
msgid "Checkout redirect"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
#: includes/purchase.php:78
|
475 |
+
msgid ""
|
476 |
+
"This option allows you to redirect your users directly to the checkout page "
|
477 |
+
"reducing the total checkout process in one step."
|
478 |
+
msgstr ""
|
479 |
+
|
480 |
+
#: includes/purchase.php:82
|
481 |
+
msgid "Quick purchase on single products"
|
482 |
+
msgstr ""
|
483 |
+
|
484 |
+
#: includes/purchase.php:84
|
485 |
+
msgid ""
|
486 |
+
"If you want to give the option to the user to make a direct purchase or the "
|
487 |
+
"default add to cart product you can include a direct purchase button to the "
|
488 |
+
"products page."
|
489 |
+
msgstr ""
|
490 |
+
|
491 |
+
#: includes/purchase.php:88
|
492 |
+
msgid "Quick view in product archives"
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
+
#: includes/purchase.php:90
|
496 |
+
msgid ""
|
497 |
+
"This option allows you to include a button which displays a quick view in "
|
498 |
+
"the WooCommerce shop page and products categories."
|
499 |
+
msgstr ""
|
500 |
+
|
501 |
+
#: includes/purchase.php:93
|
502 |
+
msgid ""
|
503 |
+
"This is especially useful for the variable products because it allows users "
|
504 |
+
"to select the products attributes and include directly into the cart."
|
505 |
+
msgstr ""
|
506 |
+
|
507 |
+
#: woocommerce-direct-checkout.php:123
|
508 |
+
#, php-format
|
509 |
+
msgid "Hello! This is the first update of the %s plugin by QuadLayers!"
|
510 |
+
msgstr ""
|
511 |
+
|
512 |
+
#: woocommerce-direct-checkout.php:125
|
513 |
+
msgid ""
|
514 |
+
"We've worked very much and very hard to release this great product. Your "
|
515 |
+
"feedback will boost our motivation and help us promote and continue to "
|
516 |
+
"improve this product."
|
517 |
+
msgstr ""
|
518 |
+
|
519 |
+
#: woocommerce-direct-checkout.php:128
|
520 |
+
msgid "Go Premium!"
|
521 |
+
msgstr ""
|
522 |
+
|
523 |
+
#: woocommerce-direct-checkout.php:131
|
524 |
+
msgid "Report a bug"
|
525 |
+
msgstr ""
|
526 |
+
|
527 |
+
#: woocommerce-direct-checkout.php:175
|
528 |
+
msgid "Settings"
|
529 |
+
msgstr ""
|
530 |
+
|
531 |
+
#. Plugin Name of the plugin/theme
|
532 |
+
msgid "WooCommerce Direct Checkout"
|
533 |
+
msgstr ""
|
534 |
+
|
535 |
+
#. Description of the plugin/theme
|
536 |
+
msgid "Simplifies the checkout process to improve your sales rate."
|
537 |
+
msgstr ""
|
538 |
+
|
539 |
+
#. Author of the plugin/theme
|
540 |
+
msgid "QuadLayers"
|
541 |
+
msgstr ""
|
542 |
+
|
543 |
+
#. Author URI of the plugin/theme
|
544 |
+
msgid "https://www.quadlayers.com"
|
545 |
+
msgstr ""
|
languages/woocommerce-direct-checkout.pot
CHANGED
@@ -1,518 +1,518 @@
|
|
1 |
-
#, fuzzy
|
2 |
-
msgid ""
|
3 |
-
msgstr ""
|
4 |
-
"Project-Id-Version: WooCommerce Direct Checkout\n"
|
5 |
-
"POT-Creation-Date: 2019-05-10 04:57-0300\n"
|
6 |
-
"PO-Revision-Date: 2018-12-06 00:00-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-direct-checkout.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__;esc_attr_e;esc_attr_x:1,2c;"
|
17 |
-
"esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
18 |
-
"X-Poedit-SearchPath-0: .\n"
|
19 |
-
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
20 |
-
|
21 |
-
#: includes/archives.php:23 includes/archives.php:36
|
22 |
-
msgid "Archives"
|
23 |
-
msgstr ""
|
24 |
-
|
25 |
-
#: includes/archives.php:97 includes/products.php:89 includes/products.php:239
|
26 |
-
msgid "Replace Add to cart text"
|
27 |
-
msgstr ""
|
28 |
-
|
29 |
-
#: includes/archives.php:98 includes/products.php:90 includes/products.php:241
|
30 |
-
msgid "Replace \"Add to cart\" text."
|
31 |
-
msgstr ""
|
32 |
-
|
33 |
-
#: includes/archives.php:103 includes/archives.php:137 includes/checkout.php:47 includes/checkout.php:124
|
34 |
-
#: includes/checkout.php:136 includes/checkout.php:148 includes/checkout.php:160 includes/checkout.php:172
|
35 |
-
#: includes/checkout.php:184 includes/checkout.php:196 includes/general.php:48 includes/general.php:60
|
36 |
-
#: includes/general.php:74 includes/products.php:95 includes/products.php:114 includes/products.php:152
|
37 |
-
#: includes/products.php:245 includes/products.php:269
|
38 |
-
msgid "Yes"
|
39 |
-
msgstr ""
|
40 |
-
|
41 |
-
#: includes/archives.php:104 includes/archives.php:138 includes/checkout.php:48 includes/checkout.php:125
|
42 |
-
#: includes/checkout.php:137 includes/checkout.php:149 includes/checkout.php:161 includes/checkout.php:173
|
43 |
-
#: includes/checkout.php:185 includes/checkout.php:197 includes/general.php:49 includes/general.php:61
|
44 |
-
#: includes/general.php:72 includes/products.php:96 includes/products.php:115 includes/products.php:153
|
45 |
-
#: includes/products.php:246 includes/products.php:270
|
46 |
-
msgid "No"
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: includes/archives.php:109
|
50 |
-
msgid "Replace Add to cart text in"
|
51 |
-
msgstr ""
|
52 |
-
|
53 |
-
#: includes/archives.php:110
|
54 |
-
msgid "Replace \"Add to cart\" text in product types."
|
55 |
-
msgstr ""
|
56 |
-
|
57 |
-
#: includes/archives.php:115
|
58 |
-
msgid "Simple Products"
|
59 |
-
msgstr ""
|
60 |
-
|
61 |
-
#: includes/archives.php:116
|
62 |
-
msgid "Grouped Products"
|
63 |
-
msgstr ""
|
64 |
-
|
65 |
-
#: includes/archives.php:117
|
66 |
-
msgid "Virtual Products"
|
67 |
-
msgstr ""
|
68 |
-
|
69 |
-
#: includes/archives.php:118
|
70 |
-
msgid "Variable Products"
|
71 |
-
msgstr ""
|
72 |
-
|
73 |
-
#: includes/archives.php:119
|
74 |
-
msgid "Downloadable Products"
|
75 |
-
msgstr ""
|
76 |
-
|
77 |
-
#: includes/archives.php:124 includes/products.php:101 includes/products.php:251
|
78 |
-
msgid "Replace Add to cart text content"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: includes/archives.php:125 includes/products.php:102 includes/products.php:253
|
82 |
-
msgid "Replace \"Add to cart\" text with this text."
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: includes/archives.php:128 includes/products.php:105
|
86 |
-
msgid "Purchase"
|
87 |
-
msgstr ""
|
88 |
-
|
89 |
-
#: includes/archives.php:131
|
90 |
-
msgid "Add quick view button"
|
91 |
-
msgstr ""
|
92 |
-
|
93 |
-
#: includes/archives.php:132
|
94 |
-
msgid "Add product quick view modal button."
|
95 |
-
msgstr ""
|
96 |
-
|
97 |
-
#: includes/checkout.php:23 includes/checkout.php:36 includes/general.php:109 includes/general.php:135
|
98 |
-
#: includes/general.php:147 includes/products.php:134 includes/products.php:300
|
99 |
-
msgid "Checkout"
|
100 |
-
msgstr ""
|
101 |
-
|
102 |
-
#: includes/checkout.php:41
|
103 |
-
msgid "Add cart to checkout"
|
104 |
-
msgstr ""
|
105 |
-
|
106 |
-
#: includes/checkout.php:42
|
107 |
-
msgid "Simplifies the checkout process including the shopping cart page inside checkout."
|
108 |
-
msgstr ""
|
109 |
-
|
110 |
-
#: includes/checkout.php:53
|
111 |
-
msgid "Add cart to checkout fields"
|
112 |
-
msgstr ""
|
113 |
-
|
114 |
-
#: includes/checkout.php:54
|
115 |
-
msgid "Include this fields inside the checkout cart."
|
116 |
-
msgstr ""
|
117 |
-
|
118 |
-
#: includes/checkout.php:59
|
119 |
-
msgid "Remove"
|
120 |
-
msgstr ""
|
121 |
-
|
122 |
-
#: includes/checkout.php:60
|
123 |
-
msgid "Thumbnail"
|
124 |
-
msgstr ""
|
125 |
-
|
126 |
-
#: includes/checkout.php:61
|
127 |
-
msgid "Name"
|
128 |
-
msgstr ""
|
129 |
-
|
130 |
-
#: includes/checkout.php:62
|
131 |
-
msgid "Price"
|
132 |
-
msgstr ""
|
133 |
-
|
134 |
-
#: includes/checkout.php:63
|
135 |
-
msgid "Quantity"
|
136 |
-
msgstr ""
|
137 |
-
|
138 |
-
#: includes/checkout.php:73
|
139 |
-
msgid "Remove checkout coupon form"
|
140 |
-
msgstr ""
|
141 |
-
|
142 |
-
#: includes/checkout.php:74
|
143 |
-
msgid "Simplifies the checkout process removing the coupon form."
|
144 |
-
msgstr ""
|
145 |
-
|
146 |
-
#: includes/checkout.php:79
|
147 |
-
msgid "Leave coupon form"
|
148 |
-
msgstr ""
|
149 |
-
|
150 |
-
#: includes/checkout.php:80
|
151 |
-
msgid "Remove coupon form"
|
152 |
-
msgstr ""
|
153 |
-
|
154 |
-
#: includes/checkout.php:81
|
155 |
-
msgid "Remove coupon toggle"
|
156 |
-
msgstr ""
|
157 |
-
|
158 |
-
#: includes/checkout.php:82
|
159 |
-
msgid "Move to checkout order"
|
160 |
-
msgstr ""
|
161 |
-
|
162 |
-
#: includes/checkout.php:87
|
163 |
-
msgid "Add custom class to cart table"
|
164 |
-
msgstr ""
|
165 |
-
|
166 |
-
#: includes/checkout.php:88
|
167 |
-
msgid "Add a custom class to the cart table form in the checkot."
|
168 |
-
msgstr ""
|
169 |
-
|
170 |
-
#: includes/checkout.php:94 includes/purchase.php:46
|
171 |
-
msgid "Remove checkout fields"
|
172 |
-
msgstr ""
|
173 |
-
|
174 |
-
#: includes/checkout.php:95
|
175 |
-
msgid "Simplifies the checkout process removing the unnecessary checkout fields."
|
176 |
-
msgstr ""
|
177 |
-
|
178 |
-
#: includes/checkout.php:100
|
179 |
-
msgid "First Name"
|
180 |
-
msgstr ""
|
181 |
-
|
182 |
-
#: includes/checkout.php:101
|
183 |
-
msgid "Last Name"
|
184 |
-
msgstr ""
|
185 |
-
|
186 |
-
#: includes/checkout.php:102
|
187 |
-
msgid "Country"
|
188 |
-
msgstr ""
|
189 |
-
|
190 |
-
#: includes/checkout.php:103
|
191 |
-
msgid "State"
|
192 |
-
msgstr ""
|
193 |
-
|
194 |
-
#: includes/checkout.php:104
|
195 |
-
msgid "City"
|
196 |
-
msgstr ""
|
197 |
-
|
198 |
-
#: includes/checkout.php:105
|
199 |
-
msgid "Postcode"
|
200 |
-
msgstr ""
|
201 |
-
|
202 |
-
#: includes/checkout.php:106
|
203 |
-
msgid "Address 1"
|
204 |
-
msgstr ""
|
205 |
-
|
206 |
-
#: includes/checkout.php:107
|
207 |
-
msgid "Address 2"
|
208 |
-
msgstr ""
|
209 |
-
|
210 |
-
#: includes/checkout.php:108
|
211 |
-
msgid "Company"
|
212 |
-
msgstr ""
|
213 |
-
|
214 |
-
#: includes/checkout.php:109
|
215 |
-
msgid "Phone"
|
216 |
-
msgstr ""
|
217 |
-
|
218 |
-
#: includes/checkout.php:118
|
219 |
-
msgid "Remove checkout shipping address"
|
220 |
-
msgstr ""
|
221 |
-
|
222 |
-
#: includes/checkout.php:119
|
223 |
-
msgid "Simplifies the checkout process removing the shipping address."
|
224 |
-
msgstr ""
|
225 |
-
|
226 |
-
#: includes/checkout.php:130
|
227 |
-
msgid "Remove checkout order comments"
|
228 |
-
msgstr ""
|
229 |
-
|
230 |
-
#: includes/checkout.php:131
|
231 |
-
msgid "Simplifies the checkout process removing the order notes."
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
#: includes/checkout.php:142
|
235 |
-
msgid "Remove checkout policy text"
|
236 |
-
msgstr ""
|
237 |
-
|
238 |
-
#: includes/checkout.php:143
|
239 |
-
msgid "Simplifies the checkout process removing the policy text."
|
240 |
-
msgstr ""
|
241 |
-
|
242 |
-
#: includes/checkout.php:154
|
243 |
-
msgid "Remove checkout terms and conditions"
|
244 |
-
msgstr ""
|
245 |
-
|
246 |
-
#: includes/checkout.php:155
|
247 |
-
msgid "Simplifies the checkout process removing the terms and conditions."
|
248 |
-
msgstr ""
|
249 |
-
|
250 |
-
#: includes/checkout.php:166
|
251 |
-
msgid "Remove checkout gateway icons"
|
252 |
-
msgstr ""
|
253 |
-
|
254 |
-
#: includes/checkout.php:167
|
255 |
-
msgid "Simplifies the checkout view by removing the payment gateway icons."
|
256 |
-
msgstr ""
|
257 |
-
|
258 |
-
#: includes/checkout.php:178 includes/purchase.php:52
|
259 |
-
msgid "Remove checkout columns"
|
260 |
-
msgstr ""
|
261 |
-
|
262 |
-
#: includes/checkout.php:179
|
263 |
-
msgid "Try to remove the columns and display the checkout form and order review in one column."
|
264 |
-
msgstr ""
|
265 |
-
|
266 |
-
#: includes/checkout.php:190
|
267 |
-
msgid "Remove order details address"
|
268 |
-
msgstr ""
|
269 |
-
|
270 |
-
#: includes/checkout.php:191
|
271 |
-
msgid "Remove the billing address of the customer in the order received page."
|
272 |
-
msgstr ""
|
273 |
-
|
274 |
-
#: includes/general.php:23 includes/general.php:36
|
275 |
-
msgid "General"
|
276 |
-
msgstr ""
|
277 |
-
|
278 |
-
#: includes/general.php:38
|
279 |
-
msgid "Simplifies the checkout process."
|
280 |
-
msgstr ""
|
281 |
-
|
282 |
-
#: includes/general.php:42
|
283 |
-
msgid "Added to cart alert"
|
284 |
-
msgstr ""
|
285 |
-
|
286 |
-
#: includes/general.php:43
|
287 |
-
msgid "Replace \"View Cart\" alert with direct checkout."
|
288 |
-
msgstr ""
|
289 |
-
|
290 |
-
#: includes/general.php:54
|
291 |
-
msgid "Added to cart link"
|
292 |
-
msgstr ""
|
293 |
-
|
294 |
-
#: includes/general.php:55
|
295 |
-
msgid "Replace \"View Cart\" link with direct checkout."
|
296 |
-
msgstr ""
|
297 |
-
|
298 |
-
#: includes/general.php:66
|
299 |
-
msgid "Added to cart redirect"
|
300 |
-
msgstr ""
|
301 |
-
|
302 |
-
#: includes/general.php:67
|
303 |
-
msgid "Add to cart button behaviour."
|
304 |
-
msgstr ""
|
305 |
-
|
306 |
-
#: includes/general.php:102
|
307 |
-
msgid "Added to cart redirect to"
|
308 |
-
msgstr ""
|
309 |
-
|
310 |
-
#: includes/general.php:103 includes/general.php:116
|
311 |
-
msgid "Redirect to the cart or checkout page after successful addition."
|
312 |
-
msgstr ""
|
313 |
-
|
314 |
-
#: includes/general.php:108 includes/products.php:133 includes/products.php:299
|
315 |
-
msgid "Cart"
|
316 |
-
msgstr ""
|
317 |
-
|
318 |
-
#: includes/general.php:110
|
319 |
-
msgid "Custom URL"
|
320 |
-
msgstr ""
|
321 |
-
|
322 |
-
#: includes/general.php:115
|
323 |
-
msgid "Added to cart redirect to custom url"
|
324 |
-
msgstr ""
|
325 |
-
|
326 |
-
#: includes/general.php:147
|
327 |
-
msgid "View cart"
|
328 |
-
msgstr ""
|
329 |
-
|
330 |
-
#: includes/products.php:15 includes/products.php:28
|
331 |
-
msgid "Products"
|
332 |
-
msgstr ""
|
333 |
-
|
334 |
-
#: includes/products.php:108 includes/products.php:262
|
335 |
-
msgid "Add quick purchase button"
|
336 |
-
msgstr ""
|
337 |
-
|
338 |
-
#: includes/products.php:109
|
339 |
-
msgid "Add a quick purchase button to the products pages."
|
340 |
-
msgstr ""
|
341 |
-
|
342 |
-
#: includes/products.php:120 includes/products.php:275
|
343 |
-
msgid "Add quick purchase class"
|
344 |
-
msgstr ""
|
345 |
-
|
346 |
-
#: includes/products.php:121
|
347 |
-
msgid "Add a custom class to the quick purchase button."
|
348 |
-
msgstr ""
|
349 |
-
|
350 |
-
#: includes/products.php:127 includes/products.php:293
|
351 |
-
msgid "Redirect quick purchase to"
|
352 |
-
msgstr ""
|
353 |
-
|
354 |
-
#: includes/products.php:128
|
355 |
-
msgid "Redirect the quick purchase button to the cart or checkout page."
|
356 |
-
msgstr ""
|
357 |
-
|
358 |
-
#: includes/products.php:139 includes/products.php:284
|
359 |
-
msgid "Add quick purchase text"
|
360 |
-
msgstr ""
|
361 |
-
|
362 |
-
#: includes/products.php:140
|
363 |
-
msgid "Add a custom text to the quick purchase button."
|
364 |
-
msgstr ""
|
365 |
-
|
366 |
-
#: includes/products.php:143 includes/purchase.php:35
|
367 |
-
msgid "Purchase Now"
|
368 |
-
msgstr ""
|
369 |
-
|
370 |
-
#: includes/products.php:146
|
371 |
-
msgid "Add default attributes in variable products"
|
372 |
-
msgstr ""
|
373 |
-
|
374 |
-
#: includes/products.php:147
|
375 |
-
msgid "Add default attributes in all variable products to avoid disabled Add to cart button."
|
376 |
-
msgstr ""
|
377 |
-
|
378 |
-
#: includes/products.php:264
|
379 |
-
msgid "Add quick purchase button to single product page."
|
380 |
-
msgstr ""
|
381 |
-
|
382 |
-
#: includes/products.php:277
|
383 |
-
msgid "Add quick purchase custom class."
|
384 |
-
msgstr ""
|
385 |
-
|
386 |
-
#: includes/products.php:286
|
387 |
-
msgid "Add quick purchase custom text."
|
388 |
-
msgstr ""
|
389 |
-
|
390 |
-
#: includes/products.php:295
|
391 |
-
msgid "Redirect quick purchase to the cart or checkout page."
|
392 |
-
msgstr ""
|
393 |
-
|
394 |
-
#: includes/products.php:311 woocommerce-direct-checkout.php:198 woocommerce-direct-checkout.php:394
|
395 |
-
msgid "Direct Checkout"
|
396 |
-
msgstr ""
|
397 |
-
|
398 |
-
#: includes/purchase.php:14 includes/purchase.php:30 woocommerce-direct-checkout.php:174
|
399 |
-
msgid "Premium"
|
400 |
-
msgstr ""
|
401 |
-
|
402 |
-
#: includes/purchase.php:32
|
403 |
-
msgid ""
|
404 |
-
"WooCommerce Direct Checkout allows you to simplifies the checkout process by skipping the shopping cart "
|
405 |
-
"page. This plugin allows you to redirect your customers directly to the checkout page and includes the "
|
406 |
-
"cart inside the checkout page."
|
407 |
-
msgstr ""
|
408 |
-
|
409 |
-
#: includes/purchase.php:36
|
410 |
-
msgid "Get Support"
|
411 |
-
msgstr ""
|
412 |
-
|
413 |
-
#: includes/purchase.php:40
|
414 |
-
msgid "One page checkout"
|
415 |
-
msgstr ""
|
416 |
-
|
417 |
-
#: includes/purchase.php:42
|
418 |
-
msgid ""
|
419 |
-
"WooCommerce Direct Checkout allows you to include the cart form in the checkout page allowing your users "
|
420 |
-
"to edit the cart and confirm the order on the same page."
|
421 |
-
msgstr ""
|
422 |
-
|
423 |
-
#: includes/purchase.php:48
|
424 |
-
msgid ""
|
425 |
-
"Our checkout settings allow you to easily remove the unnecessary fields and reduce the user spend "
|
426 |
-
"completing those fields like the order comments, shipping address, coupon form, policy text, and terms and "
|
427 |
-
"conditions."
|
428 |
-
msgstr ""
|
429 |
-
|
430 |
-
#: includes/purchase.php:54
|
431 |
-
msgid ""
|
432 |
-
"This option allows you to simplify the checkout page by removing the two columns in the checkout page."
|
433 |
-
msgstr ""
|
434 |
-
|
435 |
-
#: includes/purchase.php:66
|
436 |
-
msgid "Quick purchase"
|
437 |
-
msgstr ""
|
438 |
-
|
439 |
-
#: includes/purchase.php:68
|
440 |
-
msgid ""
|
441 |
-
"The Ajax add to cart option allows you to include single products, variable, grouped and virtual products "
|
442 |
-
"in the cart without the need to reload the entire site each time."
|
443 |
-
msgstr ""
|
444 |
-
|
445 |
-
#: includes/purchase.php:76
|
446 |
-
msgid "Checkout redirect"
|
447 |
-
msgstr ""
|
448 |
-
|
449 |
-
#: includes/purchase.php:78
|
450 |
-
msgid ""
|
451 |
-
"This option allows you to redirect your users directly to the checkout page reducing the total checkout "
|
452 |
-
"process in one step."
|
453 |
-
msgstr ""
|
454 |
-
|
455 |
-
#: includes/purchase.php:82
|
456 |
-
msgid "Quick purchase on single products"
|
457 |
-
msgstr ""
|
458 |
-
|
459 |
-
#: includes/purchase.php:84
|
460 |
-
msgid ""
|
461 |
-
"If you want to give the option to the user to make a direct purchase or the default add to cart product "
|
462 |
-
"you can include a direct purchase button to the products page."
|
463 |
-
msgstr ""
|
464 |
-
|
465 |
-
#: includes/purchase.php:88
|
466 |
-
msgid "Quick view in product archives"
|
467 |
-
msgstr ""
|
468 |
-
|
469 |
-
#: includes/purchase.php:90
|
470 |
-
msgid ""
|
471 |
-
"This option allows you to include a button which displays a quick view in the WooCommerce shop page and "
|
472 |
-
"products categories."
|
473 |
-
msgstr ""
|
474 |
-
|
475 |
-
#: includes/purchase.php:93
|
476 |
-
msgid ""
|
477 |
-
"This is especially useful for the variable products because it allows users to select the products "
|
478 |
-
"attributes and include directly into the cart."
|
479 |
-
msgstr ""
|
480 |
-
|
481 |
-
#: woocommerce-direct-checkout.php:123
|
482 |
-
#, php-format
|
483 |
-
msgid "Hello! This is the first update of the %s plugin by QuadLayers!"
|
484 |
-
msgstr ""
|
485 |
-
|
486 |
-
#: woocommerce-direct-checkout.php:125
|
487 |
-
msgid ""
|
488 |
-
"We've worked very much and very hard to release this great product. Your feedback will boost our "
|
489 |
-
"motivation and help us promote and continue to improve this product."
|
490 |
-
msgstr ""
|
491 |
-
|
492 |
-
#: woocommerce-direct-checkout.php:128
|
493 |
-
msgid "Go Premium!"
|
494 |
-
msgstr ""
|
495 |
-
|
496 |
-
#: woocommerce-direct-checkout.php:131
|
497 |
-
msgid "Report a bug"
|
498 |
-
msgstr ""
|
499 |
-
|
500 |
-
#: woocommerce-direct-checkout.php:175
|
501 |
-
msgid "Settings"
|
502 |
-
msgstr ""
|
503 |
-
|
504 |
-
#. Plugin Name of the plugin/theme
|
505 |
-
msgid "WooCommerce Direct Checkout"
|
506 |
-
msgstr ""
|
507 |
-
|
508 |
-
#. Description of the plugin/theme
|
509 |
-
msgid "Simplifies the checkout process to improve your sales rate."
|
510 |
-
msgstr ""
|
511 |
-
|
512 |
-
#. Author of the plugin/theme
|
513 |
-
msgid "QuadLayers"
|
514 |
-
msgstr ""
|
515 |
-
|
516 |
-
#. Author URI of the plugin/theme
|
517 |
-
msgid "https://www.quadlayers.com"
|
518 |
-
msgstr ""
|
1 |
+
#, fuzzy
|
2 |
+
msgid ""
|
3 |
+
msgstr ""
|
4 |
+
"Project-Id-Version: WooCommerce Direct Checkout\n"
|
5 |
+
"POT-Creation-Date: 2019-05-10 04:57-0300\n"
|
6 |
+
"PO-Revision-Date: 2018-12-06 00:00-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-direct-checkout.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__;esc_attr_e;esc_attr_x:1,2c;"
|
17 |
+
"esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
18 |
+
"X-Poedit-SearchPath-0: .\n"
|
19 |
+
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
20 |
+
|
21 |
+
#: includes/archives.php:23 includes/archives.php:36
|
22 |
+
msgid "Archives"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: includes/archives.php:97 includes/products.php:89 includes/products.php:239
|
26 |
+
msgid "Replace Add to cart text"
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: includes/archives.php:98 includes/products.php:90 includes/products.php:241
|
30 |
+
msgid "Replace \"Add to cart\" text."
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: includes/archives.php:103 includes/archives.php:137 includes/checkout.php:47 includes/checkout.php:124
|
34 |
+
#: includes/checkout.php:136 includes/checkout.php:148 includes/checkout.php:160 includes/checkout.php:172
|
35 |
+
#: includes/checkout.php:184 includes/checkout.php:196 includes/general.php:48 includes/general.php:60
|
36 |
+
#: includes/general.php:74 includes/products.php:95 includes/products.php:114 includes/products.php:152
|
37 |
+
#: includes/products.php:245 includes/products.php:269
|
38 |
+
msgid "Yes"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: includes/archives.php:104 includes/archives.php:138 includes/checkout.php:48 includes/checkout.php:125
|
42 |
+
#: includes/checkout.php:137 includes/checkout.php:149 includes/checkout.php:161 includes/checkout.php:173
|
43 |
+
#: includes/checkout.php:185 includes/checkout.php:197 includes/general.php:49 includes/general.php:61
|
44 |
+
#: includes/general.php:72 includes/products.php:96 includes/products.php:115 includes/products.php:153
|
45 |
+
#: includes/products.php:246 includes/products.php:270
|
46 |
+
msgid "No"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: includes/archives.php:109
|
50 |
+
msgid "Replace Add to cart text in"
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: includes/archives.php:110
|
54 |
+
msgid "Replace \"Add to cart\" text in product types."
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
#: includes/archives.php:115
|
58 |
+
msgid "Simple Products"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: includes/archives.php:116
|
62 |
+
msgid "Grouped Products"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: includes/archives.php:117
|
66 |
+
msgid "Virtual Products"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: includes/archives.php:118
|
70 |
+
msgid "Variable Products"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: includes/archives.php:119
|
74 |
+
msgid "Downloadable Products"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: includes/archives.php:124 includes/products.php:101 includes/products.php:251
|
78 |
+
msgid "Replace Add to cart text content"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: includes/archives.php:125 includes/products.php:102 includes/products.php:253
|
82 |
+
msgid "Replace \"Add to cart\" text with this text."
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: includes/archives.php:128 includes/products.php:105
|
86 |
+
msgid "Purchase"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: includes/archives.php:131
|
90 |
+
msgid "Add quick view button"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: includes/archives.php:132
|
94 |
+
msgid "Add product quick view modal button."
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: includes/checkout.php:23 includes/checkout.php:36 includes/general.php:109 includes/general.php:135
|
98 |
+
#: includes/general.php:147 includes/products.php:134 includes/products.php:300
|
99 |
+
msgid "Checkout"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: includes/checkout.php:41
|
103 |
+
msgid "Add cart to checkout"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: includes/checkout.php:42
|
107 |
+
msgid "Simplifies the checkout process including the shopping cart page inside checkout."
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: includes/checkout.php:53
|
111 |
+
msgid "Add cart to checkout fields"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: includes/checkout.php:54
|
115 |
+
msgid "Include this fields inside the checkout cart."
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: includes/checkout.php:59
|
119 |
+
msgid "Remove"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: includes/checkout.php:60
|
123 |
+
msgid "Thumbnail"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: includes/checkout.php:61
|
127 |
+
msgid "Name"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: includes/checkout.php:62
|
131 |
+
msgid "Price"
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: includes/checkout.php:63
|
135 |
+
msgid "Quantity"
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
#: includes/checkout.php:73
|
139 |
+
msgid "Remove checkout coupon form"
|
140 |
+
msgstr ""
|
141 |
+
|
142 |
+
#: includes/checkout.php:74
|
143 |
+
msgid "Simplifies the checkout process removing the coupon form."
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: includes/checkout.php:79
|
147 |
+
msgid "Leave coupon form"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: includes/checkout.php:80
|
151 |
+
msgid "Remove coupon form"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: includes/checkout.php:81
|
155 |
+
msgid "Remove coupon toggle"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: includes/checkout.php:82
|
159 |
+
msgid "Move to checkout order"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: includes/checkout.php:87
|
163 |
+
msgid "Add custom class to cart table"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: includes/checkout.php:88
|
167 |
+
msgid "Add a custom class to the cart table form in the checkot."
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: includes/checkout.php:94 includes/purchase.php:46
|
171 |
+
msgid "Remove checkout fields"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: includes/checkout.php:95
|
175 |
+
msgid "Simplifies the checkout process removing the unnecessary checkout fields."
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: includes/checkout.php:100
|
179 |
+
msgid "First Name"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: includes/checkout.php:101
|
183 |
+
msgid "Last Name"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: includes/checkout.php:102
|
187 |
+
msgid "Country"
|
188 |
+
msgstr ""
|
189 |
+
|
190 |
+
#: includes/checkout.php:103
|
191 |
+
msgid "State"
|
192 |
+
msgstr ""
|
193 |
+
|
194 |
+
#: includes/checkout.php:104
|
195 |
+
msgid "City"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#: includes/checkout.php:105
|
199 |
+
msgid "Postcode"
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#: includes/checkout.php:106
|
203 |
+
msgid "Address 1"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
#: includes/checkout.php:107
|
207 |
+
msgid "Address 2"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: includes/checkout.php:108
|
211 |
+
msgid "Company"
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: includes/checkout.php:109
|
215 |
+
msgid "Phone"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: includes/checkout.php:118
|
219 |
+
msgid "Remove checkout shipping address"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
#: includes/checkout.php:119
|
223 |
+
msgid "Simplifies the checkout process removing the shipping address."
|
224 |
+
msgstr ""
|
225 |
+
|
226 |
+
#: includes/checkout.php:130
|
227 |
+
msgid "Remove checkout order comments"
|
228 |
+
msgstr ""
|
229 |
+
|
230 |
+
#: includes/checkout.php:131
|
231 |
+
msgid "Simplifies the checkout process removing the order notes."
|
232 |
+
msgstr ""
|
233 |
+
|
234 |
+
#: includes/checkout.php:142
|
235 |
+
msgid "Remove checkout policy text"
|
236 |
+
msgstr ""
|
237 |
+
|
238 |
+
#: includes/checkout.php:143
|
239 |
+
msgid "Simplifies the checkout process removing the policy text."
|
240 |
+
msgstr ""
|
241 |
+
|
242 |
+
#: includes/checkout.php:154
|
243 |
+
msgid "Remove checkout terms and conditions"
|
244 |
+
msgstr ""
|
245 |
+
|
246 |
+
#: includes/checkout.php:155
|
247 |
+
msgid "Simplifies the checkout process removing the terms and conditions."
|
248 |
+
msgstr ""
|
249 |
+
|
250 |
+
#: includes/checkout.php:166
|
251 |
+
msgid "Remove checkout gateway icons"
|
252 |
+
msgstr ""
|
253 |
+
|
254 |
+
#: includes/checkout.php:167
|
255 |
+
msgid "Simplifies the checkout view by removing the payment gateway icons."
|
256 |
+
msgstr ""
|
257 |
+
|
258 |
+
#: includes/checkout.php:178 includes/purchase.php:52
|
259 |
+
msgid "Remove checkout columns"
|
260 |
+
msgstr ""
|
261 |
+
|
262 |
+
#: includes/checkout.php:179
|
263 |
+
msgid "Try to remove the columns and display the checkout form and order review in one column."
|
264 |
+
msgstr ""
|
265 |
+
|
266 |
+
#: includes/checkout.php:190
|
267 |
+
msgid "Remove order details address"
|
268 |
+
msgstr ""
|
269 |
+
|
270 |
+
#: includes/checkout.php:191
|
271 |
+
msgid "Remove the billing address of the customer in the order received page."
|
272 |
+
msgstr ""
|
273 |
+
|
274 |
+
#: includes/general.php:23 includes/general.php:36
|
275 |
+
msgid "General"
|
276 |
+
msgstr ""
|
277 |
+
|
278 |
+
#: includes/general.php:38
|
279 |
+
msgid "Simplifies the checkout process."
|
280 |
+
msgstr ""
|
281 |
+
|
282 |
+
#: includes/general.php:42
|
283 |
+
msgid "Added to cart alert"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#: includes/general.php:43
|
287 |
+
msgid "Replace \"View Cart\" alert with direct checkout."
|
288 |
+
msgstr ""
|
289 |
+
|
290 |
+
#: includes/general.php:54
|
291 |
+
msgid "Added to cart link"
|
292 |
+
msgstr ""
|
293 |
+
|
294 |
+
#: includes/general.php:55
|
295 |
+
msgid "Replace \"View Cart\" link with direct checkout."
|
296 |
+
msgstr ""
|
297 |
+
|
298 |
+
#: includes/general.php:66
|
299 |
+
msgid "Added to cart redirect"
|
300 |
+
msgstr ""
|
301 |
+
|
302 |
+
#: includes/general.php:67
|
303 |
+
msgid "Add to cart button behaviour."
|
304 |
+
msgstr ""
|
305 |
+
|
306 |
+
#: includes/general.php:102
|
307 |
+
msgid "Added to cart redirect to"
|
308 |
+
msgstr ""
|
309 |
+
|
310 |
+
#: includes/general.php:103 includes/general.php:116
|
311 |
+
msgid "Redirect to the cart or checkout page after successful addition."
|
312 |
+
msgstr ""
|
313 |
+
|
314 |
+
#: includes/general.php:108 includes/products.php:133 includes/products.php:299
|
315 |
+
msgid "Cart"
|
316 |
+
msgstr ""
|
317 |
+
|
318 |
+
#: includes/general.php:110
|
319 |
+
msgid "Custom URL"
|
320 |
+
msgstr ""
|
321 |
+
|
322 |
+
#: includes/general.php:115
|
323 |
+
msgid "Added to cart redirect to custom url"
|
324 |
+
msgstr ""
|
325 |
+
|
326 |
+
#: includes/general.php:147
|
327 |
+
msgid "View cart"
|
328 |
+
msgstr ""
|
329 |
+
|
330 |
+
#: includes/products.php:15 includes/products.php:28
|
331 |
+
msgid "Products"
|
332 |
+
msgstr ""
|
333 |
+
|
334 |
+
#: includes/products.php:108 includes/products.php:262
|
335 |
+
msgid "Add quick purchase button"
|
336 |
+
msgstr ""
|
337 |
+
|
338 |
+
#: includes/products.php:109
|
339 |
+
msgid "Add a quick purchase button to the products pages."
|
340 |
+
msgstr ""
|
341 |
+
|
342 |
+
#: includes/products.php:120 includes/products.php:275
|
343 |
+
msgid "Add quick purchase class"
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: includes/products.php:121
|
347 |
+
msgid "Add a custom class to the quick purchase button."
|
348 |
+
msgstr ""
|
349 |
+
|
350 |
+
#: includes/products.php:127 includes/products.php:293
|
351 |
+
msgid "Redirect quick purchase to"
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
+
#: includes/products.php:128
|
355 |
+
msgid "Redirect the quick purchase button to the cart or checkout page."
|
356 |
+
msgstr ""
|
357 |
+
|
358 |
+
#: includes/products.php:139 includes/products.php:284
|
359 |
+
msgid "Add quick purchase text"
|
360 |
+
msgstr ""
|
361 |
+
|
362 |
+
#: includes/products.php:140
|
363 |
+
msgid "Add a custom text to the quick purchase button."
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
#: includes/products.php:143 includes/purchase.php:35
|
367 |
+
msgid "Purchase Now"
|
368 |
+
msgstr ""
|
369 |
+
|
370 |
+
#: includes/products.php:146
|
371 |
+
msgid "Add default attributes in variable products"
|
372 |
+
msgstr ""
|
373 |
+
|
374 |
+
#: includes/products.php:147
|
375 |
+
msgid "Add default attributes in all variable products to avoid disabled Add to cart button."
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
#: includes/products.php:264
|
379 |
+
msgid "Add quick purchase button to single product page."
|
380 |
+
msgstr ""
|
381 |
+
|
382 |
+
#: includes/products.php:277
|
383 |
+
msgid "Add quick purchase custom class."
|
384 |
+
msgstr ""
|
385 |
+
|
386 |
+
#: includes/products.php:286
|
387 |
+
msgid "Add quick purchase custom text."
|
388 |
+
msgstr ""
|
389 |
+
|
390 |
+
#: includes/products.php:295
|
391 |
+
msgid "Redirect quick purchase to the cart or checkout page."
|
392 |
+
msgstr ""
|
393 |
+
|
394 |
+
#: includes/products.php:311 woocommerce-direct-checkout.php:198 woocommerce-direct-checkout.php:394
|
395 |
+
msgid "Direct Checkout"
|
396 |
+
msgstr ""
|
397 |
+
|
398 |
+
#: includes/purchase.php:14 includes/purchase.php:30 woocommerce-direct-checkout.php:174
|
399 |
+
msgid "Premium"
|
400 |
+
msgstr ""
|
401 |
+
|
402 |
+
#: includes/purchase.php:32
|
403 |
+
msgid ""
|
404 |
+
"WooCommerce Direct Checkout allows you to simplifies the checkout process by skipping the shopping cart "
|
405 |
+
"page. This plugin allows you to redirect your customers directly to the checkout page and includes the "
|
406 |
+
"cart inside the checkout page."
|
407 |
+
msgstr ""
|
408 |
+
|
409 |
+
#: includes/purchase.php:36
|
410 |
+
msgid "Get Support"
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: includes/purchase.php:40
|
414 |
+
msgid "One page checkout"
|
415 |
+
msgstr ""
|
416 |
+
|
417 |
+
#: includes/purchase.php:42
|
418 |
+
msgid ""
|
419 |
+
"WooCommerce Direct Checkout allows you to include the cart form in the checkout page allowing your users "
|
420 |
+
"to edit the cart and confirm the order on the same page."
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
#: includes/purchase.php:48
|
424 |
+
msgid ""
|
425 |
+
"Our checkout settings allow you to easily remove the unnecessary fields and reduce the user spend "
|
426 |
+
"completing those fields like the order comments, shipping address, coupon form, policy text, and terms and "
|
427 |
+
"conditions."
|
428 |
+
msgstr ""
|
429 |
+
|
430 |
+
#: includes/purchase.php:54
|
431 |
+
msgid ""
|
432 |
+
"This option allows you to simplify the checkout page by removing the two columns in the checkout page."
|
433 |
+
msgstr ""
|
434 |
+
|
435 |
+
#: includes/purchase.php:66
|
436 |
+
msgid "Quick purchase"
|
437 |
+
msgstr ""
|
438 |
+
|
439 |
+
#: includes/purchase.php:68
|
440 |
+
msgid ""
|
441 |
+
"The Ajax add to cart option allows you to include single products, variable, grouped and virtual products "
|
442 |
+
"in the cart without the need to reload the entire site each time."
|
443 |
+
msgstr ""
|
444 |
+
|
445 |
+
#: includes/purchase.php:76
|
446 |
+
msgid "Checkout redirect"
|
447 |
+
msgstr ""
|
448 |
+
|
449 |
+
#: includes/purchase.php:78
|
450 |
+
msgid ""
|
451 |
+
"This option allows you to redirect your users directly to the checkout page reducing the total checkout "
|
452 |
+
"process in one step."
|
453 |
+
msgstr ""
|
454 |
+
|
455 |
+
#: includes/purchase.php:82
|
456 |
+
msgid "Quick purchase on single products"
|
457 |
+
msgstr ""
|
458 |
+
|
459 |
+
#: includes/purchase.php:84
|
460 |
+
msgid ""
|
461 |
+
"If you want to give the option to the user to make a direct purchase or the default add to cart product "
|
462 |
+
"you can include a direct purchase button to the products page."
|
463 |
+
msgstr ""
|
464 |
+
|
465 |
+
#: includes/purchase.php:88
|
466 |
+
msgid "Quick view in product archives"
|
467 |
+
msgstr ""
|
468 |
+
|
469 |
+
#: includes/purchase.php:90
|
470 |
+
msgid ""
|
471 |
+
"This option allows you to include a button which displays a quick view in the WooCommerce shop page and "
|
472 |
+
"products categories."
|
473 |
+
msgstr ""
|
474 |
+
|
475 |
+
#: includes/purchase.php:93
|
476 |
+
msgid ""
|
477 |
+
"This is especially useful for the variable products because it allows users to select the products "
|
478 |
+
"attributes and include directly into the cart."
|
479 |
+
msgstr ""
|
480 |
+
|
481 |
+
#: woocommerce-direct-checkout.php:123
|
482 |
+
#, php-format
|
483 |
+
msgid "Hello! This is the first update of the %s plugin by QuadLayers!"
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
#: woocommerce-direct-checkout.php:125
|
487 |
+
msgid ""
|
488 |
+
"We've worked very much and very hard to release this great product. Your feedback will boost our "
|
489 |
+
"motivation and help us promote and continue to improve this product."
|
490 |
+
msgstr ""
|
491 |
+
|
492 |
+
#: woocommerce-direct-checkout.php:128
|
493 |
+
msgid "Go Premium!"
|
494 |
+
msgstr ""
|
495 |
+
|
496 |
+
#: woocommerce-direct-checkout.php:131
|
497 |
+
msgid "Report a bug"
|
498 |
+
msgstr ""
|
499 |
+
|
500 |
+
#: woocommerce-direct-checkout.php:175
|
501 |
+
msgid "Settings"
|
502 |
+
msgstr ""
|
503 |
+
|
504 |
+
#. Plugin Name of the plugin/theme
|
505 |
+
msgid "WooCommerce Direct Checkout"
|
506 |
+
msgstr ""
|
507 |
+
|
508 |
+
#. Description of the plugin/theme
|
509 |
+
msgid "Simplifies the checkout process to improve your sales rate."
|
510 |
+
msgstr ""
|
511 |
+
|
512 |
+
#. Author of the plugin/theme
|
513 |
+
msgid "QuadLayers"
|
514 |
+
msgstr ""
|
515 |
+
|
516 |
+
#. Author URI of the plugin/theme
|
517 |
+
msgid "https://www.quadlayers.com"
|
518 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: quadlayers
|
|
3 |
Â
Tags: woocommerce, woocommerce ajax, woocommerce ajax cart, add to cart, woocommerce direct checkout, woocommerce quick buy, woocommerce remove checkout fields, woocommerce ajax single products, woocommerce one page checkout
|
4 |
Â
Requires at least: 4.8
|
5 |
Â
Tested up to: 5.2
|
6 |
-
Stable tag: 2.1.
|
7 |
Â
License: GPLv2 or later
|
8 |
Â
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Â
|
@@ -42,6 +42,9 @@ The premium version of WooCommerce Direct Checkot allows to include a quick purc
|
|
42 |
Â
|
43 |
Â
== Changelog ==
|
44 |
Â
|
Â
|
|
Â
|
|
Â
|
|
45 |
Â
= 2.1.1 =
|
46 |
Â
* Fix: wordpress 5.2 compatibility
|
47 |
Â
|
3 |
Â
Tags: woocommerce, woocommerce ajax, woocommerce ajax cart, add to cart, woocommerce direct checkout, woocommerce quick buy, woocommerce remove checkout fields, woocommerce ajax single products, woocommerce one page checkout
|
4 |
Â
Requires at least: 4.8
|
5 |
Â
Tested up to: 5.2
|
6 |
+
Stable tag: 2.1.2
|
7 |
Â
License: GPLv2 or later
|
8 |
Â
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Â
|
42 |
Â
|
43 |
Â
== Changelog ==
|
44 |
Â
|
45 |
+
= 2.1.2 =
|
46 |
+
* Fix: woocommerce product addons compatibility
|
47 |
+
|
48 |
Â
= 2.1.1 =
|
49 |
Â
* Fix: wordpress 5.2 compatibility
|
50 |
Â
|
woocommerce-direct-checkout.php
CHANGED
@@ -1,480 +1,480 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: WooCommerce Direct Checkout
|
4 |
-
* Description: Simplifies the checkout process to improve your sales rate.
|
5 |
-
* Version:
|
6 |
-
* Author:
|
7 |
-
* Author URI:
|
8 |
-
* Copyright:
|
9 |
-
* Text Domain: woocommerce-direct-checkout
|
10 |
-
*/
|
11 |
-
|
12 |
-
if (!defined('ABSPATH')) {
|
13 |
-
die('-1');
|
14 |
-
}
|
15 |
-
if (!defined('QLWCDC_PLUGIN_NAME')) {
|
16 |
-
define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
|
17 |
-
}
|
18 |
-
if (!defined('QLWCDC_PLUGIN_VERSION')) {
|
19 |
-
define('QLWCDC_PLUGIN_VERSION', '2.1.
|
20 |
-
}
|
21 |
-
if (!defined('QLWCDC_PLUGIN_FILE')) {
|
22 |
-
define('QLWCDC_PLUGIN_FILE', __FILE__);
|
23 |
-
}
|
24 |
-
if (!defined('QLWCDC_PLUGIN_DIR')) {
|
25 |
-
define('QLWCDC_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
|
26 |
-
}
|
27 |
-
if (!defined('QLWCDC_DOMAIN')) {
|
28 |
-
define('QLWCDC_DOMAIN', 'qlwcdc');
|
29 |
-
}
|
30 |
-
if (!defined('QLWCDC_WORDPRESS_URL')) {
|
31 |
-
define('QLWCDC_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-direct-checkout/');
|
32 |
-
}
|
33 |
-
if (!defined('QLWCDC_REVIEW_URL')) {
|
34 |
-
define('QLWCDC_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-direct-checkout/reviews/?filter=5#new-post');
|
35 |
-
}
|
36 |
-
if (!defined('QLWCDC_DEMO_URL')) {
|
37 |
-
define('QLWCDC_DEMO_URL', 'https://quadlayers.com/portfolio/woocommerce-direct-checkout/?utm_source=qlwcdc_admin');
|
38 |
-
}
|
39 |
-
if (!defined('QLWCDC_PURCHASE_URL')) {
|
40 |
-
define('QLWCDC_PURCHASE_URL', QLWCDC_DEMO_URL);
|
41 |
-
}
|
42 |
-
if (!defined('QLWCDC_SUPPORT_URL')) {
|
43 |
-
define('QLWCDC_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qlwcdc_admin');
|
44 |
-
}
|
45 |
-
if (!defined('QLWCDC_GROUP_URL')) {
|
46 |
-
define('QLWCDC_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
|
47 |
-
}
|
48 |
-
|
49 |
-
if (!class_exists('QLWCDC')) {
|
50 |
-
|
51 |
-
class QLWCDC {
|
52 |
-
|
53 |
-
protected static $instance;
|
54 |
-
|
55 |
-
function ajax_dismiss_notice() {
|
56 |
-
|
57 |
-
if ($notice_id = ( isset($_POST['notice_id']) ) ? sanitize_key($_POST['notice_id']) : '') {
|
58 |
-
|
59 |
-
update_user_meta(get_current_user_id(), $notice_id, true);
|
60 |
-
|
61 |
-
wp_send_json($notice_id);
|
62 |
-
}
|
63 |
-
|
64 |
-
wp_die();
|
65 |
-
}
|
66 |
-
|
67 |
-
function add_notices() {
|
68 |
-
|
69 |
-
if (!get_transient('qlwcdc-first-rating') && !get_user_meta(get_current_user_id(), 'qlwcdc-user-rating', true)) {
|
70 |
-
?>
|
71 |
-
<div id="qlwcdc-admin-rating" class="qlwcdc-notice notice is-dismissible" data-notice_id="qlwcdc-user-rating">
|
72 |
-
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
73 |
-
<div class="notice-image">
|
74 |
-
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', QLWCDC_PLUGIN_FILE); ?>" alt="<?php echo esc_html(QLWCDC_PLUGIN_NAME); ?>>">
|
75 |
-
</div>
|
76 |
-
<div class="notice-content" style="margin-left: 15px;">
|
77 |
-
<p>
|
78 |
-
<?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout'), QLWCDC_PLUGIN_NAME); ?>
|
79 |
-
<br/>
|
80 |
-
<?php esc_html_e('Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'woocommerce-direct-checkout'); ?>
|
81 |
-
</p>
|
82 |
-
<a href="<?php echo esc_url(QLWCDC_REVIEW_URL); ?>" class="button-primary" target="_blank">
|
83 |
-
<?php esc_html_e('Yes, of course!', 'woocommerce-direct-checkout'); ?>
|
84 |
-
</a>
|
85 |
-
<a href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
86 |
-
<?php esc_html_e('Report a bug', 'woocommerce-direct-checkout'); ?>
|
87 |
-
</a>
|
88 |
-
</div>
|
89 |
-
</div>
|
90 |
-
</div>
|
91 |
-
<script>
|
92 |
-
(function ($) {
|
93 |
-
$('.qlwcdc-notice').on('click', '.notice-dismiss', function (e) {
|
94 |
-
e.preventDefault();
|
95 |
-
var notice_id = $(e.delegateTarget).data('notice_id');
|
96 |
-
$.ajax({
|
97 |
-
type: 'POST',
|
98 |
-
url: ajaxurl,
|
99 |
-
data: {
|
100 |
-
notice_id: notice_id,
|
101 |
-
action: 'qlwcdc_dismiss_notice',
|
102 |
-
},
|
103 |
-
success: function (response) {
|
104 |
-
console.log(response);
|
105 |
-
},
|
106 |
-
});
|
107 |
-
});
|
108 |
-
})(jQuery);
|
109 |
-
</script>
|
110 |
-
<?php
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
function get_product_option($product_id = null, $meta_key = null, $default = null) {
|
115 |
-
|
116 |
-
if (!$meta_key) {
|
117 |
-
return null;
|
118 |
-
}
|
119 |
-
|
120 |
-
if ($product_id && metadata_exists('post', $product_id, $meta_key)) {
|
121 |
-
return get_post_meta($product_id, $meta_key, true);
|
122 |
-
}
|
123 |
-
|
124 |
-
return get_option($meta_key, $default);
|
125 |
-
}
|
126 |
-
|
127 |
-
function add_action_links($links) {
|
128 |
-
|
129 |
-
$links[] = '<a target="_blank" href="' . QLWCDC_PURCHASE_URL . '">' . esc_html__('Premium', 'woocommerce-direct-checkout') . '</a>';
|
130 |
-
$links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(QLWCDC_DOMAIN)) . '">' . esc_html__('Settings', 'woocommerce-direct-checkout') . '</a>';
|
131 |
-
|
132 |
-
return $links;
|
133 |
-
}
|
134 |
-
|
135 |
-
function add_sections($sections = array()) {
|
136 |
-
|
137 |
-
global $current_section;
|
138 |
-
|
139 |
-
$sections = apply_filters('qlwcdc_add_sections', array());
|
140 |
-
|
141 |
-
echo '<ul class="subsubsub">';
|
142 |
-
|
143 |
-
$array_keys = array_keys($sections);
|
144 |
-
|
145 |
-
foreach ($sections as $id => $label) {
|
146 |
-
echo '<li><a href="' . admin_url('admin.php?page=wc-settings&tab=qlwcdc§ion=' . sanitize_title($id)) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end($array_keys) == $id ? '' : '|' ) . ' </li>';
|
147 |
-
}
|
148 |
-
|
149 |
-
echo '</ul><br class="clear" />';
|
150 |
-
}
|
151 |
-
|
152 |
-
function add_tab($settings_tabs) {
|
153 |
-
$settings_tabs[QLWCDC_DOMAIN] = __('Direct Checkout', 'woocommerce-direct-checkout');
|
154 |
-
return $settings_tabs;
|
155 |
-
}
|
156 |
-
|
157 |
-
function add_settings() {
|
158 |
-
woocommerce_admin_fields($this->get_settings());
|
159 |
-
}
|
160 |
-
|
161 |
-
function save_settings() {
|
162 |
-
woocommerce_update_options($this->get_settings());
|
163 |
-
}
|
164 |
-
|
165 |
-
function get_settings() {
|
166 |
-
|
167 |
-
$fields = apply_filters('qlwcdc_add_fields', array());
|
168 |
-
|
169 |
-
return $fields;
|
170 |
-
}
|
171 |
-
|
172 |
-
function add_frontend_scripts() {
|
173 |
-
wp_enqueue_style(QLWCDC_DOMAIN, plugins_url('/assets/qlwcdc.min.css', QLWCDC_PLUGIN_FILE), null, QLWCDC_PLUGIN_VERSION, 'all');
|
174 |
-
wp_enqueue_script(QLWCDC_DOMAIN, plugins_url('/assets/qlwcdc.min.js', QLWCDC_PLUGIN_FILE), array('jquery'), QLWCDC_PLUGIN_VERSION, true);
|
175 |
-
wp_localize_script(QLWCDC_DOMAIN, QLWCDC_DOMAIN, array(
|
176 |
-
'nonce' => wp_create_nonce(QLWCDC_DOMAIN),
|
177 |
-
//'queried_object_id' => get_queried_object_id(),
|
178 |
-
//'add_product_cart' => $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart', 'no'),
|
179 |
-
'delay' => 200,
|
180 |
-
'timeout' => null)
|
181 |
-
);
|
182 |
-
}
|
183 |
-
|
184 |
-
function remove_premium() {
|
185 |
-
?>
|
186 |
-
<script>
|
187 |
-
(function ($) {
|
188 |
-
'use strict';
|
189 |
-
$(window).on('load', function (e) {
|
190 |
-
$('#qlwcdc_options').css({'opacity': '0.5', 'pointer-events': 'none'});
|
191 |
-
$('label[for=qlwcdc_add_checkout_cart]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
192 |
-
$('label[for=qlwcdc_add_checkout_cart_fields]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
193 |
-
$('label[for=qlwcdc_add_checkout_cart_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
194 |
-
$('label[for=qlwcdc_remove_checkout_columns]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
195 |
-
$('label[for=qlwcdc_remove_checkout_coupon_form]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
196 |
-
$('label[for=qlwcdc_remove_order_details_address]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
197 |
-
$('label[for=qlwcdc_add_product_quick_purchase]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
198 |
-
$('label[for=qlwcdc_add_product_quick_purchase_to]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
199 |
-
$('label[for=qlwcdc_add_product_quick_purchase_qty]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
200 |
-
$('label[for=qlwcdc_add_product_quick_purchase_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
201 |
-
$('label[for=qlwcdc_add_product_quick_purchase_text]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
202 |
-
$('label[for=qlwcdc_add_product_default_attributes]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
203 |
-
$('label[for=qlwcdc_add_archive_quick_view]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
204 |
-
});
|
205 |
-
}(jQuery));
|
206 |
-
</script>
|
207 |
-
<?php
|
208 |
-
}
|
209 |
-
|
210 |
-
function add_footer_js() {
|
211 |
-
?>
|
212 |
-
<script>
|
213 |
-
(function ($) {
|
214 |
-
'use strict';
|
215 |
-
$(window).on('load', function (e) {
|
216 |
-
// General
|
217 |
-
// -----------------------------------------------------------------
|
218 |
-
$('select#qlwcdc_add_to_cart_redirect_page').change(function () {
|
219 |
-
if ('url' === $(this).val() && 'yes' == $('select#qlwcdc_add_to_cart_redirect').val()) {
|
220 |
-
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr, p').fadeIn();
|
221 |
-
} else {
|
222 |
-
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
223 |
-
}
|
224 |
-
});
|
225 |
-
$('select#qlwcdc_add_to_cart_redirect').change(function () {
|
226 |
-
if ('yes' === $(this).val()) {
|
227 |
-
$('select#qlwcdc_add_to_cart_redirect_page').change();
|
228 |
-
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr, p').fadeIn();
|
229 |
-
} else {
|
230 |
-
$('select#qlwcdc_add_to_cart_redirect_page').change();
|
231 |
-
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
232 |
-
}
|
233 |
-
}).change();
|
234 |
-
$('select#qlwcdc_add_to_cart_redirect_page').change(function () {
|
235 |
-
if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_to_cart').val()) {
|
236 |
-
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr, p').fadeIn();
|
237 |
-
} else {
|
238 |
-
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
239 |
-
}
|
240 |
-
});
|
241 |
-
$('select#qlwcdc_add_to_cart').change(function () {
|
242 |
-
if ('ajax' === $(this).val()) {
|
243 |
-
$('select#qlwcdc_add_to_cart_ajax_button').closest('tr, p').fadeIn();
|
244 |
-
$('select#qlwcdc_add_to_cart_ajax_message').closest('tr, p').fadeIn();
|
245 |
-
} else {
|
246 |
-
$('select#qlwcdc_add_to_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
247 |
-
$('select#qlwcdc_add_to_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
248 |
-
}
|
249 |
-
if ('redirect' === $(this).val()) {
|
250 |
-
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr, p').fadeIn();
|
251 |
-
} else {
|
252 |
-
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
253 |
-
}
|
254 |
-
$('select#qlwcdc_add_to_cart_redirect_page').change();
|
255 |
-
}).change();
|
256 |
-
// Archive
|
257 |
-
// -----------------------------------------------------------------
|
258 |
-
/*$('select#qlwcdc_add_archive_cart_redirect_page').change(function () {
|
259 |
-
if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_archive_cart').val()) {
|
260 |
-
$('input#qlwcdc_add_archive_cart_redirect_url').closest('tr, p').fadeIn();
|
261 |
-
} else {
|
262 |
-
$('input#qlwcdc_add_archive_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
263 |
-
}
|
264 |
-
});
|
265 |
-
$('select#qlwcdc_add_archive_cart').change(function () {
|
266 |
-
if ('ajax' === $(this).val()) {
|
267 |
-
$('select#qlwcdc_add_archive_cart_ajax_button').closest('tr, p').fadeIn();
|
268 |
-
$('select#qlwcdc_add_archive_cart_ajax_message').closest('tr, p').fadeIn();
|
269 |
-
} else {
|
270 |
-
$('select#qlwcdc_add_archive_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
271 |
-
$('select#qlwcdc_add_archive_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
272 |
-
}
|
273 |
-
if ('redirect' === $(this).val()) {
|
274 |
-
$('select#qlwcdc_add_archive_cart_redirect_page').closest('tr, p').fadeIn();
|
275 |
-
} else {
|
276 |
-
$('select#qlwcdc_add_archive_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
277 |
-
}
|
278 |
-
$('select#qlwcdc_add_archive_cart_redirect_page').change();
|
279 |
-
}).change();*/
|
280 |
-
$('select#qlwcdc_add_archive_text').change(function () {
|
281 |
-
if ('yes' === $(this).val()) {
|
282 |
-
$('select#qlwcdc_add_archive_text_in').closest('tr, p').fadeIn();
|
283 |
-
$('input#qlwcdc_add_archive_text_content').closest('tr, p').fadeIn();
|
284 |
-
} else {
|
285 |
-
$('select#qlwcdc_add_archive_text_in').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
286 |
-
$('input#qlwcdc_add_archive_text_content').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
287 |
-
}
|
288 |
-
}).change();
|
289 |
-
// Product
|
290 |
-
// -----------------------------------------------------------------
|
291 |
-
/*$('select#qlwcdc_add_product_cart_redirect_page').change(function () {
|
292 |
-
if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_product_cart').val()) {
|
293 |
-
$('input#qlwcdc_add_product_cart_redirect_url').closest('tr, p').fadeIn();
|
294 |
-
} else {
|
295 |
-
$('input#qlwcdc_add_product_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
296 |
-
}
|
297 |
-
});
|
298 |
-
$('select#qlwcdc_add_product_cart').change(function () {
|
299 |
-
if ('ajax' === $(this).val()) {
|
300 |
-
$('select#qlwcdc_add_product_cart_ajax_button').closest('tr, p').fadeIn();
|
301 |
-
$('select#qlwcdc_add_product_cart_ajax_message').closest('tr, p').fadeIn();
|
302 |
-
} else {
|
303 |
-
$('select#qlwcdc_add_product_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
304 |
-
$('select#qlwcdc_add_product_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
305 |
-
}
|
306 |
-
if ('redirect' === $(this).val()) {
|
307 |
-
$('select#qlwcdc_add_product_cart_redirect_page').closest('tr, p').fadeIn();
|
308 |
-
} else {
|
309 |
-
$('select#qlwcdc_add_product_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
310 |
-
}
|
311 |
-
$('select#qlwcdc_add_product_cart_redirect_page').change();
|
312 |
-
}).change();*/
|
313 |
-
$('select#qlwcdc_add_product_quick_purchase').change(function () {
|
314 |
-
if ('yes' === $(this).val()) {
|
315 |
-
$('select#qlwcdc_add_product_quick_purchase_to').closest('tr, p').fadeIn();
|
316 |
-
$('input#qlwcdc_add_product_quick_purchase_class').closest('tr, p').fadeIn();
|
317 |
-
$('input#qlwcdc_add_product_quick_purchase_text').closest('tr, p').fadeIn();
|
318 |
-
} else {
|
319 |
-
$('select#qlwcdc_add_product_quick_purchase_to').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
320 |
-
$('input#qlwcdc_add_product_quick_purchase_class').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
321 |
-
$('input#qlwcdc_add_product_quick_purchase_text').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
322 |
-
}
|
323 |
-
}).change();
|
324 |
-
$('select#qlwcdc_add_product_text').change(function () {
|
325 |
-
if ('yes' === $(this).val()) {
|
326 |
-
$('input#qlwcdc_add_product_text_content').closest('tr, p').fadeIn();
|
327 |
-
} else {
|
328 |
-
$('input#qlwcdc_add_product_text_content').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
329 |
-
}
|
330 |
-
}).change();
|
331 |
-
// Checkout
|
332 |
-
// -----------------------------------------------------------------
|
333 |
-
$('select#qlwcdc_add_checkout_cart').change(function () {
|
334 |
-
if ('yes' === $(this).val()) {
|
335 |
-
$('select#qlwcdc_add_checkout_cart_fields').closest('tr, p').fadeIn();
|
336 |
-
$('input#qlwcdc_add_checkout_cart_class').closest('tr, p').fadeIn();
|
337 |
-
} else {
|
338 |
-
$('select#qlwcdc_add_checkout_cart_fields').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
339 |
-
$('input#qlwcdc_add_checkout_cart_class').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
340 |
-
}
|
341 |
-
}).change();
|
342 |
-
});
|
343 |
-
}(jQuery));
|
344 |
-
</script>
|
345 |
-
<?php
|
346 |
-
}
|
347 |
-
|
348 |
-
function add_menu_page() {
|
349 |
-
add_submenu_page('woocommerce', esc_html__('Direct Checkout', 'woocommerce-direct-checkout'), esc_html__('Direct Checkout', 'woocommerce-direct-checkout'), 'manage_options', admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(QLWCDC_DOMAIN)));
|
350 |
-
}
|
351 |
-
|
352 |
-
/* function woocommerce_cart_redirect_after_add($val) {
|
353 |
-
return 'no';
|
354 |
-
} */
|
355 |
-
|
356 |
-
function languages() {
|
357 |
-
load_plugin_textdomain('woocommerce-direct-checkout', false, dirname(plugin_basename(__FILE__)) . '/languages/');
|
358 |
-
}
|
359 |
-
|
360 |
-
function includes() {
|
361 |
-
require_once('includes/general.php');
|
362 |
-
require_once('includes/archives.php');
|
363 |
-
require_once('includes/products.php');
|
364 |
-
require_once('includes/checkout.php');
|
365 |
-
require_once('includes/purchase.php');
|
366 |
-
}
|
367 |
-
|
368 |
-
function init() {
|
369 |
-
add_action('wp_ajax_qlwcdc_dismiss_notice', array($this, 'ajax_dismiss_notice'));
|
370 |
-
add_action('wp_enqueue_scripts', array($this, 'add_frontend_scripts'));
|
371 |
-
add_action('admin_notices', array($this, 'add_notices'));
|
372 |
-
add_action('admin_menu', array(&$this, 'add_menu_page'));
|
373 |
-
add_action('admin_footer', array($this, 'remove_premium'));
|
374 |
-
add_action('admin_footer', array($this, 'add_footer_js'));
|
375 |
-
add_filter('woocommerce_settings_tabs_array', array($this, 'add_tab'), 50);
|
376 |
-
add_filter('woocommerce_sections_qlwcdc', array($this, 'add_sections'));
|
377 |
-
add_action('woocommerce_sections_qlwcdc', array($this, 'add_settings'));
|
378 |
-
add_action('woocommerce_settings_save_qlwcdc', array($this, 'save_settings'));
|
379 |
-
//add_filter('option_woocommerce_cart_redirect_after_add', array($this, 'woocommerce_cart_redirect_after_add'));
|
380 |
-
add_filter('plugin_action_links_' . plugin_basename(QLWCDC_PLUGIN_FILE), array($this, 'add_action_links'));
|
381 |
-
}
|
382 |
-
|
383 |
-
public static function do_import() {
|
384 |
-
|
385 |
-
global $wpdb;
|
386 |
-
|
387 |
-
if (!get_option('qlwcdc_wcd_imported2')) {
|
388 |
-
|
389 |
-
if (get_option('direct_checkout_pro_enabled', get_option('direct_checkout_enabled'))) {
|
390 |
-
|
391 |
-
$url = get_option('direct_checkout_pro_cart_redirect_url', get_option('direct_checkout_cart_redirect_url'));
|
392 |
-
|
393 |
-
if ($url === wc_get_cart_url()) {
|
394 |
-
$val = 'cart';
|
395 |
-
} elseif (filter_var($url, FILTER_VALIDATE_URL) !== false && $url != wc_get_checkout_url()) {
|
396 |
-
$val = 'url';
|
397 |
-
} else {
|
398 |
-
$val = 'checkout';
|
399 |
-
}
|
400 |
-
|
401 |
-
/* add_option('qlwcdc_add_product_cart', 'redirect');
|
402 |
-
add_option('qlwcdc_add_product_cart_redirect_page', $val);
|
403 |
-
add_option('qlwcdc_add_product_cart_redirect_url', $url);
|
404 |
-
|
405 |
-
add_option('qlwcdc_add_archive_cart', 'redirect');
|
406 |
-
add_option('qlwcdc_add_archive_cart_redirect_page', $val);
|
407 |
-
add_option('qlwcdc_add_archive_cart_redirect_url', $url); */
|
408 |
-
|
409 |
-
add_option('qlwcdc_add_to_cart', 'redirect');
|
410 |
-
add_option('qlwcdc_add_to_cart_redirect_page', $val);
|
411 |
-
add_option('qlwcdc_add_to_cart_redirect_url', $url);
|
412 |
-
}
|
413 |
-
|
414 |
-
if ($text = get_option('direct_checkout_cart_button_text', get_option('direct_checkout_cart_button_text'))) {
|
415 |
-
add_option('qlwcdc_add_product_text', 'yes');
|
416 |
-
add_option('qlwcdc_add_product_text_content', $text);
|
417 |
-
add_option('qlwcdc_add_archive_text', 'yes');
|
418 |
-
add_option('qlwcdc_add_archive_text_content', $text);
|
419 |
-
add_option('qlwcdc_add_archive_text_in', array(
|
420 |
-
'simple',
|
421 |
-
'grouped',
|
422 |
-
'virtual',
|
423 |
-
'variable',
|
424 |
-
'downloadable'
|
425 |
-
));
|
426 |
-
}
|
427 |
-
|
428 |
-
if (count($keys = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s", '_direct_checkout_pro_enabled')))) {
|
429 |
-
foreach ($keys as $key) {
|
430 |
-
if ($key->meta_value == 'yes') {
|
431 |
-
if ($text = get_post_meta($key->post_id, '_direct_checkout_pro_cart_button_text', true)) {
|
432 |
-
add_post_meta($key->post_id, 'qlwcdc_add_product_text', 'yes', true);
|
433 |
-
add_post_meta($key->post_id, 'qlwcdc_add_product_text_content', $text, true);
|
434 |
-
}
|
435 |
-
}
|
436 |
-
}
|
437 |
-
}
|
438 |
-
|
439 |
-
delete_option('qlwcdc_wcd_imported');
|
440 |
-
update_option('qlwcdc_wcd_imported2', true);
|
441 |
-
}
|
442 |
-
}
|
443 |
-
|
444 |
-
public static function do_activation() {
|
445 |
-
|
446 |
-
set_transient('qlwcdc-first-rating', true, MONTH_IN_SECONDS);
|
447 |
-
|
448 |
-
if ('yes' === get_option('woocommerce_cart_redirect_after_add')) {
|
449 |
-
add_option('qlwcdc_add_to_cart', 'redirect');
|
450 |
-
add_option('qlwcdc_add_to_cart_redirect_page', 'cart');
|
451 |
-
/* add_option('qlwcdc_add_product_cart', 'redirect');
|
452 |
-
add_option('qlwcdc_add_product_cart_redirect_page', 'cart');
|
453 |
-
add_option('qlwcdc_add_archive_cart', 'redirect');
|
454 |
-
add_option('qlwcdc_add_archive_cart_redirect_page', 'cart'); */
|
455 |
-
}
|
456 |
-
|
457 |
-
/* if ('yes' === get_option('woocommerce_enable_ajax_add_to_cart')) {
|
458 |
-
add_option('qlwcdc_add_archive_cart', 'ajax');
|
459 |
-
} */
|
460 |
-
}
|
461 |
-
|
462 |
-
public static function instance() {
|
463 |
-
if (!isset(self::$instance)) {
|
464 |
-
self::$instance = new self();
|
465 |
-
self::$instance->init();
|
466 |
-
self::$instance->includes();
|
467 |
-
self::$instance->languages();
|
468 |
-
}
|
469 |
-
return self::$instance;
|
470 |
-
}
|
471 |
-
|
472 |
-
}
|
473 |
-
|
474 |
-
add_action('wp_loaded', array('QLWCDC', 'do_import'));
|
475 |
-
add_action('plugins_loaded', array('QLWCDC', 'instance'));
|
476 |
-
|
477 |
-
register_activation_hook(QLWCDC_PLUGIN_FILE, array('QLWCDC', 'do_activation'));
|
478 |
-
}
|
479 |
-
|
480 |
-
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: WooCommerce Direct Checkout
|
4 |
+
* Description: Simplifies the checkout process to improve your sales rate.
|
5 |
+
* Version: 2.1.2
|
6 |
+
* Author: QuadLayers
|
7 |
+
* Author URI: https://www.quadlayers.com
|
8 |
+
* Copyright: 2019 QuadLayers (https://www.quadlayers.com)
|
9 |
+
* Text Domain: woocommerce-direct-checkout
|
10 |
+
*/
|
11 |
+
|
12 |
+
if (!defined('ABSPATH')) {
|
13 |
+
die('-1');
|
14 |
+
}
|
15 |
+
if (!defined('QLWCDC_PLUGIN_NAME')) {
|
16 |
+
define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
|
17 |
+
}
|
18 |
+
if (!defined('QLWCDC_PLUGIN_VERSION')) {
|
19 |
+
define('QLWCDC_PLUGIN_VERSION', '2.1.2');
|
20 |
+
}
|
21 |
+
if (!defined('QLWCDC_PLUGIN_FILE')) {
|
22 |
+
define('QLWCDC_PLUGIN_FILE', __FILE__);
|
23 |
+
}
|
24 |
+
if (!defined('QLWCDC_PLUGIN_DIR')) {
|
25 |
+
define('QLWCDC_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
|
26 |
+
}
|
27 |
+
if (!defined('QLWCDC_DOMAIN')) {
|
28 |
+
define('QLWCDC_DOMAIN', 'qlwcdc');
|
29 |
+
}
|
30 |
+
if (!defined('QLWCDC_WORDPRESS_URL')) {
|
31 |
+
define('QLWCDC_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-direct-checkout/');
|
32 |
+
}
|
33 |
+
if (!defined('QLWCDC_REVIEW_URL')) {
|
34 |
+
define('QLWCDC_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-direct-checkout/reviews/?filter=5#new-post');
|
35 |
+
}
|
36 |
+
if (!defined('QLWCDC_DEMO_URL')) {
|
37 |
+
define('QLWCDC_DEMO_URL', 'https://quadlayers.com/portfolio/woocommerce-direct-checkout/?utm_source=qlwcdc_admin');
|
38 |
+
}
|
39 |
+
if (!defined('QLWCDC_PURCHASE_URL')) {
|
40 |
+
define('QLWCDC_PURCHASE_URL', QLWCDC_DEMO_URL);
|
41 |
+
}
|
42 |
+
if (!defined('QLWCDC_SUPPORT_URL')) {
|
43 |
+
define('QLWCDC_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qlwcdc_admin');
|
44 |
+
}
|
45 |
+
if (!defined('QLWCDC_GROUP_URL')) {
|
46 |
+
define('QLWCDC_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
|
47 |
+
}
|
48 |
+
|
49 |
+
if (!class_exists('QLWCDC')) {
|
50 |
+
|
51 |
+
class QLWCDC {
|
52 |
+
|
53 |
+
protected static $instance;
|
54 |
+
|
55 |
+
function ajax_dismiss_notice() {
|
56 |
+
|
57 |
+
if ($notice_id = ( isset($_POST['notice_id']) ) ? sanitize_key($_POST['notice_id']) : '') {
|
58 |
+
|
59 |
+
update_user_meta(get_current_user_id(), $notice_id, true);
|
60 |
+
|
61 |
+
wp_send_json($notice_id);
|
62 |
+
}
|
63 |
+
|
64 |
+
wp_die();
|
65 |
+
}
|
66 |
+
|
67 |
+
function add_notices() {
|
68 |
+
|
69 |
+
if (!get_transient('qlwcdc-first-rating') && !get_user_meta(get_current_user_id(), 'qlwcdc-user-rating', true)) {
|
70 |
+
?>
|
71 |
+
<div id="qlwcdc-admin-rating" class="qlwcdc-notice notice is-dismissible" data-notice_id="qlwcdc-user-rating">
|
72 |
+
<div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
|
73 |
+
<div class="notice-image">
|
74 |
+
<img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', QLWCDC_PLUGIN_FILE); ?>" alt="<?php echo esc_html(QLWCDC_PLUGIN_NAME); ?>>">
|
75 |
+
</div>
|
76 |
+
<div class="notice-content" style="margin-left: 15px;">
|
77 |
+
<p>
|
78 |
+
<?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout'), QLWCDC_PLUGIN_NAME); ?>
|
79 |
+
<br/>
|
80 |
+
<?php esc_html_e('Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'woocommerce-direct-checkout'); ?>
|
81 |
+
</p>
|
82 |
+
<a href="<?php echo esc_url(QLWCDC_REVIEW_URL); ?>" class="button-primary" target="_blank">
|
83 |
+
<?php esc_html_e('Yes, of course!', 'woocommerce-direct-checkout'); ?>
|
84 |
+
</a>
|
85 |
+
<a href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
86 |
+
<?php esc_html_e('Report a bug', 'woocommerce-direct-checkout'); ?>
|
87 |
+
</a>
|
88 |
+
</div>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
<script>
|
92 |
+
(function ($) {
|
93 |
+
$('.qlwcdc-notice').on('click', '.notice-dismiss', function (e) {
|
94 |
+
e.preventDefault();
|
95 |
+
var notice_id = $(e.delegateTarget).data('notice_id');
|
96 |
+
$.ajax({
|
97 |
+
type: 'POST',
|
98 |
+
url: ajaxurl,
|
99 |
+
data: {
|
100 |
+
notice_id: notice_id,
|
101 |
+
action: 'qlwcdc_dismiss_notice',
|
102 |
+
},
|
103 |
+
success: function (response) {
|
104 |
+
console.log(response);
|
105 |
+
},
|
106 |
+
});
|
107 |
+
});
|
108 |
+
})(jQuery);
|
109 |
+
</script>
|
110 |
+
<?php
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
function get_product_option($product_id = null, $meta_key = null, $default = null) {
|
115 |
+
|
116 |
+
if (!$meta_key) {
|
117 |
+
return null;
|
118 |
+
}
|
119 |
+
|
120 |
+
if ($product_id && metadata_exists('post', $product_id, $meta_key)) {
|
121 |
+
return get_post_meta($product_id, $meta_key, true);
|
122 |
+
}
|
123 |
+
|
124 |
+
return get_option($meta_key, $default);
|
125 |
+
}
|
126 |
+
|
127 |
+
function add_action_links($links) {
|
128 |
+
|
129 |
+
$links[] = '<a target="_blank" href="' . QLWCDC_PURCHASE_URL . '">' . esc_html__('Premium', 'woocommerce-direct-checkout') . '</a>';
|
130 |
+
$links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(QLWCDC_DOMAIN)) . '">' . esc_html__('Settings', 'woocommerce-direct-checkout') . '</a>';
|
131 |
+
|
132 |
+
return $links;
|
133 |
+
}
|
134 |
+
|
135 |
+
function add_sections($sections = array()) {
|
136 |
+
|
137 |
+
global $current_section;
|
138 |
+
|
139 |
+
$sections = apply_filters('qlwcdc_add_sections', array());
|
140 |
+
|
141 |
+
echo '<ul class="subsubsub">';
|
142 |
+
|
143 |
+
$array_keys = array_keys($sections);
|
144 |
+
|
145 |
+
foreach ($sections as $id => $label) {
|
146 |
+
echo '<li><a href="' . admin_url('admin.php?page=wc-settings&tab=qlwcdc§ion=' . sanitize_title($id)) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end($array_keys) == $id ? '' : '|' ) . ' </li>';
|
147 |
+
}
|
148 |
+
|
149 |
+
echo '</ul><br class="clear" />';
|
150 |
+
}
|
151 |
+
|
152 |
+
function add_tab($settings_tabs) {
|
153 |
+
$settings_tabs[QLWCDC_DOMAIN] = __('Direct Checkout', 'woocommerce-direct-checkout');
|
154 |
+
return $settings_tabs;
|
155 |
+
}
|
156 |
+
|
157 |
+
function add_settings() {
|
158 |
+
woocommerce_admin_fields($this->get_settings());
|
159 |
+
}
|
160 |
+
|
161 |
+
function save_settings() {
|
162 |
+
woocommerce_update_options($this->get_settings());
|
163 |
+
}
|
164 |
+
|
165 |
+
function get_settings() {
|
166 |
+
|
167 |
+
$fields = apply_filters('qlwcdc_add_fields', array());
|
168 |
+
|
169 |
+
return $fields;
|
170 |
+
}
|
171 |
+
|
172 |
+
function add_frontend_scripts() {
|
173 |
+
wp_enqueue_style(QLWCDC_DOMAIN, plugins_url('/assets/qlwcdc.min.css', QLWCDC_PLUGIN_FILE), null, QLWCDC_PLUGIN_VERSION, 'all');
|
174 |
+
wp_enqueue_script(QLWCDC_DOMAIN, plugins_url('/assets/qlwcdc.min.js', QLWCDC_PLUGIN_FILE), array('jquery'), QLWCDC_PLUGIN_VERSION, true);
|
175 |
+
wp_localize_script(QLWCDC_DOMAIN, QLWCDC_DOMAIN, array(
|
176 |
+
'nonce' => wp_create_nonce(QLWCDC_DOMAIN),
|
177 |
+
//'queried_object_id' => get_queried_object_id(),
|
178 |
+
//'add_product_cart' => $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart', 'no'),
|
179 |
+
'delay' => 200,
|
180 |
+
'timeout' => null)
|
181 |
+
);
|
182 |
+
}
|
183 |
+
|
184 |
+
function remove_premium() {
|
185 |
+
?>
|
186 |
+
<script>
|
187 |
+
(function ($) {
|
188 |
+
'use strict';
|
189 |
+
$(window).on('load', function (e) {
|
190 |
+
$('#qlwcdc_options').css({'opacity': '0.5', 'pointer-events': 'none'});
|
191 |
+
$('label[for=qlwcdc_add_checkout_cart]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
192 |
+
$('label[for=qlwcdc_add_checkout_cart_fields]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
193 |
+
$('label[for=qlwcdc_add_checkout_cart_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
194 |
+
$('label[for=qlwcdc_remove_checkout_columns]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
195 |
+
$('label[for=qlwcdc_remove_checkout_coupon_form]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
196 |
+
$('label[for=qlwcdc_remove_order_details_address]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
197 |
+
$('label[for=qlwcdc_add_product_quick_purchase]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
198 |
+
$('label[for=qlwcdc_add_product_quick_purchase_to]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
199 |
+
$('label[for=qlwcdc_add_product_quick_purchase_qty]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
200 |
+
$('label[for=qlwcdc_add_product_quick_purchase_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
201 |
+
$('label[for=qlwcdc_add_product_quick_purchase_text]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
202 |
+
$('label[for=qlwcdc_add_product_default_attributes]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
203 |
+
$('label[for=qlwcdc_add_archive_quick_view]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
204 |
+
});
|
205 |
+
}(jQuery));
|
206 |
+
</script>
|
207 |
+
<?php
|
208 |
+
}
|
209 |
+
|
210 |
+
function add_footer_js() {
|
211 |
+
?>
|
212 |
+
<script>
|
213 |
+
(function ($) {
|
214 |
+
'use strict';
|
215 |
+
$(window).on('load', function (e) {
|
216 |
+
// General
|
217 |
+
// -----------------------------------------------------------------
|
218 |
+
$('select#qlwcdc_add_to_cart_redirect_page').change(function () {
|
219 |
+
if ('url' === $(this).val() && 'yes' == $('select#qlwcdc_add_to_cart_redirect').val()) {
|
220 |
+
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr, p').fadeIn();
|
221 |
+
} else {
|
222 |
+
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
223 |
+
}
|
224 |
+
});
|
225 |
+
$('select#qlwcdc_add_to_cart_redirect').change(function () {
|
226 |
+
if ('yes' === $(this).val()) {
|
227 |
+
$('select#qlwcdc_add_to_cart_redirect_page').change();
|
228 |
+
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr, p').fadeIn();
|
229 |
+
} else {
|
230 |
+
$('select#qlwcdc_add_to_cart_redirect_page').change();
|
231 |
+
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
232 |
+
}
|
233 |
+
}).change();
|
234 |
+
$('select#qlwcdc_add_to_cart_redirect_page').change(function () {
|
235 |
+
if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_to_cart').val()) {
|
236 |
+
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr, p').fadeIn();
|
237 |
+
} else {
|
238 |
+
$('input#qlwcdc_add_to_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
239 |
+
}
|
240 |
+
});
|
241 |
+
$('select#qlwcdc_add_to_cart').change(function () {
|
242 |
+
if ('ajax' === $(this).val()) {
|
243 |
+
$('select#qlwcdc_add_to_cart_ajax_button').closest('tr, p').fadeIn();
|
244 |
+
$('select#qlwcdc_add_to_cart_ajax_message').closest('tr, p').fadeIn();
|
245 |
+
} else {
|
246 |
+
$('select#qlwcdc_add_to_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
247 |
+
$('select#qlwcdc_add_to_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
248 |
+
}
|
249 |
+
if ('redirect' === $(this).val()) {
|
250 |
+
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr, p').fadeIn();
|
251 |
+
} else {
|
252 |
+
$('select#qlwcdc_add_to_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
253 |
+
}
|
254 |
+
$('select#qlwcdc_add_to_cart_redirect_page').change();
|
255 |
+
}).change();
|
256 |
+
// Archive
|
257 |
+
// -----------------------------------------------------------------
|
258 |
+
/*$('select#qlwcdc_add_archive_cart_redirect_page').change(function () {
|
259 |
+
if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_archive_cart').val()) {
|
260 |
+
$('input#qlwcdc_add_archive_cart_redirect_url').closest('tr, p').fadeIn();
|
261 |
+
} else {
|
262 |
+
$('input#qlwcdc_add_archive_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
263 |
+
}
|
264 |
+
});
|
265 |
+
$('select#qlwcdc_add_archive_cart').change(function () {
|
266 |
+
if ('ajax' === $(this).val()) {
|
267 |
+
$('select#qlwcdc_add_archive_cart_ajax_button').closest('tr, p').fadeIn();
|
268 |
+
$('select#qlwcdc_add_archive_cart_ajax_message').closest('tr, p').fadeIn();
|
269 |
+
} else {
|
270 |
+
$('select#qlwcdc_add_archive_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
271 |
+
$('select#qlwcdc_add_archive_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
272 |
+
}
|
273 |
+
if ('redirect' === $(this).val()) {
|
274 |
+
$('select#qlwcdc_add_archive_cart_redirect_page').closest('tr, p').fadeIn();
|
275 |
+
} else {
|
276 |
+
$('select#qlwcdc_add_archive_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
277 |
+
}
|
278 |
+
$('select#qlwcdc_add_archive_cart_redirect_page').change();
|
279 |
+
}).change();*/
|
280 |
+
$('select#qlwcdc_add_archive_text').change(function () {
|
281 |
+
if ('yes' === $(this).val()) {
|
282 |
+
$('select#qlwcdc_add_archive_text_in').closest('tr, p').fadeIn();
|
283 |
+
$('input#qlwcdc_add_archive_text_content').closest('tr, p').fadeIn();
|
284 |
+
} else {
|
285 |
+
$('select#qlwcdc_add_archive_text_in').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
286 |
+
$('input#qlwcdc_add_archive_text_content').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
287 |
+
}
|
288 |
+
}).change();
|
289 |
+
// Product
|
290 |
+
// -----------------------------------------------------------------
|
291 |
+
/*$('select#qlwcdc_add_product_cart_redirect_page').change(function () {
|
292 |
+
if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_product_cart').val()) {
|
293 |
+
$('input#qlwcdc_add_product_cart_redirect_url').closest('tr, p').fadeIn();
|
294 |
+
} else {
|
295 |
+
$('input#qlwcdc_add_product_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
296 |
+
}
|
297 |
+
});
|
298 |
+
$('select#qlwcdc_add_product_cart').change(function () {
|
299 |
+
if ('ajax' === $(this).val()) {
|
300 |
+
$('select#qlwcdc_add_product_cart_ajax_button').closest('tr, p').fadeIn();
|
301 |
+
$('select#qlwcdc_add_product_cart_ajax_message').closest('tr, p').fadeIn();
|
302 |
+
} else {
|
303 |
+
$('select#qlwcdc_add_product_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
304 |
+
$('select#qlwcdc_add_product_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
305 |
+
}
|
306 |
+
if ('redirect' === $(this).val()) {
|
307 |
+
$('select#qlwcdc_add_product_cart_redirect_page').closest('tr, p').fadeIn();
|
308 |
+
} else {
|
309 |
+
$('select#qlwcdc_add_product_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
310 |
+
}
|
311 |
+
$('select#qlwcdc_add_product_cart_redirect_page').change();
|
312 |
+
}).change();*/
|
313 |
+
$('select#qlwcdc_add_product_quick_purchase').change(function () {
|
314 |
+
if ('yes' === $(this).val()) {
|
315 |
+
$('select#qlwcdc_add_product_quick_purchase_to').closest('tr, p').fadeIn();
|
316 |
+
$('input#qlwcdc_add_product_quick_purchase_class').closest('tr, p').fadeIn();
|
317 |
+
$('input#qlwcdc_add_product_quick_purchase_text').closest('tr, p').fadeIn();
|
318 |
+
} else {
|
319 |
+
$('select#qlwcdc_add_product_quick_purchase_to').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
320 |
+
$('input#qlwcdc_add_product_quick_purchase_class').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
321 |
+
$('input#qlwcdc_add_product_quick_purchase_text').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
322 |
+
}
|
323 |
+
}).change();
|
324 |
+
$('select#qlwcdc_add_product_text').change(function () {
|
325 |
+
if ('yes' === $(this).val()) {
|
326 |
+
$('input#qlwcdc_add_product_text_content').closest('tr, p').fadeIn();
|
327 |
+
} else {
|
328 |
+
$('input#qlwcdc_add_product_text_content').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
329 |
+
}
|
330 |
+
}).change();
|
331 |
+
// Checkout
|
332 |
+
// -----------------------------------------------------------------
|
333 |
+
$('select#qlwcdc_add_checkout_cart').change(function () {
|
334 |
+
if ('yes' === $(this).val()) {
|
335 |
+
$('select#qlwcdc_add_checkout_cart_fields').closest('tr, p').fadeIn();
|
336 |
+
$('input#qlwcdc_add_checkout_cart_class').closest('tr, p').fadeIn();
|
337 |
+
} else {
|
338 |
+
$('select#qlwcdc_add_checkout_cart_fields').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
339 |
+
$('input#qlwcdc_add_checkout_cart_class').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
|
340 |
+
}
|
341 |
+
}).change();
|
342 |
+
});
|
343 |
+
}(jQuery));
|
344 |
+
</script>
|
345 |
+
<?php
|
346 |
+
}
|
347 |
+
|
348 |
+
function add_menu_page() {
|
349 |
+
add_submenu_page('woocommerce', esc_html__('Direct Checkout', 'woocommerce-direct-checkout'), esc_html__('Direct Checkout', 'woocommerce-direct-checkout'), 'manage_options', admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(QLWCDC_DOMAIN)));
|
350 |
+
}
|
351 |
+
|
352 |
+
/* function woocommerce_cart_redirect_after_add($val) {
|
353 |
+
return 'no';
|
354 |
+
} */
|
355 |
+
|
356 |
+
function languages() {
|
357 |
+
load_plugin_textdomain('woocommerce-direct-checkout', false, dirname(plugin_basename(__FILE__)) . '/languages/');
|
358 |
+
}
|
359 |
+
|
360 |
+
function includes() {
|
361 |
+
require_once('includes/general.php');
|
362 |
+
require_once('includes/archives.php');
|
363 |
+
require_once('includes/products.php');
|
364 |
+
require_once('includes/checkout.php');
|
365 |
+
require_once('includes/purchase.php');
|
366 |
+
}
|
367 |
+
|
368 |
+
function init() {
|
369 |
+
add_action('wp_ajax_qlwcdc_dismiss_notice', array($this, 'ajax_dismiss_notice'));
|
370 |
+
add_action('wp_enqueue_scripts', array($this, 'add_frontend_scripts'));
|
371 |
+
add_action('admin_notices', array($this, 'add_notices'));
|
372 |
+
add_action('admin_menu', array(&$this, 'add_menu_page'));
|
373 |
+
add_action('admin_footer', array($this, 'remove_premium'));
|
374 |
+
add_action('admin_footer', array($this, 'add_footer_js'));
|
375 |
+
add_filter('woocommerce_settings_tabs_array', array($this, 'add_tab'), 50);
|
376 |
+
add_filter('woocommerce_sections_qlwcdc', array($this, 'add_sections'));
|
377 |
+
add_action('woocommerce_sections_qlwcdc', array($this, 'add_settings'));
|
378 |
+
add_action('woocommerce_settings_save_qlwcdc', array($this, 'save_settings'));
|
379 |
+
//add_filter('option_woocommerce_cart_redirect_after_add', array($this, 'woocommerce_cart_redirect_after_add'));
|
380 |
+
add_filter('plugin_action_links_' . plugin_basename(QLWCDC_PLUGIN_FILE), array($this, 'add_action_links'));
|
381 |
+
}
|
382 |
+
|
383 |
+
public static function do_import() {
|
384 |
+
|
385 |
+
global $wpdb;
|
386 |
+
|
387 |
+
if (!get_option('qlwcdc_wcd_imported2')) {
|
388 |
+
|
389 |
+
if (get_option('direct_checkout_pro_enabled', get_option('direct_checkout_enabled'))) {
|
390 |
+
|
391 |
+
$url = get_option('direct_checkout_pro_cart_redirect_url', get_option('direct_checkout_cart_redirect_url'));
|
392 |
+
|
393 |
+
if ($url === wc_get_cart_url()) {
|
394 |
+
$val = 'cart';
|
395 |
+
} elseif (filter_var($url, FILTER_VALIDATE_URL) !== false && $url != wc_get_checkout_url()) {
|
396 |
+
$val = 'url';
|
397 |
+
} else {
|
398 |
+
$val = 'checkout';
|
399 |
+
}
|
400 |
+
|
401 |
+
/* add_option('qlwcdc_add_product_cart', 'redirect');
|
402 |
+
add_option('qlwcdc_add_product_cart_redirect_page', $val);
|
403 |
+
add_option('qlwcdc_add_product_cart_redirect_url', $url);
|
404 |
+
|
405 |
+
add_option('qlwcdc_add_archive_cart', 'redirect');
|
406 |
+
add_option('qlwcdc_add_archive_cart_redirect_page', $val);
|
407 |
+
add_option('qlwcdc_add_archive_cart_redirect_url', $url); */
|
408 |
+
|
409 |
+
add_option('qlwcdc_add_to_cart', 'redirect');
|
410 |
+
add_option('qlwcdc_add_to_cart_redirect_page', $val);
|
411 |
+
add_option('qlwcdc_add_to_cart_redirect_url', $url);
|
412 |
+
}
|
413 |
+
|
414 |
+
if ($text = get_option('direct_checkout_cart_button_text', get_option('direct_checkout_cart_button_text'))) {
|
415 |
+
add_option('qlwcdc_add_product_text', 'yes');
|
416 |
+
add_option('qlwcdc_add_product_text_content', $text);
|
417 |
+
add_option('qlwcdc_add_archive_text', 'yes');
|
418 |
+
add_option('qlwcdc_add_archive_text_content', $text);
|
419 |
+
add_option('qlwcdc_add_archive_text_in', array(
|
420 |
+
'simple',
|
421 |
+
'grouped',
|
422 |
+
'virtual',
|
423 |
+
'variable',
|
424 |
+
'downloadable'
|
425 |
+
));
|
426 |
+
}
|
427 |
+
|
428 |
+
if (count($keys = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s", '_direct_checkout_pro_enabled')))) {
|
429 |
+
foreach ($keys as $key) {
|
430 |
+
if ($key->meta_value == 'yes') {
|
431 |
+
if ($text = get_post_meta($key->post_id, '_direct_checkout_pro_cart_button_text', true)) {
|
432 |
+
add_post_meta($key->post_id, 'qlwcdc_add_product_text', 'yes', true);
|
433 |
+
add_post_meta($key->post_id, 'qlwcdc_add_product_text_content', $text, true);
|
434 |
+
}
|
435 |
+
}
|
436 |
+
}
|
437 |
+
}
|
438 |
+
|
439 |
+
delete_option('qlwcdc_wcd_imported');
|
440 |
+
update_option('qlwcdc_wcd_imported2', true);
|
441 |
+
}
|
442 |
+
}
|
443 |
+
|
444 |
+
public static function do_activation() {
|
445 |
+
|
446 |
+
set_transient('qlwcdc-first-rating', true, MONTH_IN_SECONDS);
|
447 |
+
|
448 |
+
if ('yes' === get_option('woocommerce_cart_redirect_after_add')) {
|
449 |
+
add_option('qlwcdc_add_to_cart', 'redirect');
|
450 |
+
add_option('qlwcdc_add_to_cart_redirect_page', 'cart');
|
451 |
+
/* add_option('qlwcdc_add_product_cart', 'redirect');
|
452 |
+
add_option('qlwcdc_add_product_cart_redirect_page', 'cart');
|
453 |
+
add_option('qlwcdc_add_archive_cart', 'redirect');
|
454 |
+
add_option('qlwcdc_add_archive_cart_redirect_page', 'cart'); */
|
455 |
+
}
|
456 |
+
|
457 |
+
/* if ('yes' === get_option('woocommerce_enable_ajax_add_to_cart')) {
|
458 |
+
add_option('qlwcdc_add_archive_cart', 'ajax');
|
459 |
+
} */
|
460 |
+
}
|
461 |
+
|
462 |
+
public static function instance() {
|
463 |
+
if (!isset(self::$instance)) {
|
464 |
+
self::$instance = new self();
|
465 |
+
self::$instance->init();
|
466 |
+
self::$instance->includes();
|
467 |
+
self::$instance->languages();
|
468 |
+
}
|
469 |
+
return self::$instance;
|
470 |
+
}
|
471 |
+
|
472 |
+
}
|
473 |
+
|
474 |
+
add_action('wp_loaded', array('QLWCDC', 'do_import'));
|
475 |
+
add_action('plugins_loaded', array('QLWCDC', 'instance'));
|
476 |
+
|
477 |
+
register_activation_hook(QLWCDC_PLUGIN_FILE, array('QLWCDC', 'do_activation'));
|
478 |
+
}
|
479 |
+
|
480 |
+
|