WooCommerce Direct Checkout - Version 2.1.0

Version Description

  • Fix: language textdomain
  • Fix: woocommerce quick view modal css
Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WooCommerce Direct Checkout
Version 2.1.0
Comparing to
See all releases

Code changes from version 1.1.2 to 2.1.0

.project DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <projectDescription>
3
- <name>woocommerce-direct-checkout</name>
4
- <comment></comment>
5
- <projects>
6
- </projects>
7
- <buildSpec>
8
- </buildSpec>
9
- <natures>
10
- </natures>
11
- </projectDescription>
 
 
 
 
 
 
 
 
 
 
 
assets/img/checkout.png ADDED
Binary file
assets/img/logo.jpg ADDED
Binary file
assets/img/modal.png ADDED
Binary file
assets/qlwcdc.css ADDED
@@ -0,0 +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
+ }
assets/qlwcdc.js ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+
3
+ var timeout;
4
+ var delay = 1000;
5
+ var is_blocked = function ($node) {
6
+ return $node.is('.processing') || $node.parents('.processing').length;
7
+ };
8
+ var block = function ($node) {
9
+ if (!is_blocked($node)) {
10
+ $node.addClass('processing').block({
11
+ message: null,
12
+ overlayCSS: {
13
+ background: '#fff',
14
+ opacity: 0.6
15
+ }
16
+ });
17
+ }
18
+ };
19
+ var unblock = function ($node) {
20
+ $node.removeClass('processing').unblock();
21
+ };
22
+ $(document).on('click', '.qlwcdc_quick_view', function (e) {
23
+ e.stopPropagation();
24
+ e.preventDefault();
25
+ var product_id = $(this).data('product_id'),
26
+ $modal = $('#qlwcdc_quick_view_modal');
27
+ if (product_id && woocommerce_params.ajax_url) {
28
+
29
+ $.ajax({
30
+ type: 'post',
31
+ url: woocommerce_params.ajax_url,
32
+ data: {
33
+ action: 'qlwcdc_quick_view_modal',
34
+ nonce: qlwcdc.nonce,
35
+ product_id: product_id
36
+ },
37
+ complete: function (response) {
38
+
39
+ $modal.addClass('opening');
40
+ setTimeout(function () {
41
+ $modal.addClass('open');
42
+ $modal.removeClass('opening');
43
+ }, 50);
44
+ },
45
+ success: function (response) {
46
+
47
+ var $response = $(response);
48
+ $response.find('.woocommerce-product-gallery').each(function () {
49
+ $(this).wc_product_gallery();
50
+ });
51
+ $response.on('click', '.close', function (e) {
52
+ $modal.addClass('closing');
53
+ setTimeout(function () {
54
+ $modal.removeClass('open');
55
+ $modal.removeClass('closing');
56
+ }, 600);
57
+ });
58
+ $modal.find('.modal-content').replaceWith($response)
59
+ }
60
+ });
61
+ }
62
+
63
+ return false;
64
+ });
65
+
66
+ $('#qlwcdc_quick_view_modal').on('click', function (e) {
67
+ var $modal = $(this);
68
+ if (!$modal.closest('.modal-body').length) {
69
+ $modal.addClass('closing');
70
+ setTimeout(function () {
71
+ $modal.removeClass('open');
72
+ $modal.removeClass('closing');
73
+ }, 600);
74
+ }
75
+ });
76
+
77
+ $(document).on('click', '.qlwcdc_quick_purchase', function (e) {
78
+ e.preventDefault();
79
+
80
+ var $button = $(this),
81
+ $form = $button.closest('form.cart'),
82
+ product_id = $form.find('[name=add-to-cart]').val() || 0,
83
+ variation_id = $form.find('[name=variation_id]').val() || 0,
84
+ quantity = $form.find('[name=quantity]').val() || 1;
85
+
86
+ $(this).attr('href', function (i, h) {
87
+ if (h.indexOf('?') != -1) {
88
+ $(this).attr('href', $(this).attr('href') + '&add-to-cart=' + product_id);
89
+ } else {
90
+ $(this).attr('href', $(this).attr('href') + '?add-to-cart=' + product_id);
91
+ }
92
+ });
93
+
94
+ if (variation_id) {
95
+ $(this).attr('href', $(this).attr('href') + '&variation_id=' + variation_id);
96
+ }
97
+
98
+ if (quantity) {
99
+ $(this).attr('href', $(this).attr('href') + '&quantity=' + quantity);
100
+ }
101
+
102
+ //console.log($(this).attr('href'));
103
+
104
+ window.location = $(this).attr('href');
105
+
106
+ return false;
107
+
108
+ });
109
+
110
+ /*$(document).on('click', '.single_add_to_cart_button:not(.qlwcdc_quick_purchase):not(.disabled)', function (e) {
111
+
112
+ if (qlwcdc.add_product_cart !== 'no') {
113
+
114
+ var $thisbutton = $(this),
115
+ $form = $thisbutton.closest('form.cart'),
116
+ quantity = $form.find('input[name=quantity]').val() || 1,
117
+ product_id = $form.find('input[name=variation_id]').val() || $thisbutton.val();
118
+
119
+ if (product_id) {
120
+
121
+ e.preventDefault();
122
+
123
+ var data = {
124
+ 'product_id': product_id,
125
+ 'quantity': quantity
126
+ };
127
+
128
+ $(document.body).trigger('adding_to_cart', [$thisbutton, data]);
129
+
130
+ $.ajax({
131
+ type: 'POST',
132
+ url: woocommerce_params.wc_ajax_url.toString().replace('%%endpoint%%', 'add_to_cart'),
133
+ data: data,
134
+ beforeSend: function (response) {
135
+ $thisbutton.removeClass('added').addClass('loading');
136
+ },
137
+ complete: function (response) {
138
+ $thisbutton.addClass('added').removeClass('loading');
139
+ },
140
+ success: function (response) {
141
+
142
+ //if (response.error & response.product_url) {
143
+ // window.location = response.product_url;
144
+ // return;
145
+ //}
146
+
147
+ //console.log('test 2');
148
+ //console.log(data);
149
+ //console.log(response.cart_hash);
150
+
151
+ $(document.body).trigger('added_to_cart', [response.fragments, response.cart_hash, $thisbutton]);
152
+ },
153
+ });
154
+
155
+ return false;
156
+
157
+ }
158
+ }
159
+
160
+ });*/
161
+
162
+ /*$(document).bind('added_to_cart_message', function (e, cart) {
163
+
164
+ $.ajax({
165
+ type: 'POST',
166
+ url: woocommerce_params.ajax_url,
167
+ data: {
168
+ action: 'qlwcdc_add_product_cart_ajax_message',
169
+ 'queried_object_id': qlwcdc.queried_object_id,
170
+ nonce: qlwcdc.nonce
171
+ },
172
+ beforeSend: function (response) {
173
+ block($('.woocommerce-notices-wrapper:first'));
174
+ },
175
+ complete: function (response) {
176
+ unblock($('.woocommerce-notices-wrapper:first'));
177
+ },
178
+ success: function (response) {
179
+ console.log(response);
180
+ if (response) {
181
+ $('.woocommerce-notices-wrapper:first').replaceWith(response);
182
+ }
183
+ },
184
+ });
185
+ });*/
186
+
187
+ $(document).on('keyup', '#qlwcdc_order_coupon_code', function (e) {
188
+
189
+ var $form = $(this),
190
+ $coupon = $(this).find('input[name="coupon_code"]'),
191
+ coupon_code = $coupon.val();
192
+
193
+ if (timeout) {
194
+ clearTimeout(timeout);
195
+ }
196
+
197
+ if (!coupon_code) {
198
+ return;
199
+ }
200
+
201
+ timeout = setTimeout(function () {
202
+
203
+ if ($form.is('.processing')) {
204
+ return false;
205
+ }
206
+
207
+ $form.addClass('processing').block({
208
+ message: null,
209
+ overlayCSS: {
210
+ background: '#fff',
211
+ opacity: 0.6
212
+ }
213
+ });
214
+
215
+ var data = {
216
+ security: wc_checkout_params.apply_coupon_nonce,
217
+ coupon_code: coupon_code
218
+ };
219
+
220
+ $.ajax({
221
+ type: 'POST',
222
+ url: wc_checkout_params.wc_ajax_url.toString().replace('%%endpoint%%', 'apply_coupon'),
223
+ data: data,
224
+ success: function (code) {
225
+ $form.removeClass('processing').unblock();
226
+ if (code) {
227
+ $coupon.before($(code).hide().fadeIn());
228
+ setTimeout(function () {
229
+ $(document.body).trigger('update_checkout', {update_shipping_method: false});
230
+ }, delay * 2);
231
+ }
232
+ },
233
+ dataType: 'html'
234
+ });
235
+ return false;
236
+ }, delay);
237
+ });
238
+
239
+ $('#order_review').on('change', 'input.qty', function (e) {
240
+ e.preventDefault();
241
+ var $qty = $(this);
242
+ setTimeout(function () {
243
+
244
+ var hash = $qty.attr('name').replace(/cart\[([\w]+)\]\[qty\]/g, "$1"),
245
+ qty = parseFloat($qty.val());
246
+ $.ajax({
247
+ type: 'post',
248
+ url: woocommerce_params.ajax_url,
249
+ data: {
250
+ action: 'qlwcdc_update_cart',
251
+ nonce: qlwcdc.nonce,
252
+ hash: hash,
253
+ quantity: qty
254
+ },
255
+ beforeSend: function (response) {
256
+ block($('#order_review'));
257
+ },
258
+ complete: function (response) {
259
+ unblock($('#order_review'));
260
+ },
261
+ success: function (response) {
262
+ if (response) {
263
+ $('#order_review').html($(response).html());
264
+ }
265
+ },
266
+ });
267
+ }, 400);
268
+ });
269
+ $('#order_review').on('click', 'a.remove', function (e) {
270
+ e.preventDefault();
271
+ var hash = $(this).data('cart_item_key');
272
+ $.ajax({
273
+ type: 'post',
274
+ url: woocommerce_params.ajax_url,
275
+ data: {
276
+ action: 'qlwcdc_update_cart',
277
+ nonce: qlwcdc.nonce,
278
+ quantity: 0,
279
+ hash: hash
280
+ },
281
+ beforeSend: function (response) {
282
+ block($('#order_review'));
283
+ },
284
+ complete: function (response) {
285
+ unblock($('#order_review'));
286
+ },
287
+ success: function (response) {
288
+ if (response) {
289
+ $('#order_review').html($(response).html());
290
+ }
291
+ },
292
+ });
293
+ });
294
+ })(jQuery);
assets/qlwcdc.min.css ADDED
@@ -0,0 +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}
assets/qlwcdc.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ (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("click",".qlwcdc_quick_purchase",function(l){l.preventDefault();var j=d(this),g=j.closest("form.cart"),h=g.find("[name=add-to-cart]").val()||0,i=g.find("[name=variation_id]").val()||0,k=g.find("[name=quantity]").val()||1;d(this).attr("href",function(m,n){if(n.indexOf("?")!=-1){d(this).attr("href",d(this).attr("href")+"&add-to-cart="+h)}else{d(this).attr("href",d(this).attr("href")+"?add-to-cart="+h)}});if(i){d(this).attr("href",d(this).attr("href")+"&variation_id="+i)}if(k){d(this).attr("href",d(this).attr("href")+"&quantity="+k)}window.location=d(this).attr("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);
images/direct-checkout-pro-version.png DELETED
Binary file
includes/archives.php ADDED
@@ -0,0 +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
+ }
includes/checkout.php ADDED
@@ -0,0 +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
+ }
includes/general.php ADDED
@@ -0,0 +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
+ }
includes/products.php ADDED
@@ -0,0 +1,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 init() {
479
+ //add_action('wp_ajax_qlwcdc_add_product_cart_ajax_message', array($this, 'add_product_cart_ajax_message'));
480
+ //add_action('wp_ajax_nopriv_qlwcdc_add_product_cart_ajax_message', array($this, 'add_product_cart_ajax_message'));
481
+ add_filter('qlwcdc_add_sections', array($this, 'add_section'));
482
+ add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
483
+ //add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
484
+ //add_filter('woocommerce_before_single_product', array($this, 'added_to_cart_button'));
485
+ //add_filter('woocommerce_after_single_product', array($this, 'added_to_cart_message_js'));
486
+ add_filter('woocommerce_product_data_tabs', array($this, 'add_product_tabs'));
487
+ add_action('woocommerce_product_data_panels', array($this, 'add_product_tab_content'));
488
+ add_filter('woocommerce_product_single_add_to_cart_text', array($this, 'add_product_text'), 10, 2);
489
+ //add_filter('add_to_cart_class', array($this, 'add_to_cart_class'));
490
+ //add_action('storefront_content_top', array($this, 'add_storefront_notices'));
491
+ }
492
+
493
+ public static function instance() {
494
+ if (!isset(self::$instance)) {
495
+ self::$instance = new self();
496
+ self::$instance->init();
497
+ }
498
+ return self::$instance;
499
+ }
500
+
501
+ }
502
+
503
+ QLWCDC_Products::instance();
504
+ }
includes/purchase.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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="two-col">
28
+ <div class="col">
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">
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">
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">
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="col">
59
+ <img src="<?php echo plugins_url('/assets/img/checkout.png', QLWCDC_PLUGIN_FILE); ?>">
60
+ </div>
61
+ </div>
62
+ <br/>
63
+ <br/>
64
+ <div class="two-col">
65
+ <div class="welcome-header">
66
+ <h1><?php esc_html_e('Quick purchase', 'woocommerce-direct-checkout'); ?></h1>
67
+ <div class="about-description">
68
+ <?php esc_html_e('The Ajax add to cart option allows you to include single products, variable, grouped and virtual products in the cart without the need to reload the entire site each time.', 'woocommerce-direct-checkout'); ?>
69
+ </div>
70
+ <hr/>
71
+ </div>
72
+ </div>
73
+ <div class="two-col">
74
+ <div class="col">
75
+ <div class="feature-section">
76
+ <h3><?php esc_html_e('Checkout redirect', 'woocommerce-direct-checkout'); ?></h3>
77
+ <p>
78
+ <?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'); ?>
79
+ </p>
80
+ </div>
81
+ <div class="feature-section">
82
+ <h3><?php esc_html_e('Quick purchase on single products', 'woocommerce-direct-checkout'); ?></h3>
83
+ <p>
84
+ <?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'); ?>
85
+ </p>
86
+ </div>
87
+ <div class="feature-section">
88
+ <h3><?php esc_html_e('Quick view in product archives', 'woocommerce-direct-checkout'); ?></h3>
89
+ <p>
90
+ <?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'); ?>
91
+ </p>
92
+ <p>
93
+ <?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'); ?>
94
+ </p>
95
+ </div>
96
+ </div>
97
+ <div class="col">
98
+ <br/>
99
+ <img src="<?php echo plugins_url('/assets/img/modal.png', QLWCDC_PLUGIN_FILE); ?>">
100
+ </div>
101
+ </div>
102
+ </div>
103
+ <?php
104
+ }
105
+ }
106
+
107
+ function init() {
108
+ add_filter('qlwcdc_add_sections', array($this, 'add_section'));
109
+ add_action('woocommerce_sections_qlwcdc', array($this, 'add_page'));
110
+ }
111
+
112
+ public static function instance() {
113
+ if (!isset(self::$instance)) {
114
+ self::$instance = new self();
115
+ self::$instance->init();
116
+ }
117
+ return self::$instance;
118
+ }
119
+
120
+ }
121
+
122
+ QLWCDC_Purchase::instance();
123
+ }
languages/wc-direct-checkout-en_GB.mo DELETED
Binary file
languages/wc-direct-checkout-en_GB.po DELETED
@@ -1,51 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WooCommerce Direct Checkout v1.0.0\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2013-07-10 15:54:14+0000\n"
7
- "Last-Translator: admin <terrytsang811@gmail.com>\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
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Poedit-Language: English\n"
14
- "X-Poedit-Country: UNITED KINGDOM\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
- "X-Poedit-Basepath: \n"
18
- "X-Poedit-Bookmarks: \n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Textdomain-Support: yes"
21
-
22
- #: wc-direct-checkout.php:113
23
- #@ wc-direct-checkout
24
- msgid "Direct Checkout"
25
- msgstr ""
26
-
27
- #: wc-direct-checkout.php:141
28
- #@ wc-direct-checkout
29
- msgid "You have saved WooCommerce Direct Checkout options."
30
- msgstr ""
31
-
32
- #: wc-direct-checkout.php:161
33
- #@ wc-direct-checkout
34
- msgid "Direct Checkout Options"
35
- msgstr ""
36
-
37
- #: wc-direct-checkout.php:177
38
- #@ wc-direct-checkout
39
- msgid "Enable"
40
- msgstr ""
41
-
42
- #: wc-direct-checkout.php:184
43
- #@ wc-direct-checkout
44
- msgid "Custom Add to Cart Text"
45
- msgstr ""
46
-
47
- #: wc-direct-checkout.php:194
48
- #@ wc-direct-checkout
49
- msgid "Save Options"
50
- msgstr ""
51
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/wc-direct-checkout-zh_CN.mo DELETED
Binary file
languages/wc-direct-checkout-zh_CN.po DELETED
@@ -1,51 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WooCommerce Direct Checkout v1.0.0\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2013-07-10 16:03:44+0000\n"
7
- "Last-Translator: admin <terrytsang811@gmail.com>\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
- "Plural-Forms: nplurals=2; plural=1;\n"
13
- "X-Poedit-Language: Chinese\n"
14
- "X-Poedit-Country: PEOPLE'S REPUBLIC OF CHINA\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
- "X-Poedit-Basepath: \n"
18
- "X-Poedit-Bookmarks: \n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Textdomain-Support: yes"
21
-
22
- #: wc-direct-checkout.php:113
23
- #@ wc-direct-checkout
24
- msgid "Direct Checkout"
25
- msgstr "直接结帐"
26
-
27
- #: wc-direct-checkout.php:141
28
- #@ wc-direct-checkout
29
- msgid "You have saved WooCommerce Direct Checkout options."
30
- msgstr "你成功储存直接结帐选项。"
31
-
32
- #: wc-direct-checkout.php:161
33
- #@ wc-direct-checkout
34
- msgid "Direct Checkout Options"
35
- msgstr "直接结帐选项"
36
-
37
- #: wc-direct-checkout.php:177
38
- #@ wc-direct-checkout
39
- msgid "Enable"
40
- msgstr "启用"
41
-
42
- #: wc-direct-checkout.php:184
43
- #@ wc-direct-checkout
44
- msgid "Custom Add to Cart Text"
45
- msgstr "自定义添加到购物车文字"
46
-
47
- #: wc-direct-checkout.php:194
48
- #@ wc-direct-checkout
49
- msgid "Save Options"
50
- msgstr "储存选项"
51
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/woocommerce-direct-checkout-es_ES.mo ADDED
Binary file
languages/woocommerce-direct-checkout-es_ES.po ADDED
@@ -0,0 +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 ""
languages/woocommerce-direct-checkout.pot ADDED
@@ -0,0 +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 ""
readme.txt CHANGED
@@ -1,137 +1,71 @@
1
- === Plugin Name ===
2
- Contributors: terrytsang, quadlayers
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=terry@terrytsang.com&item_name=Donation+for+TerryTsang+Wordpress+WebDev
4
- Plugin Name: WooCommerce Custom Direct Checkout
5
- Plugin URI: http://terrytsang.com/shop/shop/woocommerce-direct-checkout/
6
- Tags: woocommerce, custom fields, direct, checkout, e-commerce
7
- Requires at least: 3.0
8
  Tested up to: 5.1
9
- Stable tag: 1.1.3
10
- Version: 1.1.3
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
14
- You can skip shopping cart page and implement add to cart button redirect to checkout page or you can redirect to other existing page.
15
 
16
  == Description ==
17
 
18
- A WooCommerce plugin that aims to simplify the checkout process, leading to an immediate increase in sales.
19
 
20
- In WooCommerce Settings Panel, there will be a new submenu link called 'Direct Checkout' where you can:
21
 
22
- * Enabled / Disabled the direct checkout option
23
- * Add "Continue Shopping" button to product page
24
- * Change "Add to cart" to any text (Option to exclude external product)
25
- * Update "Redirect to Page" option
26
 
27
- = Features =
28
 
29
- * Implement add to cart button redirect to checkout page pattern
30
- * 2 languages available : English UK (en_GB) and Chinese (zh_CN)
31
 
32
- = IMPORTANT NOTES =
33
- * Do use POEdit and open 'wc-direct-checkout.pot' file and save the file as wc-direct-checkout-[language code].po, then put that into languages folder for this plugin.
34
- * Please uncheck the option "Enable AJAX add to cart buttons on archives" at WooCommerce > Settings > Catalog to make the rediection working without ajax.
35
 
36
- = GET PRO VERSION =
37
- * [WooCommerce Direct Checkout PRO](http://terrytsang.com/shop/shop/woocommerce-direct-checkout-pro/) - Added Per Product Setings and Additional Button.
38
 
39
- = In addition to these features, over 20 WooCommerce extensions are available: =
40
- * [Facebook Share Like Button](http://terrytsang.com/shop/shop/woocommerce-facebook-share-like-button/) - add Facebook Share and Like button at product page.
41
- * [Custom Checkout Options](http://terrytsang.com/shop/shop/woocommerce-custom-checkout-options/) - implement customization for entire checkout process.
42
- * [Social Buttons PRO](http://terrytsang.com/shop/shop/woocommerce-social-buttons-pro/) - additional 9 social share buttons where you can engage more audience.
43
- * [Extra Fee Option PRO](http://terrytsang.com/shop/shop/woocommerce-extra-fee-option-pro/) - add multiple extra fee for any order with multiple options.
44
- * [Custom Product Tabs](http://terrytsang.com/shop/shop/woocommerce-custom-product-tabs/) - add multiple tabs to WooCommerce product page.
45
- * [Facebook Social Plugins](http://terrytsang.com/shop/shop/woocommerce-facebook-social-plugins/) - implement Facebook Social Plugins that let the users liked, commented or shared your site's contents.
46
- * [Custom Payment Method](http://terrytsang.com/shop/shop/woocommerce-custom-payment-method/) - customise the custom payment method with flexible options.
47
- * [Custom Shipping Method](http://terrytsang.com/shop/shop/woocommerce-custom-shipping-method/) - define own settings for custom shipping method.
48
- * [Donation/Tip Checkout](http://terrytsang.com/shop/shop/woocommerce-donation-tip-checkout/) - add donation/tip amount option for their customers at WooCommerce checkout page.
49
- * [Product Badge](http://terrytsang.com/shop/shop/woocommerce-product-badge/) - add mulitple badges to the products.
50
- * [Facebook Connect Checkout](http://terrytsang.com/shop/shop/woocommerce-facebook-login-checkout/) - implement Facebook Login so that new customers can sign in woocommerce site by using their Facebook account.
51
- * [Product Catalog](http://terrytsang.com/shop/shop/woocommerce-product-catalog/) - turn WooCommerce into a product catalog with a few clicks.
52
- * [Coming Soon Product](http://terrytsang.com/shop/shop/woocommerce-coming-soon-product/) - show 'Coming Soon' default message and countdown clock for pre launch product
53
 
54
- and many more...
55
 
56
- = Free & Popular WooCommerce Bundle extensions: =
57
- * [WooCommerce Free Extensions Bundle](http://terrytsang.com/shop/shop/woocommerce-free-extensions-bundle/) - 5 free plugins in 1 download
58
- * [WooCommerce Popular Extensions Bundle](http://terrytsang.com/shop/shop/woocommerce-popular-extensions-bundle/) - 5 unlimited licenses premium plugins with only $99
59
 
60
- == Installation ==
61
 
62
- 1. Upload the entire *woocommerce-direct-checkout* folder to the */wp-content/plugins/* directory
63
- 2. Activate the plugin through the 'Plugins' menu in WordPress
64
- 3. Go to WooCommerce Settings panel at left sidebar menu and update the options at Tab *Direct Checkout* there.
65
- 4. That's it. You're ready to go and cheers!
66
 
67
- == Screenshots ==
68
-
69
- 1. [screenhot-1.png] Screenshot Admin WooCommerce Settings - Direct Checkout options
70
- 2. [screenhot-2.png] Screenshot Frontend WooCommerce - Catalog page
71
- 3. [screenhot-3.png] Screenshot Frontend WooCommerce - Product page
72
 
73
  == Changelog ==
74
 
75
- = 1.1.3 =
76
-
77
- * Tested up to WordPress v5.1.1
78
-
79
- = 1.1.1 =
80
-
81
- * Updated deprecated function from 'add_to_cart_redirect' to 'woocommerce_add_to_cart_redirect'
82
-
83
- = 1.1.0 =
84
-
85
- * Updated continue shopping button css
86
- * Updated pro version additional features
87
-
88
- = 1.0.10 =
89
-
90
- * Removed WooCommerce installation checking
91
-
92
- = 1.0.9 =
93
-
94
- * Fixed narrow form layout bugs
95
-
96
- = 1.0.8 =
97
-
98
- * Add Continue Shopping button at product page
99
- * Fixed missing variable warning
100
-
101
- = 1.0.7 =
102
-
103
- * Updated PRO version download link
104
-
105
- = 1.0.6 =
106
-
107
- * Added 'Exclude external product' checkbox for Custom Add to Cart Text option
108
-
109
- = 1.0.5 =
110
-
111
- * Updated "Add to cart" filter with WooCommere v2.1.x
112
- * Fixed table width problem for option settings page
113
-
114
- = 1.0.4 =
115
-
116
- * Added pro version link
117
-
118
- = 1.0.3 =
119
-
120
- * Updated reademe file for instruction and notes
121
 
 
 
122
 
123
- = 1.0.2 =
 
124
 
125
- * Update 'Redirect to Page' option
126
- * Updated table style for Firefox display bugs
127
 
128
- = 1.0.1 =
 
129
 
130
- * Add 'Redirect to Page' option, let user choose redirecting to any page after add to cart pressed
131
- * Updated wrong hyperlink
132
 
133
- = 1.0.0 =
 
134
 
135
- * Initial Release
136
- * Customize add to cart text and change add to cart function directly to checkout page
137
 
 
 
1
+ === WooCommerce Direct Checkout ===
2
+ 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.1
6
+ Stable tag: 2.1.0
 
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Simplifies the entire checkout process to improve your sales rate.
11
 
12
  == Description ==
13
 
14
+ [WooCommerce Direct Checkout](https://quadlayers.com/portfolio/woocommerce-direct-checkout/) allows you to simplifies the checkout process by skipping the shopping cart page. The “Add to cart” button is added in each product to redirect customers to the checkout page. This can encourage buyers to shop more and quickly process the transaction, which can lead to a possible increase in sales.
15
 
16
+ == Ajax add to cart ==
17
 
18
+ The Ajax add to cart option allows you to include single products, variable, grouped and virtual products in the cart without the need to reload the entire site each time.
 
 
 
19
 
20
+ == Speed checkout process ==
21
 
22
+ WooCommerce Direct Checkout aims to simplify the checkout process, leading to an immediate increase in sales. This plugin for WooCommerce allows you to redirect users to the checkout instead of cart page, change the text and link of the added to cart alert and include the ajax add to cart button in the products pages.
 
23
 
24
+ == Remove checkout fields ==
 
 
25
 
26
+ The checkout options allow you to easily remove the unnecessary fields to reduce the user spend completing those fields. Also WooCommerce Direct Checkot allows you to remove other unnecessary things in the checkout process like the order comments, shipping address, coupon form, policy text, and terms and conditions.
 
27
 
28
+ == One page checkout ==
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
+ In the premium version of WooCommerce Direct Checkot, we've included an incredible feature that includes a cart form in the checkout. This allows your users to edit the cart items directly in the checkout page, avoiding the need to force them to edit the order in the cart page.
31
 
32
+ == Quick purchase button ==
 
 
33
 
34
+ The premium version of WooCommerce Direct Checkot allows to include a quick purchase button in the single products page that redirects your users directly to the checkout page, avoiding the need to force them to add the products in the cart.
35
 
36
+ == Improvements ==
 
 
 
37
 
38
+ 1. Use less bandwidth
39
+ 2. Reduce server load
40
+ 3. Speed user experience
41
+ 4. Increase your sales!
 
42
 
43
  == Changelog ==
44
 
45
+ = 2.1.0 =
46
+ * Fix: language textdomain
47
+ * Fix: woocommerce quick view modal css
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
+ = 2.0.7 =
50
+ * Fix: woocommerce quick view modal class
51
 
52
+ = 2.0.6 =
53
+ * Fix: woocommerce quick purchase button
54
 
55
+ = 2.0.5 =
56
+ * Fix: woocommerce ajax add to cart for single products temporary removed
57
 
58
+ = 2.0.4 =
59
+ * Fix: woocommerce direct checkout old settings
60
 
61
+ = 2.0.3 =
62
+ * Fix: woocommerce quick view modal button
63
 
64
+ = 2.0.2 =
65
+ * Fix: woocommerce quick add to cart button
66
 
67
+ = 2.0.1 =
68
+ * Fix: woocommerce ajax add to cart on single products
69
 
70
+ = 2.0.0 =
71
+ * initial release of the woocommerce direct checkout by quadlayers
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
wc-direct-checkout.php CHANGED
@@ -1,379 +1,22 @@
1
- <?php
2
- /*
3
- Plugin Name: WooCommerce Direct Checkout
4
- Plugin URI: http://terrytsang.com/shop/shop/woocommerce-direct-checkout/
5
- Description: Allow you to implement direct checkout (skip cart page) for WooCommerce
6
- Version: 1.1.2
7
- Author: Terry Tsang
8
- Author URI: http://shop.terrytsang.com
9
- */
10
-
11
- /* Copyright 2012-2015 Terry Tsang (email: terrytsang811@gmail.com)
12
-
13
- This program is free software; you can redistribute it and/or modify
14
- it under the terms of the GNU General Public License as published by
15
- the Free Software Foundation; either version 2 of the License, or
16
- (at your option) any later version.
17
-
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU General Public License for more details.
22
-
23
- You should have received a copy of the GNU General Public License
24
- along with this program; if not, write to the Free Software
25
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
- */
27
-
28
- // Define plugin name
29
- define('wc_plugin_name_direct_checkout', 'WooCommerce Direct Checkout');
30
-
31
- // Define plugin version
32
- define('wc_version_direct_checkout', '1.1.3');
33
-
34
-
35
-
36
- if(!class_exists('WooCommerce_Direct_Checkout')){
37
- class WooCommerce_Direct_Checkout{
38
-
39
- public static $plugin_prefix;
40
- public static $plugin_url;
41
- public static $plugin_path;
42
- public static $plugin_basefile;
43
-
44
- /**
45
- * Gets things started by adding an action to initialize this plugin once
46
- * WooCommerce is known to be active and initialized
47
- */
48
- public function __construct(){
49
- load_plugin_textdomain('wc-direct-checkout', false, dirname(plugin_basename(__FILE__)) . '/languages/');
50
-
51
- WooCommerce_Direct_Checkout::$plugin_prefix = 'wc_direct_checkout_';
52
- WooCommerce_Direct_Checkout::$plugin_basefile = plugin_basename(__FILE__);
53
- WooCommerce_Direct_Checkout::$plugin_url = plugin_dir_url(WooCommerce_Direct_Checkout::$plugin_basefile);
54
- WooCommerce_Direct_Checkout::$plugin_path = trailingslashit(dirname(__FILE__));
55
-
56
- $this->textdomain = 'wc-direct-checkout';
57
-
58
- $this->options_direct_checkout = array(
59
- 'direct_checkout_enabled' => '',
60
- 'direct_checkout_cart_button_text' => '',
61
- 'direct_checkout_exclude_external' => '',
62
- 'direct_checkout_cart_redirect_url' => '',
63
- 'direct_checkout_continue_enabled' => ''
64
- );
65
-
66
- $this->saved_options_direct_checkout = array();
67
-
68
- add_action('woocommerce_init', array(&$this, 'init'));
69
- }
70
-
71
- /**
72
- * Initialize extension when WooCommerce is active
73
- */
74
- public function init(){
75
-
76
- //add menu link for the plugin (backend)
77
- add_action( 'admin_menu', array( &$this, 'add_menu_direct_checkout' ) );
78
-
79
- if(get_option('direct_checkout_enabled'))
80
- {
81
- //unset all related options to disabled / not active
82
- update_option('woocommerce_cart_redirect_after_add', 'no');
83
- update_option('woocommerce_enable_ajax_add_to_cart', 'no');
84
-
85
- add_filter('single_add_to_cart_text', array( &$this, 'custom_cart_button_text') );
86
- add_filter('add_to_cart_text', array( &$this, 'custom_cart_button_text') );
87
-
88
- add_filter('woocommerce_product_single_add_to_cart_text', array( &$this, 'custom_cart_button_text') );
89
- add_filter('woocommerce_product_add_to_cart_text', array( &$this, 'custom_cart_button_text') );
90
-
91
- add_filter('woocommerce_add_to_cart_redirect', array( &$this, 'custom_add_to_cart_redirect') );
92
-
93
- if(get_option('direct_checkout_continue_enabled'))
94
- add_action( 'woocommerce_after_add_to_cart_button', array( &$this, 'direct_checkout_continue_button') );
95
-
96
- }
97
- }
98
-
99
- /**
100
- * Set custom add to cart redirect
101
- */
102
- function custom_add_to_cart_redirect() {
103
- $direct_checkout_cart_redirect_url = get_option( 'direct_checkout_cart_redirect_url' );
104
-
105
- if($direct_checkout_cart_redirect_url != "")
106
- return $direct_checkout_cart_redirect_url; // Replace with the url of your choosing
107
- else
108
- return get_permalink(get_option('woocommerce_checkout_page_id'));
109
- }
110
-
111
- /**
112
- * Set continue shopping button for single product
113
- */
114
- function direct_checkout_continue_button() {
115
- global $woocommerce, $post, $product;
116
- global $wp_query;
117
-
118
- $postID = $wp_query->post->ID;
119
-
120
- $direct_checkout_continue_enabled = get_option( 'direct_checkout_continue_enabled' );
121
- $single_product_title = strip_tags($post->post_title);
122
-
123
- if($direct_checkout_continue_enabled == "1"){
124
- $additional_button_text = __( 'Continue Shopping', $this->textdomain );
125
- $additional_button_url = get_permalink(get_option('woocommerce_shop_page_id'));
126
- }
127
-
128
- $target_blank = $direct_checkout_continue_enabled ? '' : ' target="_blank"';
129
-
130
- if( $direct_checkout_continue_enabled ){
131
- $html_button = '<a href="'.$additional_button_url.'" title="'.$single_product_title.'" style="margin:5px 0" class="button alt"'.$target_blank.'>'.$additional_button_text.'</a>';
132
- echo $html_button;
133
- }
134
- }
135
-
136
- /**
137
- * Set custom add to cart text
138
- */
139
- function custom_cart_button_text() {
140
- global $post;
141
-
142
-
143
-
144
- $direct_checkout_cart_button_text = get_option( 'direct_checkout_cart_button_text' ) ? get_option( 'direct_checkout_cart_button_text' ) : "Add to cart";
145
- $direct_checkout_exclude_external = get_option( 'direct_checkout_exclude_external' );
146
-
147
- if($direct_checkout_exclude_external){
148
-
149
- if( function_exists('get_product') ){
150
- $product = get_product( $post->ID );
151
-
152
- if( !$product->is_type( 'external' ) && $direct_checkout_cart_button_text && $direct_checkout_cart_button_text != ""){
153
- return __($direct_checkout_cart_button_text, $this->textdomain);
154
- } else {
155
- $button_text = get_post_meta( $post->ID, '_button_text', true ) ? get_post_meta( $post->ID, '_button_text', true ) : 'Buy product';
156
- return __($button_text, $this->textdomain);
157
- }
158
- }
159
-
160
- } else {
161
- if($direct_checkout_cart_button_text && $direct_checkout_cart_button_text != "")
162
- return __($direct_checkout_cart_button_text, $this->textdomain);
163
- }
164
-
165
- }
166
-
167
- /**
168
- * Add a menu link to the woocommerce section menu
169
- */
170
- function add_menu_direct_checkout() {
171
- $wc_page = 'woocommerce';
172
- $comparable_settings_page = add_submenu_page( $wc_page , __( 'Direct Checkout', $this->textdomain ), __( 'Direct Checkout', $this->textdomain ), 'manage_options', 'wc-direct-checkout', array(
173
- &$this,
174
- 'settings_page_direct_checkout'
175
- ));
176
- }
177
-
178
- /**
179
- * Create the settings page content
180
- */
181
- public function settings_page_direct_checkout() {
182
-
183
- // If form was submitted
184
- if ( isset( $_POST['submitted'] ) )
185
- {
186
- check_admin_referer( $this->textdomain );
187
-
188
- $this->saved_options_direct_checkout['direct_checkout_enabled'] = ! isset( $_POST['direct_checkout_enabled'] ) ? '1' : $_POST['direct_checkout_enabled'];
189
- $this->saved_options_direct_checkout['direct_checkout_continue_enabled'] = ! isset( $_POST['direct_checkout_continue_enabled'] ) ? '1' : $_POST['direct_checkout_continue_enabled'];
190
- $this->saved_options_direct_checkout['direct_checkout_cart_button_text'] = ! isset( $_POST['direct_checkout_cart_button_text'] ) ? 'Add to cart' : $_POST['direct_checkout_cart_button_text'];
191
- $this->saved_options_direct_checkout['direct_checkout_exclude_external'] = ! isset( $_POST['direct_checkout_exclude_external'] ) ? '1' : $_POST['direct_checkout_exclude_external'];
192
- $this->saved_options_direct_checkout['direct_checkout_cart_redirect_url'] = ! isset( $_POST['direct_checkout_cart_redirect_url'] ) ? '' : $_POST['direct_checkout_cart_redirect_url'];
193
-
194
- foreach($this->options_direct_checkout as $field => $value)
195
- {
196
- $option_direct_checkout = get_option( $field );
197
-
198
- if($option_direct_checkout != $this->saved_options_direct_checkout[$field])
199
- update_option( $field, $this->saved_options_direct_checkout[$field] );
200
- }
201
-
202
- // Show message
203
- echo '<div id="message" class="updated fade"><p>' . __( 'You have saved WooCommerce Direct Checkout options.', $this->textdomain ) . '</p></div>';
204
- }
205
-
206
- $direct_checkout_enabled = get_option( 'direct_checkout_enabled' );
207
- $direct_checkout_continue_enabled = get_option( 'direct_checkout_continue_enabled' );
208
- $direct_checkout_cart_button_text = get_option( 'direct_checkout_cart_button_text' ) ? get_option( 'direct_checkout_cart_button_text' ) : 'Add to Cart';
209
- $direct_checkout_exclude_external = get_option( 'direct_checkout_exclude_external' );
210
- $direct_checkout_cart_redirect_url = get_option( 'direct_checkout_cart_redirect_url' );
211
-
212
- $checked_enabled = '';
213
- $checked_enabled_exclude = '';
214
- $checked_continue_enabled = '';
215
-
216
- if($direct_checkout_enabled)
217
- $checked_enabled = 'checked="checked"';
218
-
219
- if($direct_checkout_exclude_external)
220
- $checked_enabled_exclude = 'checked="checked"';
221
-
222
- if($direct_checkout_continue_enabled)
223
- $checked_continue_enabled = 'checked="checked"';
224
-
225
- $actionurl = $_SERVER['REQUEST_URI'];
226
- $nonce = wp_create_nonce( $this->textdomain );
227
-
228
-
229
- // Configuration Page
230
-
231
- ?>
232
- <div id="icon-options-general" class="icon32"></div>
233
- <h3><?php _e( 'Direct Checkout Options', $this->textdomain); ?></h3>
234
-
235
-
236
- <table style="width:90%;padding:5px;border-collapse:separate;border-spacing:5px;vertical-align:top;">
237
- <tr>
238
- <td colspan="2">Checking out is the most important and key part of placing an order online, and many users end up abandoning their order at the end. This plugin will simplify the checkout process, leading to an immediate increase in sales.</td>
239
- </tr>
240
- <tr>
241
- <td width="70%" style="vertical-align:top;">
242
- <form action="<?php echo $actionurl; ?>" method="post">
243
- <table>
244
- <tbody>
245
- <tr>
246
- <td colspan="2">
247
- <table class="widefat auto" cellspacing="2" cellpadding="5" border="0">
248
- <tr>
249
- <td width="30%"><?php _e( 'Enable', $this->textdomain ); ?></td>
250
- <td>
251
- <input class="checkbox" name="direct_checkout_enabled" id="direct_checkout_enabled" value="0" type="hidden">
252
- <input class="checkbox" name="direct_checkout_enabled" id="direct_checkout_enabled" value="1" type="checkbox" <?php echo $checked_enabled; ?>>
253
- </td>
254
- </tr>
255
- <tr>
256
- <td width="30%"><?php _e( 'Add Continue Shopping Button', $this->textdomain ); ?></td>
257
- <td>
258
- <input class="checkbox" name="direct_checkout_continue_enabled" id="direct_checkout_continue_enabled" value="0" type="hidden">
259
- <input class="checkbox" name="direct_checkout_continue_enabled" id="direct_checkout_continue_enabled" value="1" type="checkbox" <?php echo $checked_continue_enabled; ?>>
260
- </td>
261
- </tr>
262
- <tr>
263
- <td width="30%"><?php _e( 'Custom Add to Cart Text', $this->textdomain ); ?></td>
264
- <td>
265
- <input name="direct_checkout_cart_button_text" id="direct_checkout_cart_button_text" value="<?php echo $direct_checkout_cart_button_text; ?>" />
266
- <input class="checkbox" name="direct_checkout_exclude_external" id="direct_checkout_exclude_external" value="0" type="hidden">
267
- <input class="checkbox" name="direct_checkout_exclude_external" id="direct_checkout_exclude_external" value="1" type="checkbox" <?php echo $checked_enabled_exclude; ?> type="checkbox">&nbsp;<i>Exclude External Product</i>
268
- </td>
269
- </tr>
270
- <tr>
271
- <td width="30%"><?php _e( 'Redirect to Page', $this->textdomain ); ?><br /><span style="color:#ccc;"><?php _e( '(Default will be checkout page if not set)', $this->textdomain ); ?></span></td>
272
- <td>
273
- <select name="direct_checkout_cart_redirect_url">
274
- <option value=""><?php echo esc_attr( __( 'Select page' ) ); ?></option>
275
- <?php
276
- $pages = get_pages();
277
- foreach ( $pages as $page ) {
278
- if($direct_checkout_cart_redirect_url == get_permalink( $page->ID ))
279
- $option = '<option value="' . get_permalink( $page->ID ) . '" selected="selected">';
280
- else
281
- $option = '<option value="' . get_permalink( $page->ID ) . '">';
282
- $option .= $page->post_title;
283
- $option .= '</option>';
284
- echo $option;
285
- }
286
- ?>
287
- </select>
288
- </td>
289
- </tr>
290
- </table>
291
- </td>
292
- </tr>
293
- <tr>
294
- <td colspan=2">
295
- <input class="button-primary" type="submit" name="Save" value="<?php _e('Save Options', $this->textdomain); ?>" id="submitbutton" />
296
- <input type="hidden" name="submitted" value="1" />
297
- <input type="hidden" id="_wpnonce" name="_wpnonce" value="<?php echo $nonce; ?>" />
298
- </td>
299
- </tr>
300
- </tbody>
301
- </table>
302
- </form>
303
-
304
- </td>
305
-
306
- <td width="30%" style="background:#ececec;padding:10px 5px;" valign="top">
307
- <div style="float:left;width:200px;">
308
- <a href="https://twitter.com/terrytsang811" class="twitter-follow-button" data-show-count="false" data-lang="en">Follow @terrytsang811</a>
309
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
310
- </div>
311
- <div>
312
- <div id="fb-root"></div>
313
- <script>(function(d, s, id) {
314
- var js, fjs = d.getElementsByTagName(s)[0];
315
- if (d.getElementById(id)) return;
316
- js = d.createElement(s); js.id = id;
317
- js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=354404357988395";
318
- fjs.parentNode.insertBefore(js, fjs);
319
- }(document, 'script', 'facebook-jssdk'));</script>
320
- <div class="fb-like" data-href="http://wordpress.org/plugins/woocommerce-direct-checkout/" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div>
321
- </div>
322
- <p><b>WooCommerce Direct Checkout</b> is a FREE woocommerce plugin developed by <a href="http://shop.terrytsang.com" target="_blank" title="Terry Tsang - a PHP Developer and Wordpress Consultant">Terry Tsang</a>. This plugin aims to add direct checkout for WooCommerce.</p>
323
-
324
- <?php
325
- $get_pro_image = WooCommerce_Direct_Checkout::$plugin_url . '/images/direct-checkout-pro-version.png';
326
- ?>
327
- <div align="center"><a href="http://terrytsang.com/shop/shop/woocommerce-direct-checkout-pro/" target="_blank" title="WooCommerce Direct Checkout PRO"><img src="<?php echo $get_pro_image; ?>" border="0" /></a></div>
328
- <div aling="center"><i>PRO version additional features: Individual product override settings and additional button option.</i></div>
329
- <h3>Get More Plugins</h3>
330
-
331
- <p><a href="http://shop.terrytsang.com" target="_blank" title="Premium &amp; Free Extensions/Plugins for E-Commerce by Terry Tsang">Go to My Site</a> to get more free and premium extensions/plugins for your ecommerce sites.</p>
332
-
333
- <h3>Spreading the Word</h3>
334
-
335
- <ul style="list-style:none">If you find this plugin helpful, you can:
336
- <li>- Write and review about it in your blog</li>
337
- <li>- Rate it on <a href="http://wordpress.org/extend/plugins/woocommerce-direct-checkout/" target="_blank">wordpress plugin page</a></li>
338
- <li>- Share on your social media<br />
339
- <a href="http://www.facebook.com/sharer.php?u=http://terrytsang.com/shop/shop/woocommerce-direct-checkout/&amp;t=WooCommerce Direct Checkout" title="Share this WooCommerce Direct Checkout on Facebook" target="_blank"><img src="http://terrytsang.com/shop/images/social_facebook.png" alt="Share this WooCommerce Direct Checkout plugin on Facebook"></a>
340
- <a href="https://twitter.com/intent/tweet?url=http%3A%2F%2Fterrytsang.com%2Fshop%2Fshop%2Fwoocommerce-direct-checkout%2F&text=WooCommerce Direct Checkout - &via=terrytsang811" target="_blank"><img src="http://terrytsang.com/shop/images/social_twitter.png" alt="Tweet about WooCommerce Direct Checkout plugin"></a>
341
- <a href="http://linkedin.com/shareArticle?mini=true&amp;url=http://terrytsang.com/shop/shop/woocommerce-direct-checkout/&amp;title=WooCommerce Direct Checkout plugin" title="Share this WooCommerce Direct Checkout plugin on LinkedIn" target="_blank"><img src="http://terrytsang.com/shop/images/social_linkedin.png" alt="Share this WooCommerce Direct Checkout plugin on LinkedIn"></a>
342
- </li>
343
- <li>- Or make a donation</li>
344
- </ul>
345
-
346
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LJWSJDBBLNK7W" target="_blank"><img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" alt="" /></a>
347
-
348
- <h3>Thank you for your support!</h3>
349
- </td>
350
-
351
- </tr>
352
- </table>
353
-
354
-
355
- <br />
356
-
357
- <?php
358
- }
359
-
360
- /**
361
- * Get the setting options
362
- */
363
- function get_options() {
364
-
365
- foreach($this->options_direct_checkout as $field => $value)
366
- {
367
- $array_options[$field] = get_option( $field );
368
- }
369
-
370
- return $array_options;
371
- }
372
-
373
-
374
- }//end class
375
-
376
- }//if class does not exist
377
-
378
- $woocommerce_direct_checkout = new WooCommerce_Direct_Checkout();
379
- ?>
1
+ <?php
2
+
3
+ function qlwcdc_wcd_udpdate() {
4
+
5
+ if ($active_plugins = get_option('active_plugins', array())) {
6
+
7
+ global $wpdb;
8
+
9
+ foreach ($active_plugins as $key => $active_plugin) {
10
+
11
+ if (strstr($active_plugin, '/wc-direct-checkout.php')) {
12
+
13
+ $active_plugins[$key] = str_replace('/wc-direct-checkout.php', '/woocommerce-direct-checkout.php', $active_plugin);
14
+
15
+ }
16
+ }
17
+
18
+ update_option('active_plugins', $active_plugins);
19
+ }
20
+ }
21
+
22
+ add_action('wp_loaded', 'qlwcdc_wcd_udpdate');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wc-direct-checkout.pot DELETED
@@ -1,76 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WooCommerce Direct Checkout v1.0.8\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2014-07-07 17:40:21+0000\n"
7
- "Last-Translator: admin <terrytsang811@gmail.com>\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
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Poedit-Language: English\n"
14
- "X-Poedit-Country: UNITED KINGDOM\n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
- "X-Poedit-Basepath: \n"
18
- "X-Poedit-Bookmarks: \n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Textdomain-Support: yes"
21
-
22
- #: wc-direct-checkout.php:173
23
- #@ wc-direct-checkout
24
- msgid "Direct Checkout"
25
- msgstr ""
26
-
27
- #: wc-direct-checkout.php:204
28
- #@ wc-direct-checkout
29
- msgid "You have saved WooCommerce Direct Checkout options."
30
- msgstr ""
31
-
32
- #: wc-direct-checkout.php:234
33
- #@ wc-direct-checkout
34
- msgid "Direct Checkout Options"
35
- msgstr ""
36
-
37
- #: wc-direct-checkout.php:250
38
- #@ wc-direct-checkout
39
- msgid "Enable"
40
- msgstr ""
41
-
42
- #: wc-direct-checkout.php:264
43
- #@ wc-direct-checkout
44
- msgid "Custom Add to Cart Text"
45
- msgstr ""
46
-
47
- #: wc-direct-checkout.php:296
48
- #@ wc-direct-checkout
49
- msgid "Save Options"
50
- msgstr ""
51
-
52
- #: wc-direct-checkout.php:125
53
- #@ wc-direct-checkout
54
- msgid "Continue Shopping"
55
- msgstr ""
56
-
57
- #: wc-direct-checkout.php:257
58
- #@ wc-direct-checkout
59
- msgid "Add Continue Shopping Button"
60
- msgstr ""
61
-
62
- #: wc-direct-checkout.php:272
63
- #@ wc-direct-checkout
64
- msgid "Redirect to Page"
65
- msgstr ""
66
-
67
- #: wc-direct-checkout.php:272
68
- #@ wc-direct-checkout
69
- msgid "(Default will be checkout page if not set)"
70
- msgstr ""
71
-
72
- #: wc-direct-checkout.php:275
73
- #@ default
74
- msgid "Select page"
75
- msgstr ""
76
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
woocommerce-direct-checkout.php ADDED
@@ -0,0 +1,525 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WooCommerce Direct Checkout
4
+ * Description: Simplifies the checkout process to improve your sales rate.
5
+ * Version: 2.1.0
6
+ * Author: QuadLayers
7
+ * Author URI: https://www.quadlayers.com
8
+ * Copyright: 2018 QuadLayers (https://www.quadlayers.com)
9
+ * Text Domain: qlwcdc
10
+ */
11
+ if (!defined('ABSPATH')) {
12
+ die('-1');
13
+ }
14
+ if (!defined('QLWCDC_PLUGIN_NAME')) {
15
+ define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
16
+ }
17
+ if (!defined('QLWCDC_PLUGIN_VERSION')) {
18
+ define('QLWCDC_PLUGIN_VERSION', '2.1.0');
19
+ }
20
+ if (!defined('QLWCDC_PLUGIN_FILE')) {
21
+ define('QLWCDC_PLUGIN_FILE', __FILE__);
22
+ }
23
+ if (!defined('QLWCDC_PLUGIN_DIR')) {
24
+ define('QLWCDC_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
25
+ }
26
+ if (!defined('QLWCDC_DOMAIN')) {
27
+ define('QLWCDC_DOMAIN', 'qlwcdc');
28
+ }
29
+ if (!defined('QLWCDC_WORDPRESS_URL')) {
30
+ define('QLWCDC_WORDPRESS_URL', 'https://wordpress.org/plugins/woocommerce-direct-checkout/');
31
+ }
32
+ if (!defined('QLWCDC_REVIEW_URL')) {
33
+ define('QLWCDC_REVIEW_URL', 'https://wordpress.org/support/plugin/woocommerce-direct-checkout/reviews/?filter=5#new-post');
34
+ }
35
+ if (!defined('QLWCDC_DEMO_URL')) {
36
+ define('QLWCDC_DEMO_URL', 'https://quadlayers.com/portfolio/woocommerce-direct-checkout/?utm_source=qlwcdc_admin');
37
+ }
38
+ if (!defined('QLWCDC_PURCHASE_URL')) {
39
+ define('QLWCDC_PURCHASE_URL', QLWCDC_DEMO_URL);
40
+ }
41
+ if (!defined('QLWCDC_SUPPORT_URL')) {
42
+ define('QLWCDC_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qlwcdc_admin');
43
+ }
44
+ if (!defined('QLWCDC_GROUP_URL')) {
45
+ define('QLWCDC_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
46
+ }
47
+
48
+ if (!class_exists('QLWCDC')) {
49
+
50
+ class QLWCDC {
51
+
52
+ protected static $instance;
53
+
54
+ function ajax_dismiss_notice() {
55
+
56
+ if ($notice_id = ( isset($_POST['notice_id']) ) ? sanitize_key($_POST['notice_id']) : '') {
57
+
58
+ update_user_meta(get_current_user_id(), $notice_id, true);
59
+
60
+ wp_send_json($notice_id);
61
+ }
62
+
63
+ wp_die();
64
+ }
65
+
66
+ /* function add_notices() {
67
+
68
+ if (!get_transient('qlwcdc-first-rating') && !get_user_meta(get_current_user_id(), 'qlwcdc-user-rating', true)) {
69
+ ?>
70
+ <div id="qlwcdc-admin-rating" class="qlwcdc-notice notice is-dismissible" data-notice_id="qlwcdc-user-rating">
71
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
72
+ <div class="notice-image">
73
+ <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); ?>>">
74
+ </div>
75
+ <div class="notice-content" style="margin-left: 15px;">
76
+ <p>
77
+ <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout'), QLWCDC_PLUGIN_NAME); ?>
78
+ <br/>
79
+ <?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'); ?>
80
+ </p>
81
+ <a href="<?php echo esc_url(QLWCDC_REVIEW_URL); ?>" class="button-primary" target="_blank">
82
+ <?php esc_html_e('Yes, of course!', 'woocommerce-direct-checkout'); ?>
83
+ </a>
84
+ <a href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
85
+ <?php esc_html_e('Report a bug', 'woocommerce-direct-checkout'); ?>
86
+ </a>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ <script>
91
+ (function ($) {
92
+ $('.qlwcdc-notice').on('click', '.notice-dismiss', function (e) {
93
+ e.preventDefault();
94
+ var notice_id = $(e.delegateTarget).data('notice_id');
95
+ $.ajax({
96
+ type: 'POST',
97
+ url: ajaxurl,
98
+ data: {
99
+ notice_id: notice_id,
100
+ action: 'qlwcdc_dismiss_notice',
101
+ },
102
+ success: function (response) {
103
+ console.log(response);
104
+ },
105
+ });
106
+ });
107
+ })(jQuery);
108
+ </script>
109
+ <?php
110
+ }
111
+ } */
112
+
113
+ function add_notices() {
114
+ if (!get_user_meta(get_current_user_id(), 'qlwcdc-update-notice', true)) {
115
+ ?>
116
+ <div id="qlwcdc-admin-rating" class="qlwcdc-notice notice is-dismissible" data-notice_id="qlwcdc-update-notice">
117
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
118
+ <div class="notice-image">
119
+ <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); ?>>">
120
+ </div>
121
+ <div class="notice-content" style="margin-left: 15px;">
122
+ <p>
123
+ <?php printf(esc_html__('Hello! This is the first update of the %s plugin by QuadLayers!', 'woocommerce-direct-checkout'), QLWCDC_PLUGIN_NAME); ?>
124
+ <br/>
125
+ <?php esc_html_e('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'); ?>
126
+ </p>
127
+ <a href="<?php echo esc_url(QLWCDC_PURCHASE_URL); ?>" class="button-primary" target="_blank">
128
+ <?php esc_html_e('Go Premium!', 'woocommerce-direct-checkout'); ?>
129
+ </a>
130
+ <a href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
131
+ <?php esc_html_e('Report a bug', 'woocommerce-direct-checkout'); ?>
132
+ </a>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ <script>
137
+ (function ($) {
138
+ $('.qlwcdc-notice').on('click', '.notice-dismiss', function (e) {
139
+ e.preventDefault();
140
+ var notice_id = $(e.delegateTarget).data('notice_id');
141
+ $.ajax({
142
+ type: 'POST',
143
+ url: ajaxurl,
144
+ data: {
145
+ notice_id: notice_id,
146
+ action: 'qlwcdc_dismiss_notice',
147
+ },
148
+ success: function (response) {
149
+ console.log(response);
150
+ },
151
+ });
152
+ });
153
+ })(jQuery);
154
+ </script>
155
+ <?php
156
+ }
157
+ }
158
+
159
+ function get_product_option($product_id = null, $meta_key = null, $default = null) {
160
+
161
+ if (!$meta_key) {
162
+ return null;
163
+ }
164
+
165
+ if ($product_id && metadata_exists('post', $product_id, $meta_key)) {
166
+ return get_post_meta($product_id, $meta_key, true);
167
+ }
168
+
169
+ return get_option($meta_key, $default);
170
+ }
171
+
172
+ function add_action_links($links) {
173
+
174
+ $links[] = '<a target="_blank" href="' . QLWCDC_PURCHASE_URL . '">' . esc_html__('Premium', 'woocommerce-direct-checkout') . '</a>';
175
+ $links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(QLWCDC_DOMAIN)) . '">' . esc_html__('Settings', 'woocommerce-direct-checkout') . '</a>';
176
+
177
+ return $links;
178
+ }
179
+
180
+ function add_sections($sections = array()) {
181
+
182
+ global $current_section;
183
+
184
+ $sections = apply_filters('qlwcdc_add_sections', array());
185
+
186
+ echo '<ul class="subsubsub">';
187
+
188
+ $array_keys = array_keys($sections);
189
+
190
+ foreach ($sections as $id => $label) {
191
+ echo '<li><a href="' . admin_url('admin.php?page=wc-settings&tab=qlwcdc&section=' . sanitize_title($id)) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end($array_keys) == $id ? '' : '|' ) . ' </li>';
192
+ }
193
+
194
+ echo '</ul><br class="clear" />';
195
+ }
196
+
197
+ function add_tab($settings_tabs) {
198
+ $settings_tabs[QLWCDC_DOMAIN] = __('Direct Checkout', 'woocommerce-direct-checkout');
199
+ return $settings_tabs;
200
+ }
201
+
202
+ function add_settings() {
203
+ woocommerce_admin_fields($this->get_settings());
204
+ }
205
+
206
+ function save_settings() {
207
+ woocommerce_update_options($this->get_settings());
208
+ }
209
+
210
+ function get_settings() {
211
+
212
+ $fields = apply_filters('qlwcdc_add_fields', array());
213
+
214
+ return $fields;
215
+ }
216
+
217
+ function add_frontend_scripts() {
218
+ wp_enqueue_style(QLWCDC_DOMAIN, plugins_url('/assets/qlwcdc.min.css', QLWCDC_PLUGIN_FILE), null, QLWCDC_PLUGIN_VERSION, 'all');
219
+ wp_enqueue_script(QLWCDC_DOMAIN, plugins_url('/assets/qlwcdc.min.js', QLWCDC_PLUGIN_FILE), array('jquery'), QLWCDC_PLUGIN_VERSION, true);
220
+ wp_localize_script(QLWCDC_DOMAIN, QLWCDC_DOMAIN, array(
221
+ 'nonce' => wp_create_nonce(QLWCDC_DOMAIN),
222
+ //'queried_object_id' => get_queried_object_id(),
223
+ //'add_product_cart' => $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart', 'no'),
224
+ 'delay' => 200,
225
+ 'timeout' => null)
226
+ );
227
+ }
228
+
229
+ function remove_premium() {
230
+ ?>
231
+ <script>
232
+ (function ($) {
233
+ 'use strict';
234
+ $(window).on('load', function (e) {
235
+ $('#qlwcdc_options').css({'opacity': '0.5', 'pointer-events': 'none'});
236
+ $('label[for=qlwcdc_add_checkout_cart]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
237
+ $('label[for=qlwcdc_add_checkout_cart_fields]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
238
+ $('label[for=qlwcdc_add_checkout_cart_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
239
+ $('label[for=qlwcdc_remove_checkout_columns]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
240
+ $('label[for=qlwcdc_remove_checkout_coupon_form]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
241
+ $('label[for=qlwcdc_remove_order_details_address]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
242
+ $('label[for=qlwcdc_add_product_quick_purchase]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
243
+ $('label[for=qlwcdc_add_product_quick_purchase_to]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
244
+ $('label[for=qlwcdc_add_product_quick_purchase_qty]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
245
+ $('label[for=qlwcdc_add_product_quick_purchase_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
246
+ $('label[for=qlwcdc_add_product_quick_purchase_text]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
247
+ $('label[for=qlwcdc_add_product_default_attributes]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
248
+ $('label[for=qlwcdc_add_archive_quick_view]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
249
+ });
250
+ }(jQuery));
251
+ </script>
252
+ <?php
253
+ }
254
+
255
+ function add_footer_js() {
256
+ ?>
257
+ <script>
258
+ (function ($) {
259
+ 'use strict';
260
+ $(window).on('load', function (e) {
261
+ // General
262
+ // -----------------------------------------------------------------
263
+ $('select#qlwcdc_add_to_cart_redirect_page').change(function () {
264
+ if ('url' === $(this).val() && 'yes' == $('select#qlwcdc_add_to_cart_redirect').val()) {
265
+ $('input#qlwcdc_add_to_cart_redirect_url').closest('tr, p').fadeIn();
266
+ } else {
267
+ $('input#qlwcdc_add_to_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
268
+ }
269
+ });
270
+ $('select#qlwcdc_add_to_cart_redirect').change(function () {
271
+ if ('yes' === $(this).val()) {
272
+ $('select#qlwcdc_add_to_cart_redirect_page').change();
273
+ $('select#qlwcdc_add_to_cart_redirect_page').closest('tr, p').fadeIn();
274
+ } else {
275
+ $('select#qlwcdc_add_to_cart_redirect_page').change();
276
+ $('select#qlwcdc_add_to_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
277
+ }
278
+ }).change();
279
+ $('select#qlwcdc_add_to_cart_redirect_page').change(function () {
280
+ if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_to_cart').val()) {
281
+ $('input#qlwcdc_add_to_cart_redirect_url').closest('tr, p').fadeIn();
282
+ } else {
283
+ $('input#qlwcdc_add_to_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
284
+ }
285
+ });
286
+ $('select#qlwcdc_add_to_cart').change(function () {
287
+ if ('ajax' === $(this).val()) {
288
+ $('select#qlwcdc_add_to_cart_ajax_button').closest('tr, p').fadeIn();
289
+ $('select#qlwcdc_add_to_cart_ajax_message').closest('tr, p').fadeIn();
290
+ } else {
291
+ $('select#qlwcdc_add_to_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
292
+ $('select#qlwcdc_add_to_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
293
+ }
294
+ if ('redirect' === $(this).val()) {
295
+ $('select#qlwcdc_add_to_cart_redirect_page').closest('tr, p').fadeIn();
296
+ } else {
297
+ $('select#qlwcdc_add_to_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
298
+ }
299
+ $('select#qlwcdc_add_to_cart_redirect_page').change();
300
+ }).change();
301
+ // Archive
302
+ // -----------------------------------------------------------------
303
+ /*$('select#qlwcdc_add_archive_cart_redirect_page').change(function () {
304
+ if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_archive_cart').val()) {
305
+ $('input#qlwcdc_add_archive_cart_redirect_url').closest('tr, p').fadeIn();
306
+ } else {
307
+ $('input#qlwcdc_add_archive_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
308
+ }
309
+ });
310
+ $('select#qlwcdc_add_archive_cart').change(function () {
311
+ if ('ajax' === $(this).val()) {
312
+ $('select#qlwcdc_add_archive_cart_ajax_button').closest('tr, p').fadeIn();
313
+ $('select#qlwcdc_add_archive_cart_ajax_message').closest('tr, p').fadeIn();
314
+ } else {
315
+ $('select#qlwcdc_add_archive_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
316
+ $('select#qlwcdc_add_archive_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
317
+ }
318
+ if ('redirect' === $(this).val()) {
319
+ $('select#qlwcdc_add_archive_cart_redirect_page').closest('tr, p').fadeIn();
320
+ } else {
321
+ $('select#qlwcdc_add_archive_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
322
+ }
323
+ $('select#qlwcdc_add_archive_cart_redirect_page').change();
324
+ }).change();*/
325
+ $('select#qlwcdc_add_archive_text').change(function () {
326
+ if ('yes' === $(this).val()) {
327
+ $('select#qlwcdc_add_archive_text_in').closest('tr, p').fadeIn();
328
+ $('input#qlwcdc_add_archive_text_content').closest('tr, p').fadeIn();
329
+ } else {
330
+ $('select#qlwcdc_add_archive_text_in').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
331
+ $('input#qlwcdc_add_archive_text_content').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
332
+ }
333
+ }).change();
334
+ // Product
335
+ // -----------------------------------------------------------------
336
+ /*$('select#qlwcdc_add_product_cart_redirect_page').change(function () {
337
+ if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_product_cart').val()) {
338
+ $('input#qlwcdc_add_product_cart_redirect_url').closest('tr, p').fadeIn();
339
+ } else {
340
+ $('input#qlwcdc_add_product_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
341
+ }
342
+ });
343
+ $('select#qlwcdc_add_product_cart').change(function () {
344
+ if ('ajax' === $(this).val()) {
345
+ $('select#qlwcdc_add_product_cart_ajax_button').closest('tr, p').fadeIn();
346
+ $('select#qlwcdc_add_product_cart_ajax_message').closest('tr, p').fadeIn();
347
+ } else {
348
+ $('select#qlwcdc_add_product_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
349
+ $('select#qlwcdc_add_product_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
350
+ }
351
+ if ('redirect' === $(this).val()) {
352
+ $('select#qlwcdc_add_product_cart_redirect_page').closest('tr, p').fadeIn();
353
+ } else {
354
+ $('select#qlwcdc_add_product_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
355
+ }
356
+ $('select#qlwcdc_add_product_cart_redirect_page').change();
357
+ }).change();*/
358
+ $('select#qlwcdc_add_product_quick_purchase').change(function () {
359
+ if ('yes' === $(this).val()) {
360
+ $('select#qlwcdc_add_product_quick_purchase_to').closest('tr, p').fadeIn();
361
+ $('input#qlwcdc_add_product_quick_purchase_class').closest('tr, p').fadeIn();
362
+ $('input#qlwcdc_add_product_quick_purchase_text').closest('tr, p').fadeIn();
363
+ } else {
364
+ $('select#qlwcdc_add_product_quick_purchase_to').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
365
+ $('input#qlwcdc_add_product_quick_purchase_class').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
366
+ $('input#qlwcdc_add_product_quick_purchase_text').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
367
+ }
368
+ }).change();
369
+ $('select#qlwcdc_add_product_text').change(function () {
370
+ if ('yes' === $(this).val()) {
371
+ $('input#qlwcdc_add_product_text_content').closest('tr, p').fadeIn();
372
+ } else {
373
+ $('input#qlwcdc_add_product_text_content').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
374
+ }
375
+ }).change();
376
+ // Checkout
377
+ // -----------------------------------------------------------------
378
+ $('select#qlwcdc_add_checkout_cart').change(function () {
379
+ if ('yes' === $(this).val()) {
380
+ $('select#qlwcdc_add_checkout_cart_fields').closest('tr, p').fadeIn();
381
+ $('input#qlwcdc_add_checkout_cart_class').closest('tr, p').fadeIn();
382
+ } else {
383
+ $('select#qlwcdc_add_checkout_cart_fields').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
384
+ $('input#qlwcdc_add_checkout_cart_class').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
385
+ }
386
+ }).change();
387
+ });
388
+ }(jQuery));
389
+ </script>
390
+ <?php
391
+ }
392
+
393
+ function add_menu_page() {
394
+ 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)));
395
+ }
396
+
397
+ /* function woocommerce_cart_redirect_after_add($val) {
398
+ return 'no';
399
+ } */
400
+
401
+ function languages() {
402
+ load_plugin_textdomain('woocommerce-direct-checkout', false, dirname(plugin_basename(__FILE__)) . '/languages/');
403
+ }
404
+
405
+ function includes() {
406
+ require_once('includes/general.php');
407
+ require_once('includes/archives.php');
408
+ require_once('includes/products.php');
409
+ require_once('includes/checkout.php');
410
+ require_once('includes/purchase.php');
411
+ }
412
+
413
+ function init() {
414
+ add_action('wp_ajax_qlwcdc_dismiss_notice', array($this, 'ajax_dismiss_notice'));
415
+ add_action('wp_enqueue_scripts', array($this, 'add_frontend_scripts'));
416
+ add_action('admin_notices', array($this, 'add_notices'));
417
+ add_action('admin_menu', array(&$this, 'add_menu_page'));
418
+ add_action('admin_footer', array($this, 'remove_premium'));
419
+ add_action('admin_footer', array($this, 'add_footer_js'));
420
+ add_filter('woocommerce_settings_tabs_array', array($this, 'add_tab'), 50);
421
+ add_filter('woocommerce_sections_qlwcdc', array($this, 'add_sections'));
422
+ add_action('woocommerce_sections_qlwcdc', array($this, 'add_settings'));
423
+ add_action('woocommerce_settings_save_qlwcdc', array($this, 'save_settings'));
424
+ //add_filter('option_woocommerce_cart_redirect_after_add', array($this, 'woocommerce_cart_redirect_after_add'));
425
+ add_filter('plugin_action_links_' . plugin_basename(QLWCDC_PLUGIN_FILE), array($this, 'add_action_links'));
426
+ }
427
+
428
+ public static function do_import() {
429
+
430
+ global $wpdb;
431
+
432
+ if (!get_option('qlwcdc_wcd_imported2')) {
433
+
434
+ if (get_option('direct_checkout_pro_enabled', get_option('direct_checkout_enabled'))) {
435
+
436
+ $url = get_option('direct_checkout_pro_cart_redirect_url', get_option('direct_checkout_cart_redirect_url'));
437
+
438
+ if ($url === wc_get_cart_url()) {
439
+ $val = 'cart';
440
+ } elseif (filter_var($url, FILTER_VALIDATE_URL) !== false && $url != wc_get_checkout_url()) {
441
+ $val = 'url';
442
+ } else {
443
+ $val = 'checkout';
444
+ }
445
+
446
+ /* add_option('qlwcdc_add_product_cart', 'redirect');
447
+ add_option('qlwcdc_add_product_cart_redirect_page', $val);
448
+ add_option('qlwcdc_add_product_cart_redirect_url', $url);
449
+
450
+ add_option('qlwcdc_add_archive_cart', 'redirect');
451
+ add_option('qlwcdc_add_archive_cart_redirect_page', $val);
452
+ add_option('qlwcdc_add_archive_cart_redirect_url', $url); */
453
+
454
+ add_option('qlwcdc_add_to_cart', 'redirect');
455
+ add_option('qlwcdc_add_to_cart_redirect_page', $val);
456
+ add_option('qlwcdc_add_to_cart_redirect_url', $url);
457
+ }
458
+
459
+ if ($text = get_option('direct_checkout_cart_button_text', get_option('direct_checkout_cart_button_text'))) {
460
+ add_option('qlwcdc_add_product_text', 'yes');
461
+ add_option('qlwcdc_add_product_text_content', $text);
462
+ add_option('qlwcdc_add_archive_text', 'yes');
463
+ add_option('qlwcdc_add_archive_text_content', $text);
464
+ add_option('qlwcdc_add_archive_text_in', array(
465
+ 'simple',
466
+ 'grouped',
467
+ 'virtual',
468
+ 'variable',
469
+ 'downloadable'
470
+ ));
471
+ }
472
+
473
+ if (count($keys = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s", '_direct_checkout_pro_enabled')))) {
474
+ foreach ($keys as $key) {
475
+ if ($key->meta_value == 'yes') {
476
+ if ($text = get_post_meta($key->post_id, '_direct_checkout_pro_cart_button_text', true)) {
477
+ add_post_meta($key->post_id, 'qlwcdc_add_product_text', 'yes', true);
478
+ add_post_meta($key->post_id, 'qlwcdc_add_product_text_content', $text, true);
479
+ }
480
+ }
481
+ }
482
+ }
483
+
484
+ delete_option('qlwcdc_wcd_imported');
485
+ update_option('qlwcdc_wcd_imported2', true);
486
+ }
487
+ }
488
+
489
+ public static function do_activation() {
490
+
491
+ set_transient('qlwcdc-first-rating', true, MONTH_IN_SECONDS);
492
+
493
+ if ('yes' === get_option('woocommerce_cart_redirect_after_add')) {
494
+ add_option('qlwcdc_add_to_cart', 'redirect');
495
+ add_option('qlwcdc_add_to_cart_redirect_page', 'cart');
496
+ /* add_option('qlwcdc_add_product_cart', 'redirect');
497
+ add_option('qlwcdc_add_product_cart_redirect_page', 'cart');
498
+ add_option('qlwcdc_add_archive_cart', 'redirect');
499
+ add_option('qlwcdc_add_archive_cart_redirect_page', 'cart'); */
500
+ }
501
+
502
+ /* if ('yes' === get_option('woocommerce_enable_ajax_add_to_cart')) {
503
+ add_option('qlwcdc_add_archive_cart', 'ajax');
504
+ } */
505
+ }
506
+
507
+ public static function instance() {
508
+ if (!isset(self::$instance)) {
509
+ self::$instance = new self();
510
+ self::$instance->init();
511
+ self::$instance->includes();
512
+ self::$instance->languages();
513
+ }
514
+ return self::$instance;
515
+ }
516
+
517
+ }
518
+
519
+ add_action('wp_loaded', array('QLWCDC', 'do_import'));
520
+ add_action('plugins_loaded', array('QLWCDC', 'instance'));
521
+
522
+ register_activation_hook(QLWCDC_PLUGIN_FILE, array('QLWCDC', 'do_activation'));
523
+ }
524
+
525
+