Version Description
- Fix: code refactoring
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Direct Checkout |
Version | 2.3.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.9 to 2.3.0
- assets/frontend/qlwcdc.css +0 -80
- assets/frontend/qlwcdc.js +0 -224
- assets/frontend/qlwcdc.min.css +0 -2
- assets/frontend/qlwcdc.min.js +0 -2
- includes/archives.php +0 -131
- includes/checkout.php +0 -277
- includes/controller/archives.php +128 -0
- includes/{backend.php → controller/backend.php} +8 -10
- includes/controller/checkout.php +259 -0
- includes/controller/general.php +150 -0
- includes/{premium.php → controller/premium.php} +5 -9
- includes/controller/products.php +282 -0
- includes/{suggestions.php → controller/suggestions.php} +6 -10
- includes/frontend.php +0 -32
- includes/general.php +0 -200
- includes/notices.php +7 -11
- includes/products.php +0 -322
- includes/qlwcdc.php +8 -20
- includes/{pages → view/backend/pages}/archives.php +0 -0
- includes/{pages → view/backend/pages}/checkout.php +0 -0
- includes/{pages → view/backend/pages}/general.php +0 -0
- includes/{pages → view/backend/pages}/parts/header.php +0 -0
- includes/{pages → view/backend/pages}/parts/tabs.php +0 -0
- includes/{pages → view/backend/pages}/premium.php +0 -0
- includes/{pages → view/backend/pages}/products.php +0 -0
- includes/{pages → view/backend/pages}/suggestions.php +0 -0
- includes/view/frontend/archives.php +38 -0
- includes/view/frontend/checkout.php +62 -0
- includes/view/frontend/general.php +64 -0
- includes/view/frontend/products.php +54 -0
- languages/woocommerce-direct-checkout.pot +229 -161
- readme.txt +6 -3
- woocommerce-direct-checkout.php +2 -2
assets/frontend/qlwcdc.css
DELETED
@@ -1,80 +0,0 @@
|
|
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/frontend/qlwcdc.js
DELETED
@@ -1,224 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Version: 2.2.0
|
3 |
-
*/
|
4 |
-
|
5 |
-
(function ($) {
|
6 |
-
|
7 |
-
var timeout;
|
8 |
-
var delay = 1000;
|
9 |
-
var is_blocked = function ($node) {
|
10 |
-
return $node.is('.processing') || $node.parents('.processing').length;
|
11 |
-
};
|
12 |
-
var block = function ($node) {
|
13 |
-
if (!is_blocked($node)) {
|
14 |
-
$node.addClass('processing').block({
|
15 |
-
message: null,
|
16 |
-
overlayCSS: {
|
17 |
-
background: '#fff',
|
18 |
-
opacity: 0.6
|
19 |
-
}
|
20 |
-
});
|
21 |
-
}
|
22 |
-
};
|
23 |
-
var unblock = function ($node) {
|
24 |
-
$node.removeClass('processing').unblock();
|
25 |
-
};
|
26 |
-
$(document).on('click', '.qlwcdc_quick_view', function (e) {
|
27 |
-
e.stopPropagation();
|
28 |
-
e.preventDefault();
|
29 |
-
var product_id = $(this).data('product_id'),
|
30 |
-
$modal = $('#qlwcdc_quick_view_modal');
|
31 |
-
if (product_id && woocommerce_params.ajax_url) {
|
32 |
-
|
33 |
-
$.ajax({
|
34 |
-
type: 'post',
|
35 |
-
url: woocommerce_params.ajax_url,
|
36 |
-
data: {
|
37 |
-
action: 'qlwcdc_quick_view_modal',
|
38 |
-
nonce: qlwcdc.nonce,
|
39 |
-
product_id: product_id
|
40 |
-
},
|
41 |
-
complete: function (response) {
|
42 |
-
|
43 |
-
$modal.addClass('opening');
|
44 |
-
setTimeout(function () {
|
45 |
-
$modal.addClass('open');
|
46 |
-
$modal.removeClass('opening');
|
47 |
-
}, 50);
|
48 |
-
},
|
49 |
-
success: function (response) {
|
50 |
-
|
51 |
-
var $response = $(response);
|
52 |
-
$response.find('.woocommerce-product-gallery').each(function () {
|
53 |
-
$(this).wc_product_gallery();
|
54 |
-
});
|
55 |
-
$response.on('click', '.close', function (e) {
|
56 |
-
$modal.addClass('closing');
|
57 |
-
setTimeout(function () {
|
58 |
-
$modal.removeClass('open');
|
59 |
-
$modal.removeClass('closing');
|
60 |
-
}, 600);
|
61 |
-
});
|
62 |
-
$modal.find('.modal-content').replaceWith($response);
|
63 |
-
if (typeof wc_add_to_cart_variation_params !== 'undefined') {
|
64 |
-
$modal.find('.variations_form').wc_variation_form();
|
65 |
-
}
|
66 |
-
}
|
67 |
-
});
|
68 |
-
}
|
69 |
-
|
70 |
-
return false;
|
71 |
-
});
|
72 |
-
|
73 |
-
$('#qlwcdc_quick_view_modal').on('click', function (e) {
|
74 |
-
|
75 |
-
var $context = $(e.target),
|
76 |
-
$modal = $(e.delegateTarget);
|
77 |
-
|
78 |
-
if ($context.hasClass('modal-dialog')) {
|
79 |
-
$modal.addClass('closing');
|
80 |
-
setTimeout(function () {
|
81 |
-
$modal.removeClass('open');
|
82 |
-
$modal.removeClass('closing');
|
83 |
-
}, 600);
|
84 |
-
}
|
85 |
-
});
|
86 |
-
|
87 |
-
$('form.cart').on('click', '.qlwcdc_quick_purchase', function (e) {
|
88 |
-
e.preventDefault();
|
89 |
-
e.stopPropagation();
|
90 |
-
|
91 |
-
var $button = $(this),
|
92 |
-
$form = $(e.delegateTarget);
|
93 |
-
|
94 |
-
var product_id = $form.find('[name=add-to-cart]').val() || 0,
|
95 |
-
params = $form.serialize().replace(/\%5B%5D/g, '[]') || 0;
|
96 |
-
|
97 |
-
$button.attr('data-href', function (i, h) {
|
98 |
-
if (h.indexOf('?') != -1) {
|
99 |
-
$button.attr('data-href', $button.attr('data-href') + '&add-to-cart=' + product_id);
|
100 |
-
} else {
|
101 |
-
$button.attr('data-href', $button.attr('data-href') + '?add-to-cart=' + product_id);
|
102 |
-
}
|
103 |
-
});
|
104 |
-
|
105 |
-
if (params) {
|
106 |
-
$button.attr('data-href', $button.attr('data-href') + '&' + params);
|
107 |
-
}
|
108 |
-
|
109 |
-
if ($button.attr('data-href') != 'undefined') {
|
110 |
-
document.location.href = $button.attr('data-href');
|
111 |
-
}
|
112 |
-
|
113 |
-
return false;
|
114 |
-
|
115 |
-
});
|
116 |
-
|
117 |
-
$(document).on('keyup', '#qlwcdc_order_coupon_code', function (e) {
|
118 |
-
|
119 |
-
var $form = $(this),
|
120 |
-
$coupon = $(this).find('input[name="coupon_code"]'),
|
121 |
-
coupon_code = $coupon.val();
|
122 |
-
|
123 |
-
if (timeout) {
|
124 |
-
clearTimeout(timeout);
|
125 |
-
}
|
126 |
-
|
127 |
-
if (!coupon_code) {
|
128 |
-
return;
|
129 |
-
}
|
130 |
-
|
131 |
-
timeout = setTimeout(function () {
|
132 |
-
|
133 |
-
if ($form.is('.processing')) {
|
134 |
-
return false;
|
135 |
-
}
|
136 |
-
|
137 |
-
$form.addClass('processing').block({
|
138 |
-
message: null,
|
139 |
-
overlayCSS: {
|
140 |
-
background: '#fff',
|
141 |
-
opacity: 0.6
|
142 |
-
}
|
143 |
-
});
|
144 |
-
|
145 |
-
var data = {
|
146 |
-
security: wc_checkout_params.apply_coupon_nonce,
|
147 |
-
coupon_code: coupon_code
|
148 |
-
};
|
149 |
-
|
150 |
-
$.ajax({
|
151 |
-
type: 'POST',
|
152 |
-
url: wc_checkout_params.wc_ajax_url.toString().replace('%%endpoint%%', 'apply_coupon'),
|
153 |
-
data: data,
|
154 |
-
success: function (code) {
|
155 |
-
$form.removeClass('processing').unblock();
|
156 |
-
if (code) {
|
157 |
-
$coupon.before($(code).hide().fadeIn());
|
158 |
-
setTimeout(function () {
|
159 |
-
$(document.body).trigger('update_checkout', {update_shipping_method: false});
|
160 |
-
}, delay * 2);
|
161 |
-
}
|
162 |
-
},
|
163 |
-
dataType: 'html'
|
164 |
-
});
|
165 |
-
return false;
|
166 |
-
}, delay);
|
167 |
-
});
|
168 |
-
|
169 |
-
$('#order_review').on('change', 'input.qty', function (e) {
|
170 |
-
e.preventDefault();
|
171 |
-
var $qty = $(this);
|
172 |
-
setTimeout(function () {
|
173 |
-
|
174 |
-
var hash = $qty.attr('name').replace(/cart\[([\w]+)\]\[qty\]/g, "$1"),
|
175 |
-
qty = parseFloat($qty.val());
|
176 |
-
$.ajax({
|
177 |
-
type: 'post',
|
178 |
-
url: woocommerce_params.ajax_url,
|
179 |
-
data: {
|
180 |
-
action: 'qlwcdc_update_cart',
|
181 |
-
nonce: qlwcdc.nonce,
|
182 |
-
hash: hash,
|
183 |
-
quantity: qty
|
184 |
-
},
|
185 |
-
beforeSend: function (response) {
|
186 |
-
block($('#order_review'));
|
187 |
-
},
|
188 |
-
complete: function (response) {
|
189 |
-
unblock($('#order_review'));
|
190 |
-
},
|
191 |
-
success: function (response) {
|
192 |
-
if (response) {
|
193 |
-
$('#order_review').html($(response).html()).trigger('updated_checkout');
|
194 |
-
}
|
195 |
-
},
|
196 |
-
});
|
197 |
-
}, 400);
|
198 |
-
});
|
199 |
-
$('#order_review').on('click', 'a.remove', function (e) {
|
200 |
-
e.preventDefault();
|
201 |
-
var hash = $(this).data('cart_item_key');
|
202 |
-
$.ajax({
|
203 |
-
type: 'post',
|
204 |
-
url: woocommerce_params.ajax_url,
|
205 |
-
data: {
|
206 |
-
action: 'qlwcdc_update_cart',
|
207 |
-
nonce: qlwcdc.nonce,
|
208 |
-
quantity: 0,
|
209 |
-
hash: hash
|
210 |
-
},
|
211 |
-
beforeSend: function (response) {
|
212 |
-
block($('#order_review'));
|
213 |
-
},
|
214 |
-
complete: function (response) {
|
215 |
-
unblock($('#order_review'));
|
216 |
-
},
|
217 |
-
success: function (response) {
|
218 |
-
if (response) {
|
219 |
-
$('#order_review').html($(response).html()).trigger('updated_checkout');
|
220 |
-
}
|
221 |
-
},
|
222 |
-
});
|
223 |
-
});
|
224 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/frontend/qlwcdc.min.css
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
|
2 |
-
#qlwcdc_quick_view_modal.modal{display:none;position:fixed;z-index:999999;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,0.4)}#qlwcdc_quick_view_modal.modal.open,#qlwcdc_quick_view_modal.modal.closing,#qlwcdc_quick_view_modal.modal.opening{display:block}#qlwcdc_quick_view_modal .modal-dialog{display:flex;height:100%;width:100%}#qlwcdc_quick_view_modal .modal-content{top:-30px;opacity:0;transform:scale(2,2);position:relative;width:80%;max-width:860px;background-color:#fff;margin:auto;padding:0;border:1px solid rgba(0,0,0,0.1);box-shadow:0 4px 8px 0 rgba(0,0,0,0.1),0 6px 20px 0 rgba(0,0,0,0.1);border-radius:5px;transition:all 400ms cubic-bezier(0.215,0.61,0.355,1),opacity 300ms ease-in}#qlwcdc_quick_view_modal.modal.open .modal-content{top:0;opacity:1;transform:scale(1,1)}#qlwcdc_quick_view_modal .modal-header,#qlwcdc_quick_view_modal .modal-footer,#qlwcdc_quick_view_modal .modal-body{padding:2em;clear:both;overflow:hidden}#qlwcdc_quick_view_modal .modal-header,#qlwcdc_quick_view_modal .modal-footer{background-color:#eee}#qlwcdc_quick_view_modal .close{color:#aaa;float:right;font-size:28px;font-weight:bold}#qlwcdc_quick_view_modal .close:hover,#qlwcdc_quick_view_modal .close:focus{color:black;text-decoration:none;cursor:pointer}#qlwcdc_quick_view_modal.modal .single-product div.product .images,#qlwcdc_quick_view_modal.modal .single-product div.product .summary,#qlwcdc_quick_view_modal.modal .single-product div.product .woocommerce-product-gallery{margin-top:0;margin-bottom:0}
|
|
|
|
assets/frontend/qlwcdc.min.js
DELETED
@@ -1,2 +0,0 @@
|
|
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);if(typeof wc_add_to_cart_variation_params!=="undefined"){g.find(".variations_form").wc_variation_form()}}})}return false});d("#qlwcdc_quick_view_modal").on("click",function(i){var g=d(i.target),h=d(i.delegateTarget);if(g.hasClass("modal-dialog")){h.addClass("closing");setTimeout(function(){h.removeClass("open");h.removeClass("closing")},600)}});d("form.cart").on("click",".qlwcdc_quick_purchase",function(j){j.preventDefault();j.stopPropagation();var i=d(this),g=d(j.delegateTarget);var h=g.find("[name=add-to-cart]").val()||0,k=g.serialize().replace(/\%5B%5D/g,"[]")||0;i.attr("data-href",function(l,m){if(m.indexOf("?")!=-1){i.attr("data-href",i.attr("data-href")+"&add-to-cart="+h)}else{i.attr("data-href",i.attr("data-href")+"?add-to-cart="+h)}});if(k){i.attr("data-href",i.attr("data-href")+"&"+k)}if(i.attr("data-href")!="undefined"){document.location.href=i.attr("data-href")}return false});d(document).on("keyup","#qlwcdc_order_coupon_code",function(j){var h=d(this),i=d(this).find('input[name="coupon_code"]'),g=i.val();if(c){clearTimeout(c)}if(!g){return}c=setTimeout(function(){if(h.is(".processing")){return false}h.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}});var k={security:wc_checkout_params.apply_coupon_nonce,coupon_code:g};d.ajax({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","apply_coupon"),data:k,success:function(l){h.removeClass("processing").unblock();if(l){i.before(d(l).hide().fadeIn());setTimeout(function(){d(document.body).trigger("update_checkout",{update_shipping_method:false})},b*2)}},dataType:"html"});return false},b)});d("#order_review").on("change","input.qty",function(h){h.preventDefault();var g=d(this);setTimeout(function(){var i=g.attr("name").replace(/cart\[([\w]+)\]\[qty\]/g,"$1"),j=parseFloat(g.val());d.ajax({type:"post",url:woocommerce_params.ajax_url,data:{action:"qlwcdc_update_cart",nonce:qlwcdc.nonce,hash:i,quantity:j},beforeSend:function(k){f(d("#order_review"))},complete:function(k){a(d("#order_review"))},success:function(k){if(k){d("#order_review").html(d(k).html()).trigger("updated_checkout")}},})},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()).trigger("updated_checkout")}},})})})(jQuery);
|
|
|
|
includes/archives.php
DELETED
@@ -1,131 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
die('-1');
|
4 |
-
}
|
5 |
-
|
6 |
-
if (!class_exists('QLWCDC_Archives')) {
|
7 |
-
|
8 |
-
class QLWCDC_Archives extends QLWCDC {
|
9 |
-
|
10 |
-
protected static $instance;
|
11 |
-
|
12 |
-
public static function instance() {
|
13 |
-
if (!isset(self::$instance)) {
|
14 |
-
self::$instance = new self();
|
15 |
-
self::$instance->init();
|
16 |
-
}
|
17 |
-
return self::$instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
function add_header() {
|
21 |
-
global $current_section;
|
22 |
-
?>
|
23 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion=archives'); ?>" class="<?php echo ( $current_section == 'archives' ? 'current' : '' ); ?>"><?php esc_html_e('Archives', 'woocommerce-direct-checkout'); ?></a> | </li>
|
24 |
-
<?php
|
25 |
-
}
|
26 |
-
|
27 |
-
function get_settings() {
|
28 |
-
|
29 |
-
return array(
|
30 |
-
array(
|
31 |
-
'name' => esc_html__('Archives', 'woocommerce-direct-checkout'),
|
32 |
-
'type' => 'title',
|
33 |
-
'id' => 'qlwcdc_archives_section_title'
|
34 |
-
),
|
35 |
-
array(
|
36 |
-
'name' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
37 |
-
'desc_tip' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
38 |
-
'id' => 'qlwcdc_add_archive_text',
|
39 |
-
'type' => 'select',
|
40 |
-
'class' => 'chosen_select',
|
41 |
-
'options' => array(
|
42 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
43 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
44 |
-
),
|
45 |
-
'default' => 'no',
|
46 |
-
),
|
47 |
-
array(
|
48 |
-
'name' => esc_html__('Replace Add to cart text in', 'woocommerce-direct-checkout'),
|
49 |
-
'desc_tip' => esc_html__('Replace "Add to cart" text in product types.', 'woocommerce-direct-checkout'),
|
50 |
-
'id' => 'qlwcdc_add_archive_text_in',
|
51 |
-
'type' => 'multiselect',
|
52 |
-
'class' => 'chosen_select',
|
53 |
-
'options' => array(
|
54 |
-
'simple' => esc_html__('Simple Products', 'woocommerce-direct-checkout'),
|
55 |
-
'grouped' => esc_html__('Grouped Products', 'woocommerce-direct-checkout'),
|
56 |
-
'virtual' => esc_html__('Virtual Products', 'woocommerce-direct-checkout'),
|
57 |
-
'variable' => esc_html__('Variable Products', 'woocommerce-direct-checkout'),
|
58 |
-
'downloadable' => esc_html__('Downloadable Products', 'woocommerce-direct-checkout'),
|
59 |
-
),
|
60 |
-
'default' => array('simple'),
|
61 |
-
),
|
62 |
-
array(
|
63 |
-
'name' => esc_html__('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
64 |
-
'desc_tip' => esc_html__('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
65 |
-
'id' => 'qlwcdc_add_archive_text_content',
|
66 |
-
'type' => 'text',
|
67 |
-
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout'),
|
68 |
-
),
|
69 |
-
array(
|
70 |
-
'name' => esc_html__('Add quick view button', 'woocommerce-direct-checkout'),
|
71 |
-
'desc_tip' => esc_html__('Add product quick view modal button.', 'woocommerce-direct-checkout'),
|
72 |
-
'id' => 'qlwcdc_add_archive_quick_view',
|
73 |
-
'type' => 'select',
|
74 |
-
'class' => 'chosen_select qlwcdc-premium-field',
|
75 |
-
'options' => array(
|
76 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
77 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
78 |
-
),
|
79 |
-
'default' => 'no',
|
80 |
-
),
|
81 |
-
array(
|
82 |
-
'type' => 'sectionend',
|
83 |
-
'id' => 'qlwcdc_archives_section_end'
|
84 |
-
)
|
85 |
-
);
|
86 |
-
}
|
87 |
-
|
88 |
-
function add_section() {
|
89 |
-
|
90 |
-
global $current_section;
|
91 |
-
|
92 |
-
if ('archives' == $current_section) {
|
93 |
-
|
94 |
-
$settings = $this->get_settings();
|
95 |
-
|
96 |
-
include_once( QLWCDC_PLUGIN_DIR . 'includes/pages/archives.php' );
|
97 |
-
}
|
98 |
-
}
|
99 |
-
|
100 |
-
function save_settings() {
|
101 |
-
|
102 |
-
global $current_section;
|
103 |
-
|
104 |
-
if ('archives' == $current_section) {
|
105 |
-
|
106 |
-
woocommerce_update_options($this->get_settings());
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
function add_archive_text($text, $product) {
|
111 |
-
|
112 |
-
if ('yes' === get_option('qlwcdc_add_archive_text')) {
|
113 |
-
if ($product->is_type(get_option('qlwcdc_add_archive_text_in', array()))) {
|
114 |
-
$text = esc_html__(get_option('qlwcdc_add_archive_text_content'));
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
return $text;
|
119 |
-
}
|
120 |
-
|
121 |
-
function init() {
|
122 |
-
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
123 |
-
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
124 |
-
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
125 |
-
add_filter('woocommerce_product_add_to_cart_text', array($this, 'add_archive_text'), 10, 2);
|
126 |
-
}
|
127 |
-
|
128 |
-
}
|
129 |
-
|
130 |
-
QLWCDC_Archives::instance();
|
131 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/checkout.php
DELETED
@@ -1,277 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
die('-1');
|
4 |
-
}
|
5 |
-
|
6 |
-
if (!class_exists('QLWCDC_Checkout')) {
|
7 |
-
|
8 |
-
class QLWCDC_Checkout {
|
9 |
-
|
10 |
-
protected static $instance;
|
11 |
-
|
12 |
-
public static function instance() {
|
13 |
-
if (!isset(self::$instance)) {
|
14 |
-
self::$instance = new self();
|
15 |
-
self::$instance->init();
|
16 |
-
}
|
17 |
-
return self::$instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
function add_header() {
|
21 |
-
global $current_section;
|
22 |
-
?>
|
23 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion=checkout'); ?>" class="<?php echo ( $current_section == 'checkout' ? 'current' : '' ); ?>"><?php esc_html_e('Checkout', 'woocommerce-direct-checkout'); ?></a> | </li>
|
24 |
-
<?php
|
25 |
-
}
|
26 |
-
|
27 |
-
function get_settings() {
|
28 |
-
|
29 |
-
return array(
|
30 |
-
array(
|
31 |
-
'name' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
32 |
-
'type' => 'title',
|
33 |
-
'id' => 'section_title'
|
34 |
-
),
|
35 |
-
array(
|
36 |
-
'name' => esc_html__('Add cart to checkout', 'woocommerce-direct-checkout'),
|
37 |
-
'desc_tip' => esc_html__('Simplifies the checkout process including the shopping cart page inside checkout.', 'woocommerce-direct-checkout'),
|
38 |
-
'id' => 'qlwcdc_add_checkout_cart',
|
39 |
-
'type' => 'select',
|
40 |
-
'class' => 'chosen_select',
|
41 |
-
'options' => array(
|
42 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
43 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
44 |
-
),
|
45 |
-
'default' => 'no',
|
46 |
-
),
|
47 |
-
array(
|
48 |
-
'name' => esc_html__('Add cart to checkout fields', 'woocommerce-direct-checkout'),
|
49 |
-
'desc_tip' => esc_html__('Include this fields inside the checkout cart.', 'woocommerce-direct-checkout'),
|
50 |
-
'id' => 'qlwcdc_add_checkout_cart_fields',
|
51 |
-
'type' => 'multiselect',
|
52 |
-
'class' => 'chosen_select',
|
53 |
-
'options' => array(
|
54 |
-
'remove' => esc_html__('Remove', 'woocommerce-direct-checkout'),
|
55 |
-
'thumbnail' => esc_html__('Thumbnail', 'woocommerce-direct-checkout'),
|
56 |
-
'name' => esc_html__('Name', 'woocommerce-direct-checkout'),
|
57 |
-
'price' => esc_html__('Price', 'woocommerce-direct-checkout'),
|
58 |
-
'qty' => esc_html__('Quantity', 'woocommerce-direct-checkout'),
|
59 |
-
),
|
60 |
-
'default' => array(
|
61 |
-
0 => 'remove',
|
62 |
-
1 => 'thumbnail',
|
63 |
-
2 => 'price',
|
64 |
-
3 => 'qty',
|
65 |
-
)
|
66 |
-
),
|
67 |
-
array(
|
68 |
-
'name' => esc_html__('Remove checkout coupon form', 'woocommerce-direct-checkout'),
|
69 |
-
'desc_tip' => esc_html__('Simplifies the checkout process removing the coupon form.', 'woocommerce-direct-checkout'),
|
70 |
-
'id' => 'qlwcdc_remove_checkout_coupon_form',
|
71 |
-
'type' => 'select',
|
72 |
-
'class' => 'chosen_select',
|
73 |
-
'options' => array(
|
74 |
-
'no' => esc_html__('Leave coupon form', 'woocommerce-direct-checkout'),
|
75 |
-
'remove' => esc_html__('Remove coupon form', 'woocommerce-direct-checkout'),
|
76 |
-
'toggle' => esc_html__('Remove coupon toggle', 'woocommerce-direct-checkout'),
|
77 |
-
'checkout' => esc_html__('Move to checkout order', 'woocommerce-direct-checkout'),
|
78 |
-
),
|
79 |
-
'default' => 'no',
|
80 |
-
),
|
81 |
-
array(
|
82 |
-
'name' => esc_html__('Add custom class to cart table', 'woocommerce-direct-checkout'),
|
83 |
-
'desc_tip' => esc_html__('Add a custom class to the cart table form in the checkot.', 'woocommerce-direct-checkout'),
|
84 |
-
'id' => 'qlwcdc_add_checkout_cart_class',
|
85 |
-
'type' => 'text',
|
86 |
-
'default' => ''
|
87 |
-
),
|
88 |
-
array(
|
89 |
-
'name' => esc_html__('Remove checkout fields', 'qlwe'),
|
90 |
-
'desc_tip' => esc_html__('Simplifies the checkout process removing the unnecessary checkout fields.', 'qlwe'),
|
91 |
-
'id' => 'qlwcdc_remove_checkout_fields',
|
92 |
-
'type' => 'multiselect',
|
93 |
-
'class' => 'chosen_select',
|
94 |
-
'options' => array(
|
95 |
-
'first_name' => esc_html__('First Name', 'qlwe'),
|
96 |
-
'last_name' => esc_html__('Last Name', 'qlwe'),
|
97 |
-
'country' => esc_html__('Country', 'qlwe'),
|
98 |
-
'state' => esc_html__('State', 'qlwe'),
|
99 |
-
'city' => esc_html__('City', 'qlwe'),
|
100 |
-
'postcode' => esc_html__('Postcode', 'qlwe'),
|
101 |
-
'address_1' => esc_html__('Address 1', 'qlwe'),
|
102 |
-
'address_2' => esc_html__('Address 2', 'qlwe'),
|
103 |
-
'company' => esc_html__('Company', 'qlwe'),
|
104 |
-
'phone' => esc_html__('Phone', 'qlwe'),
|
105 |
-
),
|
106 |
-
'default' => array(
|
107 |
-
0 => 'phone',
|
108 |
-
1 => 'company',
|
109 |
-
2 => 'address_2',
|
110 |
-
)
|
111 |
-
),
|
112 |
-
array(
|
113 |
-
'name' => esc_html__('Remove checkout shipping address', 'woocommerce-direct-checkout'),
|
114 |
-
'desc_tip' => esc_html__('Simplifies the checkout process removing the shipping address.', 'woocommerce-direct-checkout'),
|
115 |
-
'id' => 'qlwcdc_remove_checkout_shipping_address',
|
116 |
-
'type' => 'select',
|
117 |
-
'class' => 'chosen_select',
|
118 |
-
'options' => array(
|
119 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
120 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
121 |
-
),
|
122 |
-
'default' => 'no',
|
123 |
-
),
|
124 |
-
array(
|
125 |
-
'name' => esc_html__('Remove checkout order comments', 'woocommerce-direct-checkout'),
|
126 |
-
'desc_tip' => esc_html__('Simplifies the checkout process removing the order notes.', 'woocommerce-direct-checkout'),
|
127 |
-
'id' => 'qlwcdc_remove_checkout_order_comments',
|
128 |
-
'type' => 'select',
|
129 |
-
'class' => 'chosen_select',
|
130 |
-
'options' => array(
|
131 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
132 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
133 |
-
),
|
134 |
-
'default' => 'no',
|
135 |
-
),
|
136 |
-
array(
|
137 |
-
'name' => esc_html__('Remove checkout policy text', 'woocommerce-direct-checkout'),
|
138 |
-
'desc_tip' => esc_html__('Simplifies the checkout process removing the policy text.', 'woocommerce-direct-checkout'),
|
139 |
-
'id' => 'qlwcdc_remove_checkout_privacy_policy_text',
|
140 |
-
'type' => 'select',
|
141 |
-
'class' => 'chosen_select qlwcdc-premium-field',
|
142 |
-
'options' => array(
|
143 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
144 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
145 |
-
),
|
146 |
-
'default' => 'no',
|
147 |
-
),
|
148 |
-
array(
|
149 |
-
'name' => esc_html__('Remove checkout terms and conditions', 'woocommerce-direct-checkout'),
|
150 |
-
'desc_tip' => esc_html__('Simplifies the checkout process removing the terms and conditions.', 'woocommerce-direct-checkout'),
|
151 |
-
'id' => 'qlwcdc_remove_checkout_terms_and_conditions',
|
152 |
-
'type' => 'select',
|
153 |
-
'class' => 'chosen_select',
|
154 |
-
'options' => array(
|
155 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
156 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
157 |
-
),
|
158 |
-
'default' => 'no',
|
159 |
-
),
|
160 |
-
array(
|
161 |
-
'name' => esc_html__('Remove checkout gateway icons', 'woocommerce-direct-checkout'),
|
162 |
-
'desc_tip' => esc_html__('Simplifies the checkout view by removing the payment gateway icons.', 'woocommerce-direct-checkout'),
|
163 |
-
'id' => 'qlwcdc_remove_checkout_gateway_icon',
|
164 |
-
'type' => 'select',
|
165 |
-
'class' => 'chosen_select qlwcdc-premium-field',
|
166 |
-
'options' => array(
|
167 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
168 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
169 |
-
),
|
170 |
-
'default' => 'no',
|
171 |
-
),
|
172 |
-
array(
|
173 |
-
'name' => esc_html__('Remove checkout columns', 'woocommerce-direct-checkout'),
|
174 |
-
'desc_tip' => esc_html__('Try to remove the columns and display the checkout form and order review in one column.', 'woocommerce-direct-checkout'),
|
175 |
-
'id' => 'qlwcdc_remove_checkout_columns',
|
176 |
-
'type' => 'select',
|
177 |
-
'class' => 'chosen_select',
|
178 |
-
'options' => array(
|
179 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
180 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
181 |
-
),
|
182 |
-
'default' => 'no',
|
183 |
-
),
|
184 |
-
array(
|
185 |
-
'name' => esc_html__('Remove order details address', 'woocommerce-direct-checkout'),
|
186 |
-
'desc_tip' => esc_html__('Remove the billing address of the customer in the order received page.', 'woocommerce-direct-checkout'),
|
187 |
-
'id' => 'qlwcdc_remove_order_details_address',
|
188 |
-
'type' => 'select',
|
189 |
-
'class' => 'chosen_select',
|
190 |
-
'options' => array(
|
191 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
192 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
193 |
-
),
|
194 |
-
'default' => 'no',
|
195 |
-
),
|
196 |
-
array(
|
197 |
-
'type' => 'sectionend',
|
198 |
-
'id' => 'wc_settings_tab_demo_section_end'
|
199 |
-
)
|
200 |
-
);
|
201 |
-
}
|
202 |
-
|
203 |
-
function add_section() {
|
204 |
-
|
205 |
-
global $current_section;
|
206 |
-
|
207 |
-
if ('checkout' == $current_section) {
|
208 |
-
|
209 |
-
$settings = $this->get_settings();
|
210 |
-
|
211 |
-
include_once( QLWCDC_PLUGIN_DIR . 'includes/pages/checkout.php' );
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
function save_settings() {
|
216 |
-
|
217 |
-
global $current_section;
|
218 |
-
|
219 |
-
if ('checkout' == $current_section) {
|
220 |
-
|
221 |
-
woocommerce_update_options($this->get_settings());
|
222 |
-
}
|
223 |
-
}
|
224 |
-
|
225 |
-
function remove_checkout_fields($fields) {
|
226 |
-
|
227 |
-
if ($remove = get_option('qlwcdc_remove_checkout_fields', array())) {
|
228 |
-
foreach ($remove as $id => $key) {
|
229 |
-
// We need to remove both fields otherwise will be required
|
230 |
-
unset($fields['billing']['billing_' . $key]);
|
231 |
-
unset($fields['shipping']['shipping_' . $key]);
|
232 |
-
}
|
233 |
-
}
|
234 |
-
|
235 |
-
return $fields;
|
236 |
-
}
|
237 |
-
|
238 |
-
function remove_checkout_order_commens($return) {
|
239 |
-
|
240 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_order_comments')) {
|
241 |
-
$return = false;
|
242 |
-
}
|
243 |
-
|
244 |
-
return $return;
|
245 |
-
}
|
246 |
-
|
247 |
-
function remove_checkout_shipping_address($val) {
|
248 |
-
|
249 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_shipping_address')) {
|
250 |
-
$val = 'billing_only';
|
251 |
-
}
|
252 |
-
|
253 |
-
return $val;
|
254 |
-
}
|
255 |
-
|
256 |
-
function init() {
|
257 |
-
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
258 |
-
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
259 |
-
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
260 |
-
add_filter('woocommerce_checkout_fields', array($this, 'remove_checkout_fields'));
|
261 |
-
add_filter('woocommerce_enable_order_notes_field', array($this, 'remove_checkout_order_commens'));
|
262 |
-
add_filter('option_woocommerce_ship_to_destination', array($this, 'remove_checkout_shipping_address'), 10, 3);
|
263 |
-
|
264 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_privacy_policy_text')) {
|
265 |
-
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20);
|
266 |
-
}
|
267 |
-
|
268 |
-
if ('yes' === get_option('qlwcdc_remove_checkout_terms_and_conditions')) {
|
269 |
-
add_filter('woocommerce_checkout_show_terms', '__return_false');
|
270 |
-
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30);
|
271 |
-
}
|
272 |
-
}
|
273 |
-
|
274 |
-
}
|
275 |
-
|
276 |
-
QLWCDC_Checkout::instance();
|
277 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/controller/archives.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_Controller_Archives {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
include_once(QLWCDC_PLUGIN_DIR . '/includes/view/frontend/archives.php');
|
9 |
+
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
10 |
+
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
11 |
+
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
12 |
+
}
|
13 |
+
|
14 |
+
public static function instance() {
|
15 |
+
if (!isset(self::$instance)) {
|
16 |
+
self::$instance = new self();
|
17 |
+
}
|
18 |
+
return self::$instance;
|
19 |
+
}
|
20 |
+
|
21 |
+
function add_header() {
|
22 |
+
global $current_section;
|
23 |
+
?>
|
24 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion=archives'); ?>" class="<?php echo ( $current_section == 'archives' ? 'current' : '' ); ?>"><?php esc_html_e('Archives', 'woocommerce-direct-checkout'); ?></a> | </li>
|
25 |
+
<?php
|
26 |
+
}
|
27 |
+
|
28 |
+
function get_settings() {
|
29 |
+
|
30 |
+
return array(
|
31 |
+
array(
|
32 |
+
'name' => esc_html__('Archives', 'woocommerce-direct-checkout'),
|
33 |
+
'type' => 'title',
|
34 |
+
'id' => 'qlwcdc_archives_section_title'
|
35 |
+
),
|
36 |
+
// array(
|
37 |
+
// 'title' => __('Add to cart behaviour', 'woocommerce-direct-checkout'),
|
38 |
+
// 'desc' => __('Redirect to the cart page after successful addition', 'woocommerce-direct-checkout'),
|
39 |
+
// 'id' => 'woocommerce_cart_redirect_after_add',
|
40 |
+
// 'default' => 'no',
|
41 |
+
// 'type' => 'checkbox',
|
42 |
+
// 'checkboxgroup' => 'start',
|
43 |
+
// ),
|
44 |
+
// array(
|
45 |
+
// 'desc' => __('Enable AJAX add to cart buttons on archives', 'woocommerce-direct-checkout'),
|
46 |
+
// 'id' => 'woocommerce_enable_ajax_add_to_cart',
|
47 |
+
// 'default' => 'yes',
|
48 |
+
// 'type' => 'checkbox',
|
49 |
+
// 'checkboxgroup' => 'end',
|
50 |
+
// ),
|
51 |
+
array(
|
52 |
+
'name' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
53 |
+
'desc_tip' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
54 |
+
'id' => 'qlwcdc_add_archive_text',
|
55 |
+
'type' => 'select',
|
56 |
+
'class' => 'chosen_select',
|
57 |
+
'options' => array(
|
58 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
59 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
60 |
+
),
|
61 |
+
'default' => 'no',
|
62 |
+
),
|
63 |
+
array(
|
64 |
+
'name' => esc_html__('Replace Add to cart text in', 'woocommerce-direct-checkout'),
|
65 |
+
'desc_tip' => esc_html__('Replace "Add to cart" text in product types.', 'woocommerce-direct-checkout'),
|
66 |
+
'id' => 'qlwcdc_add_archive_text_in',
|
67 |
+
'type' => 'multiselect',
|
68 |
+
'class' => 'chosen_select',
|
69 |
+
'options' => array(
|
70 |
+
'simple' => esc_html__('Simple Products', 'woocommerce-direct-checkout'),
|
71 |
+
'grouped' => esc_html__('Grouped Products', 'woocommerce-direct-checkout'),
|
72 |
+
'virtual' => esc_html__('Virtual Products', 'woocommerce-direct-checkout'),
|
73 |
+
'variable' => esc_html__('Variable Products', 'woocommerce-direct-checkout'),
|
74 |
+
'downloadable' => esc_html__('Downloadable Products', 'woocommerce-direct-checkout'),
|
75 |
+
),
|
76 |
+
'default' => array('simple'),
|
77 |
+
),
|
78 |
+
array(
|
79 |
+
'name' => esc_html__('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
80 |
+
'desc_tip' => esc_html__('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
81 |
+
'id' => 'qlwcdc_add_archive_text_content',
|
82 |
+
'type' => 'text',
|
83 |
+
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout'),
|
84 |
+
),
|
85 |
+
array(
|
86 |
+
'name' => esc_html__('Add quick view button', 'woocommerce-direct-checkout'),
|
87 |
+
'desc_tip' => esc_html__('Add product quick view modal button.', 'woocommerce-direct-checkout'),
|
88 |
+
'id' => 'qlwcdc_add_archive_quick_view',
|
89 |
+
'type' => 'select',
|
90 |
+
'class' => 'chosen_select qlwcdc-premium-field',
|
91 |
+
'options' => array(
|
92 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
93 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
94 |
+
),
|
95 |
+
'default' => 'no',
|
96 |
+
),
|
97 |
+
array(
|
98 |
+
'type' => 'sectionend',
|
99 |
+
'id' => 'qlwcdc_archives_section_end'
|
100 |
+
)
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
function add_section() {
|
105 |
+
|
106 |
+
global $current_section;
|
107 |
+
|
108 |
+
if ('archives' == $current_section) {
|
109 |
+
|
110 |
+
$settings = $this->get_settings();
|
111 |
+
|
112 |
+
include_once( QLWCDC_PLUGIN_DIR . 'includes/view/backend/pages/archives.php' );
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
function save_settings() {
|
117 |
+
|
118 |
+
global $current_section;
|
119 |
+
|
120 |
+
if ('archives' == $current_section) {
|
121 |
+
|
122 |
+
woocommerce_update_options($this->get_settings());
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
}
|
127 |
+
|
128 |
+
QLWCDC_Controller_Archives::instance();
|
includes/{backend.php → controller/backend.php}
RENAMED
@@ -5,7 +5,10 @@ class QLWCDC_Backend {
|
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
-
$this
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
public static function instance() {
|
@@ -15,18 +18,13 @@ class QLWCDC_Backend {
|
|
15 |
return self::$_instance;
|
16 |
}
|
17 |
|
18 |
-
private function init() {
|
19 |
-
add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'), 99);
|
20 |
-
add_filter('woocommerce_settings_tabs_array', array($this, 'add_tab'), 50);
|
21 |
-
add_action('admin_menu', array(&$this, 'add_menu'));
|
22 |
-
add_action('admin_footer', array($this, 'remove_premium'));
|
23 |
-
}
|
24 |
-
|
25 |
public function enqueue_scripts() {
|
26 |
|
|
|
|
|
27 |
QLWCDC::instance()->register_scripts();
|
28 |
|
29 |
-
wp_enqueue_script(
|
30 |
}
|
31 |
|
32 |
public function add_tab($settings_tabs) {
|
@@ -44,7 +42,7 @@ class QLWCDC_Backend {
|
|
44 |
(function ($) {
|
45 |
'use strict';
|
46 |
$(window).on('load', function (e) {
|
47 |
-
$('#qlwcdc_options').css({'opacity': '0.5', 'pointer-events': 'none'});
|
48 |
$('label[for=qlwcdc_add_product_ajax]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
49 |
$('label[for=qlwcdc_add_checkout_cart]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
50 |
$('label[for=qlwcdc_add_checkout_cart_fields]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
+
add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'), 99);
|
9 |
+
add_filter('woocommerce_settings_tabs_array', array($this, 'add_tab'), 50);
|
10 |
+
add_action('admin_menu', array(&$this, 'add_menu'));
|
11 |
+
add_action('admin_footer', array($this, 'remove_premium'));
|
12 |
}
|
13 |
|
14 |
public static function instance() {
|
18 |
return self::$_instance;
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
public function enqueue_scripts() {
|
22 |
|
23 |
+
// 1326// filter by page stttings
|
24 |
+
|
25 |
QLWCDC::instance()->register_scripts();
|
26 |
|
27 |
+
wp_enqueue_script('qlwcdc-admin');
|
28 |
}
|
29 |
|
30 |
public function add_tab($settings_tabs) {
|
42 |
(function ($) {
|
43 |
'use strict';
|
44 |
$(window).on('load', function (e) {
|
45 |
+
$('#qlwcdc_options .options_group').css({'opacity': '0.5', 'pointer-events': 'none'});
|
46 |
$('label[for=qlwcdc_add_product_ajax]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
47 |
$('label[for=qlwcdc_add_checkout_cart]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
48 |
$('label[for=qlwcdc_add_checkout_cart_fields]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
|
includes/controller/checkout.php
ADDED
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_Controller_Checkout {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
include_once(QLWCDC_PLUGIN_DIR . '/includes/view/frontend/checkout.php');
|
9 |
+
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
10 |
+
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
11 |
+
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
12 |
+
}
|
13 |
+
|
14 |
+
public static function instance() {
|
15 |
+
if (!isset(self::$instance)) {
|
16 |
+
self::$instance = new self();
|
17 |
+
}
|
18 |
+
return self::$instance;
|
19 |
+
}
|
20 |
+
|
21 |
+
function add_header() {
|
22 |
+
global $current_section;
|
23 |
+
?>
|
24 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion=checkout'); ?>" class="<?php echo ( $current_section == 'checkout' ? 'current' : '' ); ?>"><?php esc_html_e('Checkout', 'woocommerce-direct-checkout'); ?></a> | </li>
|
25 |
+
<?php
|
26 |
+
}
|
27 |
+
|
28 |
+
function get_settings() {
|
29 |
+
|
30 |
+
return array(
|
31 |
+
array(
|
32 |
+
'name' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
33 |
+
'type' => 'title',
|
34 |
+
'id' => 'section_title'
|
35 |
+
),
|
36 |
+
array(
|
37 |
+
'name' => esc_html__('Add cart to checkout', 'woocommerce-direct-checkout'),
|
38 |
+
'desc_tip' => esc_html__('Simplifies the checkout process including the shopping cart page inside checkout.', 'woocommerce-direct-checkout'),
|
39 |
+
'id' => 'qlwcdc_add_checkout_cart',
|
40 |
+
'type' => 'select',
|
41 |
+
'class' => 'chosen_select',
|
42 |
+
'options' => array(
|
43 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
44 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
45 |
+
),
|
46 |
+
'default' => 'no',
|
47 |
+
),
|
48 |
+
array(
|
49 |
+
'name' => esc_html__('Add cart to checkout fields', 'woocommerce-direct-checkout'),
|
50 |
+
'desc_tip' => esc_html__('Include this fields inside the checkout cart.', 'woocommerce-direct-checkout'),
|
51 |
+
'id' => 'qlwcdc_add_checkout_cart_fields',
|
52 |
+
'type' => 'multiselect',
|
53 |
+
'class' => 'chosen_select',
|
54 |
+
'options' => array(
|
55 |
+
'remove' => esc_html__('Remove', 'woocommerce-direct-checkout'),
|
56 |
+
'thumbnail' => esc_html__('Thumbnail', 'woocommerce-direct-checkout'),
|
57 |
+
'name' => esc_html__('Name', 'woocommerce-direct-checkout'),
|
58 |
+
'price' => esc_html__('Price', 'woocommerce-direct-checkout'),
|
59 |
+
'qty' => esc_html__('Quantity', 'woocommerce-direct-checkout'),
|
60 |
+
),
|
61 |
+
'default' => array(
|
62 |
+
0 => 'remove',
|
63 |
+
1 => 'thumbnail',
|
64 |
+
2 => 'price',
|
65 |
+
3 => 'qty',
|
66 |
+
)
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'name' => esc_html__('Remove checkout coupon form', 'woocommerce-direct-checkout'),
|
70 |
+
'desc_tip' => esc_html__('Simplifies the checkout process removing the coupon form.', 'woocommerce-direct-checkout'),
|
71 |
+
'id' => 'qlwcdc_remove_checkout_coupon_form',
|
72 |
+
'type' => 'select',
|
73 |
+
'class' => 'chosen_select',
|
74 |
+
'options' => array(
|
75 |
+
'no' => esc_html__('Leave coupon form', 'woocommerce-direct-checkout'),
|
76 |
+
'remove' => esc_html__('Remove coupon form', 'woocommerce-direct-checkout'),
|
77 |
+
'toggle' => esc_html__('Remove coupon toggle', 'woocommerce-direct-checkout'),
|
78 |
+
'checkout' => esc_html__('Move to checkout order', 'woocommerce-direct-checkout'),
|
79 |
+
),
|
80 |
+
'default' => 'no',
|
81 |
+
),
|
82 |
+
array(
|
83 |
+
'name' => esc_html__('Add custom class to cart table', 'woocommerce-direct-checkout'),
|
84 |
+
'desc_tip' => esc_html__('Add a custom class to the cart table form in the checkot.', 'woocommerce-direct-checkout'),
|
85 |
+
'id' => 'qlwcdc_add_checkout_cart_class',
|
86 |
+
'type' => 'text',
|
87 |
+
'default' => ''
|
88 |
+
),
|
89 |
+
array(
|
90 |
+
'name' => esc_html__('Remove checkout fields', 'qlwe'),
|
91 |
+
'desc_tip' => esc_html__('Simplifies the checkout process removing the unnecessary checkout fields.', 'qlwe'),
|
92 |
+
'id' => 'qlwcdc_remove_checkout_fields',
|
93 |
+
'type' => 'multiselect',
|
94 |
+
'class' => 'chosen_select',
|
95 |
+
'options' => array(
|
96 |
+
'first_name' => esc_html__('First Name', 'qlwe'),
|
97 |
+
'last_name' => esc_html__('Last Name', 'qlwe'),
|
98 |
+
'country' => esc_html__('Country', 'qlwe'),
|
99 |
+
'state' => esc_html__('State', 'qlwe'),
|
100 |
+
'city' => esc_html__('City', 'qlwe'),
|
101 |
+
'postcode' => esc_html__('Postcode', 'qlwe'),
|
102 |
+
'address_1' => esc_html__('Address 1', 'qlwe'),
|
103 |
+
'address_2' => esc_html__('Address 2', 'qlwe'),
|
104 |
+
'company' => esc_html__('Company', 'qlwe'),
|
105 |
+
'phone' => esc_html__('Phone', 'qlwe'),
|
106 |
+
),
|
107 |
+
'default' => array(
|
108 |
+
0 => 'phone',
|
109 |
+
1 => 'company',
|
110 |
+
2 => 'address_2',
|
111 |
+
)
|
112 |
+
),
|
113 |
+
array(
|
114 |
+
'name' => esc_html__('Remove checkout shipping address', 'woocommerce-direct-checkout'),
|
115 |
+
'desc_tip' => esc_html__('Simplifies the checkout process removing the shipping address.', 'woocommerce-direct-checkout'),
|
116 |
+
'id' => 'qlwcdc_remove_checkout_shipping_address',
|
117 |
+
'type' => 'select',
|
118 |
+
'class' => 'chosen_select',
|
119 |
+
'options' => array(
|
120 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
121 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
122 |
+
),
|
123 |
+
'default' => 'no',
|
124 |
+
),
|
125 |
+
array(
|
126 |
+
'name' => esc_html__('Remove checkout order comments', 'woocommerce-direct-checkout'),
|
127 |
+
'desc_tip' => esc_html__('Simplifies the checkout process removing the order notes.', 'woocommerce-direct-checkout'),
|
128 |
+
'id' => 'qlwcdc_remove_checkout_order_comments',
|
129 |
+
'type' => 'select',
|
130 |
+
'class' => 'chosen_select',
|
131 |
+
'options' => array(
|
132 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
133 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
134 |
+
),
|
135 |
+
'default' => 'no',
|
136 |
+
),
|
137 |
+
array(
|
138 |
+
'name' => esc_html__('Remove checkout policy text', 'woocommerce-direct-checkout'),
|
139 |
+
'desc_tip' => esc_html__('Simplifies the checkout process removing the policy text.', 'woocommerce-direct-checkout'),
|
140 |
+
'id' => 'qlwcdc_remove_checkout_privacy_policy_text',
|
141 |
+
'type' => 'select',
|
142 |
+
'class' => 'chosen_select qlwcdc-premium-field',
|
143 |
+
'options' => array(
|
144 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
145 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
146 |
+
),
|
147 |
+
'default' => 'no',
|
148 |
+
),
|
149 |
+
array(
|
150 |
+
'name' => esc_html__('Remove checkout terms and conditions', 'woocommerce-direct-checkout'),
|
151 |
+
'desc_tip' => esc_html__('Simplifies the checkout process removing the terms and conditions.', 'woocommerce-direct-checkout'),
|
152 |
+
'id' => 'qlwcdc_remove_checkout_terms_and_conditions',
|
153 |
+
'type' => 'select',
|
154 |
+
'class' => 'chosen_select',
|
155 |
+
'options' => array(
|
156 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
157 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
158 |
+
),
|
159 |
+
'default' => 'no',
|
160 |
+
),
|
161 |
+
array(
|
162 |
+
'name' => esc_html__('Remove checkout gateway icons', 'woocommerce-direct-checkout'),
|
163 |
+
'desc_tip' => esc_html__('Simplifies the checkout view by removing the payment gateway icons.', 'woocommerce-direct-checkout'),
|
164 |
+
'id' => 'qlwcdc_remove_checkout_gateway_icon',
|
165 |
+
'type' => 'select',
|
166 |
+
'class' => 'chosen_select qlwcdc-premium-field',
|
167 |
+
'options' => array(
|
168 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
169 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
170 |
+
),
|
171 |
+
'default' => 'no',
|
172 |
+
),
|
173 |
+
array(
|
174 |
+
'name' => esc_html__('Remove checkout columns', 'woocommerce-direct-checkout'),
|
175 |
+
'desc_tip' => esc_html__('Try to remove the columns and display the checkout form and order review in one column.', 'woocommerce-direct-checkout'),
|
176 |
+
'id' => 'qlwcdc_remove_checkout_columns',
|
177 |
+
'type' => 'select',
|
178 |
+
'class' => 'chosen_select',
|
179 |
+
'options' => array(
|
180 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
181 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
182 |
+
),
|
183 |
+
'default' => 'no',
|
184 |
+
),
|
185 |
+
array(
|
186 |
+
'name' => esc_html__('Remove order details address', 'woocommerce-direct-checkout'),
|
187 |
+
'desc_tip' => esc_html__('Remove the billing address of the customer in the order received page.', 'woocommerce-direct-checkout'),
|
188 |
+
'id' => 'qlwcdc_remove_order_details_address',
|
189 |
+
'type' => 'select',
|
190 |
+
'class' => 'chosen_select',
|
191 |
+
'options' => array(
|
192 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
193 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
194 |
+
),
|
195 |
+
'default' => 'no',
|
196 |
+
),
|
197 |
+
array(
|
198 |
+
'type' => 'sectionend',
|
199 |
+
'id' => 'wc_settings_tab_demo_section_end'
|
200 |
+
)
|
201 |
+
);
|
202 |
+
}
|
203 |
+
|
204 |
+
function add_section() {
|
205 |
+
|
206 |
+
global $current_section;
|
207 |
+
|
208 |
+
if ('checkout' == $current_section) {
|
209 |
+
|
210 |
+
$settings = $this->get_settings();
|
211 |
+
|
212 |
+
include_once( QLWCDC_PLUGIN_DIR . 'includes/view/backend/pages/checkout.php' );
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
function save_settings() {
|
217 |
+
|
218 |
+
global $current_section;
|
219 |
+
|
220 |
+
if ('checkout' == $current_section) {
|
221 |
+
|
222 |
+
woocommerce_update_options($this->get_settings());
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
function remove_checkout_fields($fields) {
|
227 |
+
|
228 |
+
if ($remove = get_option('qlwcdc_remove_checkout_fields', array())) {
|
229 |
+
foreach ($remove as $id => $key) {
|
230 |
+
// We need to remove both fields otherwise will be required
|
231 |
+
unset($fields['billing']['billing_' . $key]);
|
232 |
+
unset($fields['shipping']['shipping_' . $key]);
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
return $fields;
|
237 |
+
}
|
238 |
+
|
239 |
+
function remove_checkout_order_commens($return) {
|
240 |
+
|
241 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_order_comments')) {
|
242 |
+
$return = false;
|
243 |
+
}
|
244 |
+
|
245 |
+
return $return;
|
246 |
+
}
|
247 |
+
|
248 |
+
function remove_checkout_shipping_address($val) {
|
249 |
+
|
250 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_shipping_address')) {
|
251 |
+
$val = 'billing_only';
|
252 |
+
}
|
253 |
+
|
254 |
+
return $val;
|
255 |
+
}
|
256 |
+
|
257 |
+
}
|
258 |
+
|
259 |
+
QLWCDC_Controller_Checkout::instance();
|
includes/controller/general.php
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_Controller_General {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
|
9 |
+
include_once(QLWCDC_PLUGIN_DIR . '/includes/view/frontend/general.php');
|
10 |
+
|
11 |
+
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
12 |
+
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
13 |
+
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
14 |
+
}
|
15 |
+
|
16 |
+
public static function instance() {
|
17 |
+
if (!isset(self::$instance)) {
|
18 |
+
self::$instance = new self();
|
19 |
+
}
|
20 |
+
return self::$instance;
|
21 |
+
}
|
22 |
+
|
23 |
+
function add_header() {
|
24 |
+
global $current_section;
|
25 |
+
?>
|
26 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion'); ?>" class="<?php echo ( $current_section == '' ? 'current' : '' ); ?>"><?php esc_html_e('General', 'woocommerce-direct-checkout'); ?></a> | </li>
|
27 |
+
<?php
|
28 |
+
}
|
29 |
+
|
30 |
+
function get_settings() {
|
31 |
+
|
32 |
+
return array(
|
33 |
+
array(
|
34 |
+
'name' => esc_html__('General', 'woocommerce-direct-checkout'),
|
35 |
+
'type' => 'title',
|
36 |
+
'desc' => esc_html__('Simplifies the checkout process.', 'woocommerce-direct-checkout'),
|
37 |
+
'id' => 'qlwcdc_section_title'
|
38 |
+
),
|
39 |
+
array(
|
40 |
+
'name' => esc_html__('Added to cart alert', 'woocommerce-direct-checkout'),
|
41 |
+
'desc_tip' => esc_html__('Replace "View Cart" alert with direct checkout.', 'woocommerce-direct-checkout'),
|
42 |
+
'id' => 'qlwcdc_add_to_cart_message',
|
43 |
+
'type' => 'select',
|
44 |
+
'class' => 'chosen_select',
|
45 |
+
'options' => array(
|
46 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
47 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
48 |
+
),
|
49 |
+
'default' => 'no',
|
50 |
+
),
|
51 |
+
array(
|
52 |
+
'name' => esc_html__('Added to cart link', 'woocommerce-direct-checkout'),
|
53 |
+
'desc_tip' => esc_html__('Replace "View Cart" link with direct checkout.', 'woocommerce-direct-checkout'),
|
54 |
+
'id' => 'qlwcdc_add_to_cart_link',
|
55 |
+
'type' => 'select',
|
56 |
+
'class' => 'chosen_select',
|
57 |
+
'options' => array(
|
58 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
59 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
60 |
+
),
|
61 |
+
'default' => 'no',
|
62 |
+
),
|
63 |
+
array(
|
64 |
+
'name' => esc_html__('Added to cart redirect', 'woocommerce-direct-checkout'),
|
65 |
+
'desc_tip' => esc_html__('Add to cart button behaviour.', 'woocommerce-direct-checkout'),
|
66 |
+
'id' => 'qlwcdc_add_to_cart',
|
67 |
+
'type' => 'select',
|
68 |
+
'class' => 'chosen_select',
|
69 |
+
'options' => array(
|
70 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
71 |
+
//'ajax' => esc_html__('Ajax', 'woocommerce-direct-checkout'),
|
72 |
+
'redirect' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
73 |
+
),
|
74 |
+
'default' => 'no',
|
75 |
+
),
|
76 |
+
/* 'add_to_cart_ajax_button' => array(
|
77 |
+
'name' => esc_html__('Added to cart button', 'woocommerce-direct-checkout'),
|
78 |
+
'desc_tip' => esc_html__('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
|
79 |
+
'id' => 'qlwcdc_add_to_cart_ajax_button',
|
80 |
+
'type' => 'select',
|
81 |
+
'options' => array(
|
82 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
83 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
84 |
+
),
|
85 |
+
'default' => 'no',
|
86 |
+
), */
|
87 |
+
/* 'add_to_cart_ajax_message' => array(
|
88 |
+
'name' => esc_html__('Added to cart alert', 'woocommerce-direct-checkout'),
|
89 |
+
'desc_tip' => esc_html__('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
|
90 |
+
'id' => 'qlwcdc_add_to_cart_ajax_message',
|
91 |
+
'type' => 'select',
|
92 |
+
'class' => 'chosen_select',
|
93 |
+
'options' => array(
|
94 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
95 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
96 |
+
),
|
97 |
+
'default' => 'yes',
|
98 |
+
), */
|
99 |
+
array(
|
100 |
+
'name' => esc_html__('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
101 |
+
'desc_tip' => esc_html__('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
102 |
+
'id' => 'qlwcdc_add_to_cart_redirect_page',
|
103 |
+
'type' => 'select',
|
104 |
+
'class' => 'chosen_select',
|
105 |
+
'options' => array(
|
106 |
+
'cart' => esc_html__('Cart', 'woocommerce-direct-checkout'),
|
107 |
+
'checkout' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
108 |
+
'url' => esc_html__('Custom URL', 'woocommerce-direct-checkout'),
|
109 |
+
),
|
110 |
+
'default' => 'cart',
|
111 |
+
),
|
112 |
+
array(
|
113 |
+
'name' => esc_html__('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
114 |
+
'desc_tip' => esc_html__('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
115 |
+
'id' => 'qlwcdc_add_to_cart_redirect_url',
|
116 |
+
'type' => 'text',
|
117 |
+
'placeholder' => wc_get_checkout_url(),
|
118 |
+
),
|
119 |
+
array(
|
120 |
+
'type' => 'sectionend',
|
121 |
+
'id' => 'qlwcdc_section_end'
|
122 |
+
)
|
123 |
+
);
|
124 |
+
}
|
125 |
+
|
126 |
+
function add_section() {
|
127 |
+
|
128 |
+
global $current_section;
|
129 |
+
|
130 |
+
if ('' == $current_section) {
|
131 |
+
|
132 |
+
$settings = $this->get_settings();
|
133 |
+
|
134 |
+
include_once( QLWCDC_PLUGIN_DIR . 'includes/view/backend/pages/general.php' );
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
function save_settings() {
|
139 |
+
|
140 |
+
global $current_section;
|
141 |
+
|
142 |
+
if ('' == $current_section) {
|
143 |
+
|
144 |
+
woocommerce_update_options($this->get_settings());
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
}
|
149 |
+
|
150 |
+
QLWCDC_Controller_General::instance();
|
includes/{premium.php → controller/premium.php}
RENAMED
@@ -1,11 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
-
$this
|
|
|
9 |
}
|
10 |
|
11 |
public static function instance() {
|
@@ -32,7 +33,7 @@ class QLWCDC_Premium {
|
|
32 |
// -------------------------------------------------------------------------
|
33 |
|
34 |
public function add_page() {
|
35 |
-
include_once( QLWCDC_PLUGIN_DIR . '
|
36 |
}
|
37 |
|
38 |
function add_menu() {
|
@@ -40,11 +41,6 @@ class QLWCDC_Premium {
|
|
40 |
add_submenu_page(QLWCDC_PREFIX, esc_html__('Premium', 'woocommerce-checkout-manager'), esc_html__('Premium', 'woocommerce-checkout-manager'), 'manage_woocommerce', QLWCDC_PREFIX, array($this, 'add_page'));
|
41 |
}
|
42 |
|
43 |
-
public function init() {
|
44 |
-
add_action('admin_menu', array($this, 'add_menu'));
|
45 |
-
add_action('admin_head', array($this, 'remove_menu'));
|
46 |
-
}
|
47 |
-
|
48 |
}
|
49 |
|
50 |
-
|
1 |
<?php
|
2 |
|
3 |
+
class QLWCDC_Controller_Premium {
|
4 |
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
+
add_action('admin_menu', array($this, 'add_menu'));
|
9 |
+
add_action('admin_head', array($this, 'remove_menu'));
|
10 |
}
|
11 |
|
12 |
public static function instance() {
|
33 |
// -------------------------------------------------------------------------
|
34 |
|
35 |
public function add_page() {
|
36 |
+
include_once( QLWCDC_PLUGIN_DIR . 'includes/view/backend/pages/premium.php' );
|
37 |
}
|
38 |
|
39 |
function add_menu() {
|
41 |
add_submenu_page(QLWCDC_PREFIX, esc_html__('Premium', 'woocommerce-checkout-manager'), esc_html__('Premium', 'woocommerce-checkout-manager'), 'manage_woocommerce', QLWCDC_PREFIX, array($this, 'add_page'));
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
+
QLWCDC_Controller_Premium::instance();
|
includes/controller/products.php
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_Controller_Products {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
var $product_fields;
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
|
10 |
+
include_once(QLWCDC_PLUGIN_DIR . '/includes/view/frontend/products.php');
|
11 |
+
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
12 |
+
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
13 |
+
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
14 |
+
add_filter('woocommerce_product_data_tabs', array($this, 'add_product_tabs'));
|
15 |
+
add_action('woocommerce_product_data_panels', array($this, 'add_product_tab_content'));
|
16 |
+
}
|
17 |
+
|
18 |
+
public static function instance() {
|
19 |
+
if (!isset(self::$instance)) {
|
20 |
+
self::$instance = new self();
|
21 |
+
}
|
22 |
+
return self::$instance;
|
23 |
+
}
|
24 |
+
|
25 |
+
function add_header() {
|
26 |
+
global $current_section;
|
27 |
+
?>
|
28 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion=products'); ?>" class="<?php echo ( $current_section == 'products' ? 'current' : '' ); ?>"><?php esc_html_e('Products', 'woocommerce-direct-checkout'); ?></a> | </li>
|
29 |
+
<?php
|
30 |
+
}
|
31 |
+
|
32 |
+
function get_settings() {
|
33 |
+
|
34 |
+
return array(
|
35 |
+
array(
|
36 |
+
'name' => esc_html__('Products', 'woocommerce-direct-checkout'),
|
37 |
+
'type' => 'title',
|
38 |
+
'id' => 'qlwcdc_products_section_title'
|
39 |
+
),
|
40 |
+
array(
|
41 |
+
'name' => esc_html__('Add ajax add to cart', 'woocommerce-direct-checkout'),
|
42 |
+
'desc_tip' => esc_html__('Add products to cart via ajax.', 'woocommerce-direct-checkout'),
|
43 |
+
'id' => 'qlwcdc_add_product_ajax',
|
44 |
+
'type' => 'select',
|
45 |
+
'class' => 'chosen_select qlwcdc-premium-field',
|
46 |
+
'options' => array(
|
47 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
48 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
49 |
+
),
|
50 |
+
'default' => 'no',
|
51 |
+
),
|
52 |
+
array(
|
53 |
+
'name' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
54 |
+
'desc_tip' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
55 |
+
'id' => 'qlwcdc_add_product_text',
|
56 |
+
'type' => 'select',
|
57 |
+
'class' => 'chosen_select',
|
58 |
+
'options' => array(
|
59 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
60 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
61 |
+
),
|
62 |
+
'default' => 'no',
|
63 |
+
),
|
64 |
+
array(
|
65 |
+
'name' => esc_html__('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
66 |
+
'desc_tip' => esc_html__('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
67 |
+
'id' => 'qlwcdc_add_product_text_content',
|
68 |
+
'type' => 'text',
|
69 |
+
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout')
|
70 |
+
),
|
71 |
+
array(
|
72 |
+
'name' => esc_html__('Add quick purchase button', 'woocommerce-direct-checkout'),
|
73 |
+
'desc_tip' => esc_html__('Add a quick purchase button to the products pages.', 'woocommerce-direct-checkout'),
|
74 |
+
'id' => 'qlwcdc_add_product_quick_purchase',
|
75 |
+
'type' => 'select',
|
76 |
+
'class' => 'chosen_select',
|
77 |
+
'options' => array(
|
78 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
79 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
80 |
+
),
|
81 |
+
'default' => 'no',
|
82 |
+
),
|
83 |
+
array(
|
84 |
+
'name' => esc_html__('Add quick purchase class', 'woocommerce-direct-checkout'),
|
85 |
+
'desc_tip' => esc_html__('Add a custom class to the quick purchase button.', 'woocommerce-direct-checkout'),
|
86 |
+
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
87 |
+
'type' => 'text',
|
88 |
+
'default' => ''
|
89 |
+
),
|
90 |
+
array(
|
91 |
+
'name' => esc_html__('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
92 |
+
'desc_tip' => esc_html__('Redirect the quick purchase button to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
93 |
+
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
94 |
+
'type' => 'select',
|
95 |
+
'class' => 'chosen_select',
|
96 |
+
'options' => array(
|
97 |
+
'cart' => esc_html__('Cart', 'woocommerce-direct-checkout'),
|
98 |
+
'checkout' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
99 |
+
),
|
100 |
+
'default' => 'checkout',
|
101 |
+
),
|
102 |
+
array(
|
103 |
+
'name' => esc_html__('Add quick purchase text', 'woocommerce-direct-checkout'),
|
104 |
+
'desc_tip' => esc_html__('Add a custom text to the quick purchase button.', 'woocommerce-direct-checkout'),
|
105 |
+
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
106 |
+
'type' => 'text',
|
107 |
+
'default' => esc_html__('Purchase Now', 'woocommerce-direct-checkout')
|
108 |
+
),
|
109 |
+
array(
|
110 |
+
'name' => esc_html__('Add default attributes in variable products', 'woocommerce-direct-checkout'),
|
111 |
+
'desc_tip' => esc_html__('Add default attributes in all variable products to avoid disabled Add to cart button.', 'woocommerce-direct-checkout'),
|
112 |
+
'id' => 'qlwcdc_add_product_default_attributes',
|
113 |
+
'type' => 'select',
|
114 |
+
'class' => 'chosen_select',
|
115 |
+
'options' => array(
|
116 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
117 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
118 |
+
),
|
119 |
+
'default' => 'no',
|
120 |
+
),
|
121 |
+
array(
|
122 |
+
'type' => 'sectionend',
|
123 |
+
'id' => 'qlwcdc_products_section_end'
|
124 |
+
)
|
125 |
+
);
|
126 |
+
}
|
127 |
+
|
128 |
+
function add_section() {
|
129 |
+
|
130 |
+
global $current_section;
|
131 |
+
|
132 |
+
if ('products' == $current_section) {
|
133 |
+
|
134 |
+
$settings = $this->get_settings();
|
135 |
+
|
136 |
+
include_once( QLWCDC_PLUGIN_DIR . 'includes/view/backend/pages/products.php' );
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
function save_settings() {
|
141 |
+
|
142 |
+
global $current_section;
|
143 |
+
|
144 |
+
if ('products' == $current_section) {
|
145 |
+
|
146 |
+
woocommerce_update_options($this->get_settings());
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
function add_product_fields() {
|
151 |
+
|
152 |
+
global $thepostid;
|
153 |
+
|
154 |
+
if ($this->product_fields)
|
155 |
+
return;
|
156 |
+
|
157 |
+
// Fields
|
158 |
+
$this->product_fields = array(
|
159 |
+
'start_group',
|
160 |
+
array(
|
161 |
+
'label' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
162 |
+
'desc_tip' => true,
|
163 |
+
'description' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
164 |
+
'id' => 'qlwcdc_add_product_text',
|
165 |
+
'type' => 'select',
|
166 |
+
'options' => array(
|
167 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
168 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
169 |
+
),
|
170 |
+
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_text', 'no'),
|
171 |
+
),
|
172 |
+
array(
|
173 |
+
'label' => esc_html__('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
174 |
+
'desc_tip' => true,
|
175 |
+
'description' => esc_html__('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
176 |
+
'id' => 'qlwcdc_add_product_text_content',
|
177 |
+
'type' => 'text',
|
178 |
+
'placeholder' => get_option('qlwcdc_add_product_text_content'),
|
179 |
+
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_text_content'),
|
180 |
+
),
|
181 |
+
'start_group',
|
182 |
+
'end_group',
|
183 |
+
array(
|
184 |
+
'label' => esc_html__('Add quick purchase button', 'woocommerce-direct-checkout'),
|
185 |
+
'desc_tip' => true,
|
186 |
+
'description' => esc_html__('Add quick purchase button to single product page.', 'woocommerce-direct-checkout'),
|
187 |
+
'id' => 'qlwcdc_add_product_quick_purchase',
|
188 |
+
'class' => 'short',
|
189 |
+
'type' => 'select',
|
190 |
+
'options' => array(
|
191 |
+
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
192 |
+
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
193 |
+
),
|
194 |
+
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase', 'no')
|
195 |
+
),
|
196 |
+
array(
|
197 |
+
'label' => esc_html__('Add quick purchase class', 'woocommerce-direct-checkout'),
|
198 |
+
'desc_tip' => true,
|
199 |
+
'description' => esc_html__('Add quick purchase custom class.', 'woocommerce-direct-checkout'),
|
200 |
+
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
201 |
+
'type' => 'text',
|
202 |
+
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_class'),
|
203 |
+
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_class'),
|
204 |
+
),
|
205 |
+
array(
|
206 |
+
'label' => esc_html__('Add quick purchase text', 'woocommerce-direct-checkout'),
|
207 |
+
'desc_tip' => true,
|
208 |
+
'description' => esc_html__('Add quick purchase custom text.', 'woocommerce-direct-checkout'),
|
209 |
+
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
210 |
+
'type' => 'text',
|
211 |
+
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_text'),
|
212 |
+
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_text'),
|
213 |
+
),
|
214 |
+
array(
|
215 |
+
'label' => esc_html__('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
216 |
+
'desc_tip' => true,
|
217 |
+
'description' => esc_html__('Redirect quick purchase to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
218 |
+
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
219 |
+
'type' => 'select',
|
220 |
+
'options' => array(
|
221 |
+
'cart' => esc_html__('Cart', 'woocommerce-direct-checkout'),
|
222 |
+
'checkout' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
223 |
+
),
|
224 |
+
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_to', 'checkout'),
|
225 |
+
),
|
226 |
+
'end_group',
|
227 |
+
);
|
228 |
+
}
|
229 |
+
|
230 |
+
function add_product_tabs($tabs) {
|
231 |
+
|
232 |
+
$tabs[QLWCDC_PREFIX] = array(
|
233 |
+
'label' => esc_html__('Direct Checkout', 'woocommerce-direct-checkout'),
|
234 |
+
'target' => 'qlwcdc_options',
|
235 |
+
);
|
236 |
+
|
237 |
+
return $tabs;
|
238 |
+
}
|
239 |
+
|
240 |
+
function add_setting_field($field) {
|
241 |
+
|
242 |
+
if (!isset($field['id'])) {
|
243 |
+
if ($field == 'start_group') {
|
244 |
+
echo '<div class="options_group">';
|
245 |
+
} elseif ($field == 'end_group') {
|
246 |
+
echo '</div>';
|
247 |
+
}
|
248 |
+
} else {
|
249 |
+
|
250 |
+
if (function_exists($function = 'woocommerce_wp_' . $field['type'])) {
|
251 |
+
$function($field);
|
252 |
+
} elseif (function_exists($function = 'woocommerce_wp_' . $field['type'] . '_input')) {
|
253 |
+
$function($field);
|
254 |
+
} else {
|
255 |
+
woocommerce_wp_text_input($field);
|
256 |
+
}
|
257 |
+
}
|
258 |
+
}
|
259 |
+
|
260 |
+
function add_product_tab_content() {
|
261 |
+
|
262 |
+
$this->add_product_fields();
|
263 |
+
?>
|
264 |
+
<div id="qlwcdc_options" class="panel woocommerce_options_panel" style="display: none;">
|
265 |
+
<?php
|
266 |
+
foreach ($this->product_fields as $field) {
|
267 |
+
$this->add_setting_field($field);
|
268 |
+
}
|
269 |
+
?>
|
270 |
+
<div style="font-size: 1.1em;" class="marketplace-suggestions-container">
|
271 |
+
<div style="padding: 1em 1.5em;overflow: hidden;" class="marketplace-suggestion-container">
|
272 |
+
<div style="float:right;"><a target="blank" class="marketplace-suggestion-manage-link linkout" href="<?php echo QLWCDC_DOCUMENTATION_URL; ?>"><?php esc_html_e('Documentation', 'woocommerce-direct-checkout'); ?></a></div>
|
273 |
+
<div style="float:left;"><a style="text-decoration:none" target="blank" href="<?php echo QLWCDC_PURCHASE_URL; ?>" class="linkout"><?php esc_html_e('Purchase Now', 'woocommerce-direct-checkout'); ?><span style="margin-left: 4px;bottom: 2px;position: relative;" class="dashicons dashicons-external"></span></a></div>
|
274 |
+
</div>
|
275 |
+
</div>
|
276 |
+
</div>
|
277 |
+
<?php
|
278 |
+
}
|
279 |
+
|
280 |
+
}
|
281 |
+
|
282 |
+
QLWCDC_Controller_Products::instance();
|
includes/{suggestions.php → controller/suggestions.php}
RENAMED
@@ -1,11 +1,13 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
-
$this
|
|
|
|
|
9 |
}
|
10 |
|
11 |
public static function instance() {
|
@@ -20,7 +22,7 @@ class QLWCDC_Suggestions {
|
|
20 |
|
21 |
public function add_page() {
|
22 |
include_once( QLWCDC_PLUGIN_DIR . 'includes/suggestions-list-table.php' );
|
23 |
-
include_once( QLWCDC_PLUGIN_DIR . 'includes/pages/suggestions.php' );
|
24 |
}
|
25 |
|
26 |
public function add_menu() {
|
@@ -50,13 +52,7 @@ class QLWCDC_Suggestions {
|
|
50 |
}
|
51 |
}
|
52 |
|
53 |
-
public function init() {
|
54 |
-
add_action('admin_menu', array($this, 'add_menu'));
|
55 |
-
add_action('admin_init', array($this, 'add_redirect'));
|
56 |
-
add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
|
57 |
-
}
|
58 |
-
|
59 |
}
|
60 |
|
61 |
-
|
62 |
|
1 |
<?php
|
2 |
|
3 |
+
class QLWCDC_Controller_Suggestions {
|
4 |
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
+
add_action('admin_menu', array($this, 'add_menu'));
|
9 |
+
add_action('admin_init', array($this, 'add_redirect'));
|
10 |
+
add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
|
11 |
}
|
12 |
|
13 |
public static function instance() {
|
22 |
|
23 |
public function add_page() {
|
24 |
include_once( QLWCDC_PLUGIN_DIR . 'includes/suggestions-list-table.php' );
|
25 |
+
include_once( QLWCDC_PLUGIN_DIR . 'includes/view/backend/pages/suggestions.php' );
|
26 |
}
|
27 |
|
28 |
public function add_menu() {
|
52 |
}
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
+
QLWCDC_Controller_Suggestions::instance();
|
58 |
|
includes/frontend.php
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class QLWCDC_Frontend {
|
4 |
-
|
5 |
-
protected static $_instance;
|
6 |
-
|
7 |
-
public function __construct() {
|
8 |
-
$this->init();
|
9 |
-
}
|
10 |
-
|
11 |
-
public static function instance() {
|
12 |
-
if (is_null(self::$_instance)) {
|
13 |
-
self::$_instance = new self();
|
14 |
-
}
|
15 |
-
return self::$_instance;
|
16 |
-
}
|
17 |
-
|
18 |
-
private function init() {
|
19 |
-
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'), 99);
|
20 |
-
}
|
21 |
-
|
22 |
-
public function enqueue_scripts() {
|
23 |
-
|
24 |
-
QLWCDC::instance()->register_scripts();
|
25 |
-
|
26 |
-
wp_enqueue_style(QLWCDC_PREFIX);
|
27 |
-
wp_enqueue_script(QLWCDC_PREFIX);
|
28 |
-
}
|
29 |
-
|
30 |
-
}
|
31 |
-
|
32 |
-
QLWCDC_Frontend::instance();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/general.php
DELETED
@@ -1,200 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
die('-1');
|
4 |
-
}
|
5 |
-
|
6 |
-
if (!class_exists('QLWCDC_General')) {
|
7 |
-
|
8 |
-
class QLWCDC_General {
|
9 |
-
|
10 |
-
protected static $instance;
|
11 |
-
|
12 |
-
public static function instance() {
|
13 |
-
if (!isset(self::$instance)) {
|
14 |
-
self::$instance = new self();
|
15 |
-
self::$instance->init();
|
16 |
-
}
|
17 |
-
return self::$instance;
|
18 |
-
}
|
19 |
-
|
20 |
-
function add_header() {
|
21 |
-
global $current_section;
|
22 |
-
?>
|
23 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion'); ?>" class="<?php echo ( $current_section == '' ? 'current' : '' ); ?>"><?php esc_html_e('General', 'woocommerce-direct-checkout'); ?></a> | </li>
|
24 |
-
<?php
|
25 |
-
}
|
26 |
-
|
27 |
-
function get_settings() {
|
28 |
-
|
29 |
-
return array(
|
30 |
-
array(
|
31 |
-
'name' => esc_html__('General', 'woocommerce-direct-checkout'),
|
32 |
-
'type' => 'title',
|
33 |
-
'desc' => esc_html__('Simplifies the checkout process.', 'woocommerce-direct-checkout'),
|
34 |
-
'id' => 'qlwcdc_section_title'
|
35 |
-
),
|
36 |
-
array(
|
37 |
-
'name' => esc_html__('Added to cart alert', 'woocommerce-direct-checkout'),
|
38 |
-
'desc_tip' => esc_html__('Replace "View Cart" alert with direct checkout.', 'woocommerce-direct-checkout'),
|
39 |
-
'id' => 'qlwcdc_add_to_cart_message',
|
40 |
-
'type' => 'select',
|
41 |
-
'class' => 'chosen_select',
|
42 |
-
'options' => array(
|
43 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
44 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
45 |
-
),
|
46 |
-
'default' => 'no',
|
47 |
-
),
|
48 |
-
array(
|
49 |
-
'name' => esc_html__('Added to cart link', 'woocommerce-direct-checkout'),
|
50 |
-
'desc_tip' => esc_html__('Replace "View Cart" link with direct checkout.', 'woocommerce-direct-checkout'),
|
51 |
-
'id' => 'qlwcdc_add_to_cart_link',
|
52 |
-
'type' => 'select',
|
53 |
-
'class' => 'chosen_select',
|
54 |
-
'options' => array(
|
55 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
56 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
57 |
-
),
|
58 |
-
'default' => 'no',
|
59 |
-
),
|
60 |
-
array(
|
61 |
-
'name' => esc_html__('Added to cart redirect', 'woocommerce-direct-checkout'),
|
62 |
-
'desc_tip' => esc_html__('Add to cart button behaviour.', 'woocommerce-direct-checkout'),
|
63 |
-
'id' => 'qlwcdc_add_to_cart',
|
64 |
-
'type' => 'select',
|
65 |
-
'class' => 'chosen_select',
|
66 |
-
'options' => array(
|
67 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
68 |
-
//'ajax' => esc_html__('Ajax', 'woocommerce-direct-checkout'),
|
69 |
-
'redirect' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
70 |
-
),
|
71 |
-
'default' => 'no',
|
72 |
-
),
|
73 |
-
/* 'add_to_cart_ajax_button' => array(
|
74 |
-
'name' => esc_html__('Added to cart button', 'woocommerce-direct-checkout'),
|
75 |
-
'desc_tip' => esc_html__('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
|
76 |
-
'id' => 'qlwcdc_add_to_cart_ajax_button',
|
77 |
-
'type' => 'select',
|
78 |
-
'options' => array(
|
79 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
80 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
81 |
-
),
|
82 |
-
'default' => 'no',
|
83 |
-
), */
|
84 |
-
/* 'add_to_cart_ajax_message' => array(
|
85 |
-
'name' => esc_html__('Added to cart alert', 'woocommerce-direct-checkout'),
|
86 |
-
'desc_tip' => esc_html__('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
|
87 |
-
'id' => 'qlwcdc_add_to_cart_ajax_message',
|
88 |
-
'type' => 'select',
|
89 |
-
'class' => 'chosen_select',
|
90 |
-
'options' => array(
|
91 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
92 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
93 |
-
),
|
94 |
-
'default' => 'yes',
|
95 |
-
), */
|
96 |
-
array(
|
97 |
-
'name' => esc_html__('Added to cart redirect to', 'woocommerce-direct-checkout'),
|
98 |
-
'desc_tip' => esc_html__('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
99 |
-
'id' => 'qlwcdc_add_to_cart_redirect_page',
|
100 |
-
'type' => 'select',
|
101 |
-
'class' => 'chosen_select',
|
102 |
-
'options' => array(
|
103 |
-
'cart' => esc_html__('Cart', 'woocommerce-direct-checkout'),
|
104 |
-
'checkout' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
105 |
-
'url' => esc_html__('Custom URL', 'woocommerce-direct-checkout'),
|
106 |
-
),
|
107 |
-
'default' => 'cart',
|
108 |
-
),
|
109 |
-
array(
|
110 |
-
'name' => esc_html__('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
|
111 |
-
'desc_tip' => esc_html__('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
|
112 |
-
'id' => 'qlwcdc_add_to_cart_redirect_url',
|
113 |
-
'type' => 'text',
|
114 |
-
'placeholder' => wc_get_checkout_url(),
|
115 |
-
),
|
116 |
-
array(
|
117 |
-
'type' => 'sectionend',
|
118 |
-
'id' => 'qlwcdc_section_end'
|
119 |
-
)
|
120 |
-
);
|
121 |
-
}
|
122 |
-
|
123 |
-
function add_section() {
|
124 |
-
|
125 |
-
global $current_section;
|
126 |
-
|
127 |
-
if ('' == $current_section) {
|
128 |
-
|
129 |
-
$settings = $this->get_settings();
|
130 |
-
|
131 |
-
include_once( QLWCDC_PLUGIN_DIR . 'includes/pages/general.php' );
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
function save_settings() {
|
136 |
-
|
137 |
-
global $current_section;
|
138 |
-
|
139 |
-
if ('' == $current_section) {
|
140 |
-
|
141 |
-
woocommerce_update_options($this->get_settings());
|
142 |
-
}
|
143 |
-
}
|
144 |
-
|
145 |
-
function add_to_cart_params($params) {
|
146 |
-
|
147 |
-
if ('yes' === get_option('qlwcdc_add_to_cart_link')) {
|
148 |
-
$params['cart_url'] = wc_get_checkout_url();
|
149 |
-
$params['i18n_view_cart'] = esc_html__('Checkout', 'woocommerce-direct-checkout');
|
150 |
-
}
|
151 |
-
|
152 |
-
return $params;
|
153 |
-
}
|
154 |
-
|
155 |
-
function add_to_cart_message($message) {
|
156 |
-
|
157 |
-
if ('yes' === get_option('qlwcdc_add_to_cart_message')) {
|
158 |
-
|
159 |
-
$message = str_replace(wc_get_page_permalink('cart'), wc_get_page_permalink('checkout'), $message);
|
160 |
-
|
161 |
-
$message = str_replace(esc_html__('View cart', 'woocommerce'), esc_html__('Checkout', 'woocommerce'), $message);
|
162 |
-
}
|
163 |
-
|
164 |
-
return $message;
|
165 |
-
}
|
166 |
-
|
167 |
-
function add_to_cart_redirect($url) {
|
168 |
-
|
169 |
-
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
170 |
-
if ('cart' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
171 |
-
$url = wc_get_cart_url();
|
172 |
-
} elseif ('url' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
173 |
-
$url = get_option('qlwcdc_add_to_cart_redirect_url');
|
174 |
-
} else {
|
175 |
-
$url = wc_get_checkout_url();
|
176 |
-
}
|
177 |
-
}
|
178 |
-
|
179 |
-
return $url;
|
180 |
-
}
|
181 |
-
|
182 |
-
function init() {
|
183 |
-
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
184 |
-
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
185 |
-
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
186 |
-
|
187 |
-
add_filter('woocommerce_get_script_data', array($this, 'add_to_cart_params'));
|
188 |
-
add_filter('wc_add_to_cart_message_html', array($this, 'add_to_cart_message'));
|
189 |
-
add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
|
190 |
-
|
191 |
-
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
192 |
-
add_filter('option_woocommerce_enable_ajax_add_to_cart', '__return_false');
|
193 |
-
add_filter('option_woocommerce_cart_redirect_after_add', '__return_false');
|
194 |
-
}
|
195 |
-
}
|
196 |
-
|
197 |
-
}
|
198 |
-
|
199 |
-
QLWCDC_General::instance();
|
200 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/notices.php
CHANGED
@@ -5,7 +5,9 @@ class QLWCDC_Notices {
|
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
-
$this
|
|
|
|
|
9 |
}
|
10 |
|
11 |
public static function instance() {
|
@@ -14,13 +16,7 @@ class QLWCDC_Notices {
|
|
14 |
}
|
15 |
return self::$_instance;
|
16 |
}
|
17 |
-
|
18 |
-
private function init() {
|
19 |
-
add_action('wp_ajax_qlwcdc_dismiss_notice', array($this, 'ajax_dismiss_notice'));
|
20 |
-
add_action('admin_notices', array($this, 'add_notices'));
|
21 |
-
add_filter('plugin_action_links_' . plugin_basename(QLWCDC_PLUGIN_FILE), array($this, 'add_action_links'));
|
22 |
-
}
|
23 |
-
|
24 |
public function ajax_dismiss_notice() {
|
25 |
|
26 |
if (check_admin_referer('qlwcdc_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
|
@@ -48,13 +44,13 @@ class QLWCDC_Notices {
|
|
48 |
<p>
|
49 |
<?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout'), QLWCDC_PLUGIN_NAME); ?>
|
50 |
<br/>
|
51 |
-
|
52 |
</p>
|
53 |
<a href="<?php echo esc_url(QLWCDC_REVIEW_URL); ?>" class="button-primary" target="_blank">
|
54 |
-
|
55 |
</a>
|
56 |
<a href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
57 |
-
|
58 |
</a>
|
59 |
</div>
|
60 |
</div>
|
5 |
protected static $_instance;
|
6 |
|
7 |
public function __construct() {
|
8 |
+
add_action('wp_ajax_qlwcdc_dismiss_notice', array($this, 'ajax_dismiss_notice'));
|
9 |
+
add_action('admin_notices', array($this, 'add_notices'));
|
10 |
+
add_filter('plugin_action_links_' . plugin_basename(QLWCDC_PLUGIN_FILE), array($this, 'add_action_links'));
|
11 |
}
|
12 |
|
13 |
public static function instance() {
|
16 |
}
|
17 |
return self::$_instance;
|
18 |
}
|
19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
public function ajax_dismiss_notice() {
|
21 |
|
22 |
if (check_admin_referer('qlwcdc_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
|
44 |
<p>
|
45 |
<?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'woocommerce-direct-checkout'), QLWCDC_PLUGIN_NAME); ?>
|
46 |
<br/>
|
47 |
+
<?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'); ?>
|
48 |
</p>
|
49 |
<a href="<?php echo esc_url(QLWCDC_REVIEW_URL); ?>" class="button-primary" target="_blank">
|
50 |
+
<?php esc_html_e('Yes, of course!', 'woocommerce-direct-checkout'); ?>
|
51 |
</a>
|
52 |
<a href="<?php echo esc_url(QLWCDC_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
|
53 |
+
<?php esc_html_e('Report a bug', 'woocommerce-direct-checkout'); ?>
|
54 |
</a>
|
55 |
</div>
|
56 |
</div>
|
includes/products.php
DELETED
@@ -1,322 +0,0 @@
|
|
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_header() {
|
14 |
-
global $current_section;
|
15 |
-
?>
|
16 |
-
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion=products'); ?>" class="<?php echo ( $current_section == 'products' ? 'current' : '' ); ?>"><?php esc_html_e('Products', 'woocommerce-direct-checkout'); ?></a> | </li>
|
17 |
-
<?php
|
18 |
-
}
|
19 |
-
|
20 |
-
function get_settings() {
|
21 |
-
|
22 |
-
return array(
|
23 |
-
array(
|
24 |
-
'name' => esc_html__('Products', 'woocommerce-direct-checkout'),
|
25 |
-
'type' => 'title',
|
26 |
-
'id' => 'qlwcdc_products_section_title'
|
27 |
-
),
|
28 |
-
array(
|
29 |
-
'name' => esc_html__('Add ajax add to cart', 'woocommerce-direct-checkout'),
|
30 |
-
'desc_tip' => esc_html__('Add products to cart via ajax.', 'woocommerce-direct-checkout'),
|
31 |
-
'id' => 'qlwcdc_add_product_ajax',
|
32 |
-
'type' => 'select',
|
33 |
-
'class' => 'chosen_select qlwcdc-premium-field',
|
34 |
-
'options' => array(
|
35 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
36 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
37 |
-
),
|
38 |
-
'default' => 'no',
|
39 |
-
),
|
40 |
-
array(
|
41 |
-
'name' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
42 |
-
'desc_tip' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
43 |
-
'id' => 'qlwcdc_add_product_text',
|
44 |
-
'type' => 'select',
|
45 |
-
'class' => 'chosen_select',
|
46 |
-
'options' => array(
|
47 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
48 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
49 |
-
),
|
50 |
-
'default' => 'no',
|
51 |
-
),
|
52 |
-
array(
|
53 |
-
'name' => esc_html__('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
54 |
-
'desc_tip' => esc_html__('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
55 |
-
'id' => 'qlwcdc_add_product_text_content',
|
56 |
-
'type' => 'text',
|
57 |
-
'default' => esc_html__('Purchase', 'woocommerce-direct-checkout')
|
58 |
-
),
|
59 |
-
array(
|
60 |
-
'name' => esc_html__('Add quick purchase button', 'woocommerce-direct-checkout'),
|
61 |
-
'desc_tip' => esc_html__('Add a quick purchase button to the products pages.', 'woocommerce-direct-checkout'),
|
62 |
-
'id' => 'qlwcdc_add_product_quick_purchase',
|
63 |
-
'type' => 'select',
|
64 |
-
'class' => 'chosen_select',
|
65 |
-
'options' => array(
|
66 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
67 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
68 |
-
),
|
69 |
-
'default' => 'no',
|
70 |
-
),
|
71 |
-
array(
|
72 |
-
'name' => esc_html__('Add quick purchase class', 'woocommerce-direct-checkout'),
|
73 |
-
'desc_tip' => esc_html__('Add a custom class to the quick purchase button.', 'woocommerce-direct-checkout'),
|
74 |
-
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
75 |
-
'type' => 'text',
|
76 |
-
'default' => ''
|
77 |
-
),
|
78 |
-
array(
|
79 |
-
'name' => esc_html__('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
80 |
-
'desc_tip' => esc_html__('Redirect the quick purchase button to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
81 |
-
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
82 |
-
'type' => 'select',
|
83 |
-
'class' => 'chosen_select',
|
84 |
-
'options' => array(
|
85 |
-
'cart' => esc_html__('Cart', 'woocommerce-direct-checkout'),
|
86 |
-
'checkout' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
87 |
-
),
|
88 |
-
'default' => 'checkout',
|
89 |
-
),
|
90 |
-
array(
|
91 |
-
'name' => esc_html__('Add quick purchase text', 'woocommerce-direct-checkout'),
|
92 |
-
'desc_tip' => esc_html__('Add a custom text to the quick purchase button.', 'woocommerce-direct-checkout'),
|
93 |
-
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
94 |
-
'type' => 'text',
|
95 |
-
'default' => esc_html__('Purchase Now', 'woocommerce-direct-checkout')
|
96 |
-
),
|
97 |
-
array(
|
98 |
-
'name' => esc_html__('Add default attributes in variable products', 'woocommerce-direct-checkout'),
|
99 |
-
'desc_tip' => esc_html__('Add default attributes in all variable products to avoid disabled Add to cart button.', 'woocommerce-direct-checkout'),
|
100 |
-
'id' => 'qlwcdc_add_product_default_attributes',
|
101 |
-
'type' => 'select',
|
102 |
-
'class' => 'chosen_select',
|
103 |
-
'options' => array(
|
104 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
105 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
106 |
-
),
|
107 |
-
'default' => 'no',
|
108 |
-
),
|
109 |
-
array(
|
110 |
-
'type' => 'sectionend',
|
111 |
-
'id' => 'qlwcdc_products_section_end'
|
112 |
-
)
|
113 |
-
);
|
114 |
-
}
|
115 |
-
|
116 |
-
function add_section() {
|
117 |
-
|
118 |
-
global $current_section;
|
119 |
-
|
120 |
-
if ('products' == $current_section) {
|
121 |
-
|
122 |
-
$settings = $this->get_settings();
|
123 |
-
|
124 |
-
include_once( QLWCDC_PLUGIN_DIR . 'includes/pages/products.php' );
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
function save_settings() {
|
129 |
-
|
130 |
-
global $current_section;
|
131 |
-
|
132 |
-
if ('products' == $current_section) {
|
133 |
-
|
134 |
-
woocommerce_update_options($this->get_settings());
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
function add_product_fields() {
|
139 |
-
|
140 |
-
global $thepostid;
|
141 |
-
|
142 |
-
if ($this->product_fields)
|
143 |
-
return;
|
144 |
-
|
145 |
-
// Fields
|
146 |
-
$this->product_fields = array(
|
147 |
-
'start_group',
|
148 |
-
array(
|
149 |
-
'label' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
|
150 |
-
'desc_tip' => true,
|
151 |
-
'description' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
|
152 |
-
'id' => 'qlwcdc_add_product_text',
|
153 |
-
'type' => 'select',
|
154 |
-
'options' => array(
|
155 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
156 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
157 |
-
),
|
158 |
-
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_text', 'no'),
|
159 |
-
),
|
160 |
-
array(
|
161 |
-
'label' => esc_html__('Replace Add to cart text content', 'woocommerce-direct-checkout'),
|
162 |
-
'desc_tip' => true,
|
163 |
-
'description' => esc_html__('Replace "Add to cart" text with this text.', 'woocommerce-direct-checkout'),
|
164 |
-
'id' => 'qlwcdc_add_product_text_content',
|
165 |
-
'type' => 'text',
|
166 |
-
'placeholder' => get_option('qlwcdc_add_product_text_content'),
|
167 |
-
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_text_content'),
|
168 |
-
),
|
169 |
-
'start_group',
|
170 |
-
'end_group',
|
171 |
-
array(
|
172 |
-
'label' => esc_html__('Add quick purchase button', 'woocommerce-direct-checkout'),
|
173 |
-
'desc_tip' => true,
|
174 |
-
'description' => esc_html__('Add quick purchase button to single product page.', 'woocommerce-direct-checkout'),
|
175 |
-
'id' => 'qlwcdc_add_product_quick_purchase',
|
176 |
-
'class' => 'short',
|
177 |
-
'type' => 'select',
|
178 |
-
'options' => array(
|
179 |
-
'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
|
180 |
-
'no' => esc_html__('No', 'woocommerce-direct-checkout'),
|
181 |
-
),
|
182 |
-
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase', 'no')
|
183 |
-
),
|
184 |
-
array(
|
185 |
-
'label' => esc_html__('Add quick purchase class', 'woocommerce-direct-checkout'),
|
186 |
-
'desc_tip' => true,
|
187 |
-
'description' => esc_html__('Add quick purchase custom class.', 'woocommerce-direct-checkout'),
|
188 |
-
'id' => 'qlwcdc_add_product_quick_purchase_class',
|
189 |
-
'type' => 'text',
|
190 |
-
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_class'),
|
191 |
-
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_class'),
|
192 |
-
),
|
193 |
-
array(
|
194 |
-
'label' => esc_html__('Add quick purchase text', 'woocommerce-direct-checkout'),
|
195 |
-
'desc_tip' => true,
|
196 |
-
'description' => esc_html__('Add quick purchase custom text.', 'woocommerce-direct-checkout'),
|
197 |
-
'id' => 'qlwcdc_add_product_quick_purchase_text',
|
198 |
-
'type' => 'text',
|
199 |
-
'placeholder' => get_option('qlwcdc_add_product_quick_purchase_text'),
|
200 |
-
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_text'),
|
201 |
-
),
|
202 |
-
array(
|
203 |
-
'label' => esc_html__('Redirect quick purchase to', 'woocommerce-direct-checkout'),
|
204 |
-
'desc_tip' => true,
|
205 |
-
'description' => esc_html__('Redirect quick purchase to the cart or checkout page.', 'woocommerce-direct-checkout'),
|
206 |
-
'id' => 'qlwcdc_add_product_quick_purchase_to',
|
207 |
-
'type' => 'select',
|
208 |
-
'options' => array(
|
209 |
-
'cart' => esc_html__('Cart', 'woocommerce-direct-checkout'),
|
210 |
-
'checkout' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
|
211 |
-
),
|
212 |
-
'value' => QLWCDC::instance()->get_product_option($thepostid, 'qlwcdc_add_product_quick_purchase_to', 'checkout'),
|
213 |
-
),
|
214 |
-
'end_group',
|
215 |
-
);
|
216 |
-
}
|
217 |
-
|
218 |
-
function add_product_tabs($tabs) {
|
219 |
-
|
220 |
-
$tabs[QLWCDC_PREFIX] = array(
|
221 |
-
'label' => esc_html__('Direct Checkout', 'woocommerce-direct-checkout'),
|
222 |
-
'target' => 'qlwcdc_options',
|
223 |
-
);
|
224 |
-
|
225 |
-
return $tabs;
|
226 |
-
}
|
227 |
-
|
228 |
-
function add_setting_field($field) {
|
229 |
-
|
230 |
-
if (!isset($field['id'])) {
|
231 |
-
if ($field == 'start_group') {
|
232 |
-
echo '<div class="options_group">';
|
233 |
-
} elseif ($field == 'end_group') {
|
234 |
-
echo '</div>';
|
235 |
-
}
|
236 |
-
} else {
|
237 |
-
|
238 |
-
if (function_exists($function = 'woocommerce_wp_' . $field['type'])) {
|
239 |
-
$function($field);
|
240 |
-
} elseif (function_exists($function = 'woocommerce_wp_' . $field['type'] . '_input')) {
|
241 |
-
$function($field);
|
242 |
-
} else {
|
243 |
-
woocommerce_wp_text_input($field);
|
244 |
-
}
|
245 |
-
}
|
246 |
-
}
|
247 |
-
|
248 |
-
function add_product_tab_content() {
|
249 |
-
|
250 |
-
$this->add_product_fields();
|
251 |
-
?>
|
252 |
-
<div id="qlwcdc_options" class="panel woocommerce_options_panel" style="display: none;">
|
253 |
-
<?php
|
254 |
-
foreach ($this->product_fields as $field) {
|
255 |
-
$this->add_setting_field($field);
|
256 |
-
}
|
257 |
-
?>
|
258 |
-
<div style="font-size: 1.1em;" class="marketplace-suggestions-container">
|
259 |
-
<div style="padding: 1em 1.5em;overflow: hidden;" class="marketplace-suggestion-container">
|
260 |
-
<div style="float:right;"><a target="blank" class="marketplace-suggestion-manage-link linkout" href="<?php echo QLWCDC_DOCUMENTATION_URL; ?>"><?php esc_html_e('Documentation', 'woocommerce-direct-checkout'); ?></a></div>
|
261 |
-
<div style="float:left;"><a style="text-decoration:none" target="blank" href="<?php echo QLWCDC_PURCHASE_URL; ?>" class="linkout"><?php esc_html_e('Purchase Now', 'woocommerce-direct-checkout'); ?><span style="margin-left: 4px;bottom: 2px;position: relative;" class="dashicons dashicons-external"></span></a></div>
|
262 |
-
</div>
|
263 |
-
</div>
|
264 |
-
</div>
|
265 |
-
<?php
|
266 |
-
}
|
267 |
-
|
268 |
-
function add_product_text($text, $product) {
|
269 |
-
|
270 |
-
if ('yes' === QLWCDC::instance()->get_product_option($product->get_id(), 'qlwcdc_add_product_text')) {
|
271 |
-
$text = esc_html__(QLWCDC::instance()->get_product_option($product->get_id(), 'qlwcdc_add_product_text_content'), $text);
|
272 |
-
}
|
273 |
-
|
274 |
-
return $text;
|
275 |
-
}
|
276 |
-
|
277 |
-
function validate_add_cart_item($passed, $product_id, $qty, $post_data = null) {
|
278 |
-
|
279 |
-
if (class_exists('WC_Product_Addons_Helper')) {
|
280 |
-
|
281 |
-
if (isset($_GET['add-to-cart']) && absint($_GET['add-to-cart']) > 0) {
|
282 |
-
|
283 |
-
$product_addons = WC_Product_Addons_Helper::get_product_addons($product_id);
|
284 |
-
|
285 |
-
if (is_array($product_addons) && !empty($product_addons)) {
|
286 |
-
|
287 |
-
foreach ($product_addons as $addon) {
|
288 |
-
|
289 |
-
if (isset($_GET['addon-' . $addon['field_name']])) {
|
290 |
-
$_POST['addon-' . $addon['field_name']] = sanitize_text_field($_GET['addon-' . $addon['field_name']]);
|
291 |
-
}
|
292 |
-
}
|
293 |
-
}
|
294 |
-
}
|
295 |
-
}
|
296 |
-
|
297 |
-
return $passed;
|
298 |
-
}
|
299 |
-
|
300 |
-
function init() {
|
301 |
-
add_action('qlwcdc_sections_header', array($this, 'add_header'));
|
302 |
-
add_action('woocommerce_sections_' . QLWCDC_PREFIX, array($this, 'add_section'), 99);
|
303 |
-
add_action('woocommerce_settings_save_' . QLWCDC_PREFIX, array($this, 'save_settings'));
|
304 |
-
add_filter('woocommerce_product_data_tabs', array($this, 'add_product_tabs'));
|
305 |
-
add_action('woocommerce_product_data_panels', array($this, 'add_product_tab_content'));
|
306 |
-
add_filter('woocommerce_product_single_add_to_cart_text', array($this, 'add_product_text'), 10, 2);
|
307 |
-
// WooCommerce Product Addon Compatibility
|
308 |
-
add_filter('woocommerce_add_to_cart_validation', array($this, 'validate_add_cart_item'), -10, 4);
|
309 |
-
}
|
310 |
-
|
311 |
-
public static function instance() {
|
312 |
-
if (!isset(self::$instance)) {
|
313 |
-
self::$instance = new self();
|
314 |
-
self::$instance->init();
|
315 |
-
}
|
316 |
-
return self::$instance;
|
317 |
-
}
|
318 |
-
|
319 |
-
}
|
320 |
-
|
321 |
-
QLWCDC_Products::instance();
|
322 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/qlwcdc.php
CHANGED
@@ -22,29 +22,17 @@ class QLWCDC {
|
|
22 |
}
|
23 |
|
24 |
public function includes() {
|
25 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/backend.php');
|
26 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/
|
27 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/
|
28 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/
|
29 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/
|
30 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/
|
31 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/
|
32 |
-
include_once(QLWCDC_PLUGIN_DIR . 'includes/suggestions.php');
|
33 |
}
|
34 |
|
35 |
public function register_scripts() {
|
36 |
-
|
37 |
-
wp_register_script(QLWCDC_PREFIX . '-admin', plugins_url('/assets/backend/qlwcdc' . QLWCDC::instance()->is_min() . '-admin.js', QLWCDC_PLUGIN_FILE), array('jquery'), QLWCDC_PLUGIN_VERSION, true);
|
38 |
-
|
39 |
-
wp_register_style(QLWCDC_PREFIX, plugins_url('/assets/frontend/qlwcdc' . QLWCDC::instance()->is_min() . '.css', QLWCDC_PLUGIN_FILE), array(), QLWCDC_PLUGIN_VERSION, 'all');
|
40 |
-
|
41 |
-
wp_register_script(QLWCDC_PREFIX, plugins_url('/assets/frontend/qlwcdc' . QLWCDC::instance()->is_min() . '.js', QLWCDC_PLUGIN_FILE), array('jquery', 'wc-add-to-cart-variation'), QLWCDC_PLUGIN_VERSION, true);
|
42 |
-
|
43 |
-
wp_localize_script(QLWCDC_PREFIX, QLWCDC_PREFIX, array(
|
44 |
-
'nonce' => wp_create_nonce(QLWCDC_PREFIX),
|
45 |
-
'delay' => 200,
|
46 |
-
'timeout' => null)
|
47 |
-
);
|
48 |
}
|
49 |
|
50 |
public function is_min() {
|
22 |
}
|
23 |
|
24 |
public function includes() {
|
25 |
+
include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/backend.php');
|
26 |
+
include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/general.php');
|
27 |
+
include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/archives.php');
|
28 |
+
include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/products.php');
|
29 |
+
include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/checkout.php');
|
30 |
+
include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/premium.php');
|
31 |
+
include_once(QLWCDC_PLUGIN_DIR . 'includes/controller/suggestions.php');
|
|
|
32 |
}
|
33 |
|
34 |
public function register_scripts() {
|
35 |
+
wp_register_script('qlwcdc-admin', plugins_url('/assets/backend/qlwcdc-admin' . QLWCDC::instance()->is_min() . '.js', QLWCDC_PLUGIN_FILE), array('jquery'), QLWCDC_PLUGIN_VERSION, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
public function is_min() {
|
includes/{pages → view/backend/pages}/archives.php
RENAMED
File without changes
|
includes/{pages → view/backend/pages}/checkout.php
RENAMED
File without changes
|
includes/{pages → view/backend/pages}/general.php
RENAMED
File without changes
|
includes/{pages → view/backend/pages}/parts/header.php
RENAMED
File without changes
|
includes/{pages → view/backend/pages}/parts/tabs.php
RENAMED
File without changes
|
includes/{pages → view/backend/pages}/premium.php
RENAMED
File without changes
|
includes/{pages → view/backend/pages}/products.php
RENAMED
File without changes
|
includes/{pages → view/backend/pages}/suggestions.php
RENAMED
File without changes
|
includes/view/frontend/archives.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_Archives {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
add_filter('woocommerce_product_add_to_cart_text', array($this, 'add_archive_text'), 10, 2);
|
9 |
+
}
|
10 |
+
|
11 |
+
public static function instance() {
|
12 |
+
if (!isset(self::$instance)) {
|
13 |
+
self::$instance = new self();
|
14 |
+
}
|
15 |
+
return self::$instance;
|
16 |
+
}
|
17 |
+
|
18 |
+
function add_header() {
|
19 |
+
global $current_section;
|
20 |
+
?>
|
21 |
+
<li><a href="<?php echo admin_url('admin.php?page=wc-settings&tab=' . QLWCDC_PREFIX . '§ion=archives'); ?>" class="<?php echo ( $current_section == 'archives' ? 'current' : '' ); ?>"><?php esc_html_e('Archives', 'woocommerce-direct-checkout'); ?></a> | </li>
|
22 |
+
<?php
|
23 |
+
}
|
24 |
+
|
25 |
+
function add_archive_text($text, $product) {
|
26 |
+
|
27 |
+
if ('yes' === get_option('qlwcdc_add_archive_text')) {
|
28 |
+
if ($product->is_type(get_option('qlwcdc_add_archive_text_in', array()))) {
|
29 |
+
$text = esc_html__(get_option('qlwcdc_add_archive_text_content'));
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
return $text;
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
QLWCDC_Archives::instance();
|
includes/view/frontend/checkout.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_Checkout {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
add_filter('woocommerce_checkout_fields', array($this, 'remove_checkout_fields'));
|
9 |
+
add_filter('woocommerce_enable_order_notes_field', array($this, 'remove_checkout_order_commens'));
|
10 |
+
add_filter('option_woocommerce_ship_to_destination', array($this, 'remove_checkout_shipping_address'), 10, 3);
|
11 |
+
|
12 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_privacy_policy_text')) {
|
13 |
+
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20);
|
14 |
+
}
|
15 |
+
|
16 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_terms_and_conditions')) {
|
17 |
+
add_filter('woocommerce_checkout_show_terms', '__return_false');
|
18 |
+
remove_action('woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public static function instance() {
|
23 |
+
if (!isset(self::$instance)) {
|
24 |
+
self::$instance = new self();
|
25 |
+
}
|
26 |
+
return self::$instance;
|
27 |
+
}
|
28 |
+
|
29 |
+
function remove_checkout_fields($fields) {
|
30 |
+
|
31 |
+
if ($remove = get_option('qlwcdc_remove_checkout_fields', array())) {
|
32 |
+
foreach ($remove as $id => $key) {
|
33 |
+
// We need to remove both fields otherwise will be required
|
34 |
+
unset($fields['billing']['billing_' . $key]);
|
35 |
+
unset($fields['shipping']['shipping_' . $key]);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
return $fields;
|
40 |
+
}
|
41 |
+
|
42 |
+
function remove_checkout_order_commens($return) {
|
43 |
+
|
44 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_order_comments')) {
|
45 |
+
$return = false;
|
46 |
+
}
|
47 |
+
|
48 |
+
return $return;
|
49 |
+
}
|
50 |
+
|
51 |
+
function remove_checkout_shipping_address($val) {
|
52 |
+
|
53 |
+
if ('yes' === get_option('qlwcdc_remove_checkout_shipping_address')) {
|
54 |
+
$val = 'billing_only';
|
55 |
+
}
|
56 |
+
|
57 |
+
return $val;
|
58 |
+
}
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
QLWCDC_Checkout::instance();
|
includes/view/frontend/general.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_General {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
add_filter('woocommerce_get_script_data', array($this, 'add_to_cart_params'));
|
9 |
+
add_filter('wc_add_to_cart_message_html', array($this, 'add_to_cart_message'));
|
10 |
+
add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
|
11 |
+
|
12 |
+
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
13 |
+
add_filter('option_woocommerce_enable_ajax_add_to_cart', '__return_false');
|
14 |
+
add_filter('option_woocommerce_cart_redirect_after_add', '__return_false');
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
public static function instance() {
|
19 |
+
if (!isset(self::$instance)) {
|
20 |
+
self::$instance = new self();
|
21 |
+
}
|
22 |
+
return self::$instance;
|
23 |
+
}
|
24 |
+
|
25 |
+
function add_to_cart_params($params) {
|
26 |
+
|
27 |
+
if ('yes' === get_option('qlwcdc_add_to_cart_link')) {
|
28 |
+
$params['cart_url'] = wc_get_checkout_url();
|
29 |
+
$params['i18n_view_cart'] = esc_html__('Checkout', 'woocommerce-direct-checkout');
|
30 |
+
}
|
31 |
+
|
32 |
+
return $params;
|
33 |
+
}
|
34 |
+
|
35 |
+
function add_to_cart_message($message) {
|
36 |
+
|
37 |
+
if ('yes' === get_option('qlwcdc_add_to_cart_message')) {
|
38 |
+
|
39 |
+
$message = str_replace(wc_get_page_permalink('cart'), wc_get_page_permalink('checkout'), $message);
|
40 |
+
|
41 |
+
$message = str_replace(esc_html__('View cart', 'woocommerce'), esc_html__('Checkout', 'woocommerce'), $message);
|
42 |
+
}
|
43 |
+
|
44 |
+
return $message;
|
45 |
+
}
|
46 |
+
|
47 |
+
function add_to_cart_redirect($url) {
|
48 |
+
|
49 |
+
if ('redirect' === get_option('qlwcdc_add_to_cart')) {
|
50 |
+
if ('cart' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
51 |
+
$url = wc_get_cart_url();
|
52 |
+
} elseif ('url' === get_option('qlwcdc_add_to_cart_redirect_page')) {
|
53 |
+
$url = get_option('qlwcdc_add_to_cart_redirect_url');
|
54 |
+
} else {
|
55 |
+
$url = wc_get_checkout_url();
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
return $url;
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
QLWCDC_General::instance();
|
includes/view/frontend/products.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class QLWCDC_Products {
|
4 |
+
|
5 |
+
protected static $instance;
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
add_filter('woocommerce_product_single_add_to_cart_text', array($this, 'add_product_text'), 10, 2);
|
9 |
+
// WooCommerce Product Addon Compatibility
|
10 |
+
add_filter('woocommerce_add_to_cart_validation', array($this, 'validate_add_cart_item'), -10, 4);
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function instance() {
|
14 |
+
if (!isset(self::$instance)) {
|
15 |
+
self::$instance = new self();
|
16 |
+
}
|
17 |
+
return self::$instance;
|
18 |
+
}
|
19 |
+
|
20 |
+
function add_product_text($text, $product) {
|
21 |
+
|
22 |
+
if ('yes' === QLWCDC::instance()->get_product_option($product->get_id(), 'qlwcdc_add_product_text')) {
|
23 |
+
$text = esc_html__(QLWCDC::instance()->get_product_option($product->get_id(), 'qlwcdc_add_product_text_content'), $text);
|
24 |
+
}
|
25 |
+
|
26 |
+
return $text;
|
27 |
+
}
|
28 |
+
|
29 |
+
function validate_add_cart_item($passed, $product_id, $qty, $post_data = null) {
|
30 |
+
|
31 |
+
if (class_exists('WC_Product_Addons_Helper')) {
|
32 |
+
|
33 |
+
if (isset($_GET['add-to-cart']) && absint($_GET['add-to-cart']) > 0) {
|
34 |
+
|
35 |
+
$product_addons = WC_Product_Addons_Helper::get_product_addons($product_id);
|
36 |
+
|
37 |
+
if (is_array($product_addons) && !empty($product_addons)) {
|
38 |
+
|
39 |
+
foreach ($product_addons as $addon) {
|
40 |
+
|
41 |
+
if (isset($_GET['addon-' . $addon['field_name']])) {
|
42 |
+
$_POST['addon-' . $addon['field_name']] = sanitize_text_field($_GET['addon-' . $addon['field_name']]);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
return $passed;
|
50 |
+
}
|
51 |
+
|
52 |
+
}
|
53 |
+
|
54 |
+
QLWCDC_Products::instance();
|
languages/woocommerce-direct-checkout.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Direct Checkout for WooCommerce\n"
|
5 |
-
"POT-Creation-Date: 2019-
|
6 |
"PO-Revision-Date: 2019-08-09 07:24-0300\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: \n"
|
@@ -19,407 +19,500 @@ msgstr ""
|
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
21 |
|
22 |
-
#: includes/archives.php:
|
|
|
23 |
msgid "Archives"
|
24 |
msgstr ""
|
25 |
|
26 |
-
#: includes/archives.php:
|
|
|
27 |
msgid "Replace Add to cart text"
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: includes/archives.php:
|
|
|
31 |
msgid "Replace \"Add to cart\" text."
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: includes/archives.php:
|
35 |
-
#: includes/checkout.php:
|
36 |
-
#: includes/checkout.php:
|
37 |
-
#: includes/checkout.php:
|
38 |
-
#: includes/checkout.php:
|
39 |
-
#: includes/general.php:
|
40 |
-
#: includes/
|
41 |
-
#: includes/products.php:
|
|
|
|
|
42 |
msgid "Yes"
|
43 |
msgstr ""
|
44 |
|
45 |
-
#: includes/archives.php:
|
46 |
-
#: includes/checkout.php:
|
47 |
-
#: includes/checkout.php:
|
48 |
-
#: includes/checkout.php:
|
49 |
-
#: includes/checkout.php:
|
50 |
-
#: includes/general.php:
|
51 |
-
#: includes/
|
52 |
-
#: includes/products.php:
|
|
|
|
|
53 |
msgid "No"
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: includes/archives.php:
|
57 |
msgid "Replace Add to cart text in"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: includes/archives.php:
|
61 |
msgid "Replace \"Add to cart\" text in product types."
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: includes/archives.php:
|
65 |
msgid "Simple Products"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: includes/archives.php:
|
69 |
msgid "Grouped Products"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: includes/archives.php:
|
73 |
msgid "Virtual Products"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: includes/archives.php:
|
77 |
msgid "Variable Products"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: includes/archives.php:
|
81 |
msgid "Downloadable Products"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: includes/archives.php:
|
85 |
-
#: includes/products.php:
|
86 |
msgid "Replace Add to cart text content"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: includes/archives.php:
|
90 |
-
#: includes/products.php:
|
91 |
msgid "Replace \"Add to cart\" text with this text."
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: includes/archives.php:
|
|
|
95 |
msgid "Purchase"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: includes/archives.php:
|
99 |
msgid "Add quick view button"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: includes/archives.php:
|
103 |
msgid "Add product quick view modal button."
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: includes/
|
107 |
-
#: includes/
|
108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
msgid "Checkout"
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: includes/checkout.php:
|
113 |
msgid "Add cart to checkout"
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: includes/checkout.php:
|
117 |
msgid ""
|
118 |
"Simplifies the checkout process including the shopping cart page inside "
|
119 |
"checkout."
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: includes/checkout.php:
|
123 |
msgid "Add cart to checkout fields"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: includes/checkout.php:
|
127 |
msgid "Include this fields inside the checkout cart."
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: includes/checkout.php:
|
131 |
msgid "Remove"
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: includes/checkout.php:
|
135 |
msgid "Thumbnail"
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: includes/checkout.php:
|
139 |
msgid "Name"
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: includes/checkout.php:
|
143 |
msgid "Price"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: includes/checkout.php:
|
147 |
msgid "Quantity"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: includes/checkout.php:
|
151 |
msgid "Remove checkout coupon form"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: includes/checkout.php:
|
155 |
msgid "Simplifies the checkout process removing the coupon form."
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: includes/checkout.php:
|
159 |
msgid "Leave coupon form"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: includes/checkout.php:
|
163 |
msgid "Remove coupon form"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: includes/checkout.php:
|
167 |
msgid "Remove coupon toggle"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: includes/checkout.php:
|
171 |
msgid "Move to checkout order"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: includes/checkout.php:
|
175 |
msgid "Add custom class to cart table"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: includes/checkout.php:
|
179 |
msgid "Add a custom class to the cart table form in the checkot."
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: includes/checkout.php:
|
|
|
183 |
msgid "Remove checkout fields"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: includes/checkout.php:
|
187 |
msgid ""
|
188 |
"Simplifies the checkout process removing the unnecessary checkout fields."
|
189 |
msgstr ""
|
190 |
|
191 |
-
#: includes/checkout.php:
|
192 |
msgid "First Name"
|
193 |
msgstr ""
|
194 |
|
195 |
-
#: includes/checkout.php:
|
196 |
msgid "Last Name"
|
197 |
msgstr ""
|
198 |
|
199 |
-
#: includes/checkout.php:
|
200 |
msgid "Country"
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: includes/checkout.php:
|
204 |
msgid "State"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: includes/checkout.php:
|
208 |
msgid "City"
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: includes/checkout.php:
|
212 |
msgid "Postcode"
|
213 |
msgstr ""
|
214 |
|
215 |
-
#: includes/checkout.php:
|
216 |
msgid "Address 1"
|
217 |
msgstr ""
|
218 |
|
219 |
-
#: includes/checkout.php:
|
220 |
msgid "Address 2"
|
221 |
msgstr ""
|
222 |
|
223 |
-
#: includes/checkout.php:
|
224 |
msgid "Company"
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: includes/checkout.php:
|
228 |
msgid "Phone"
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: includes/checkout.php:
|
232 |
msgid "Remove checkout shipping address"
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: includes/checkout.php:
|
236 |
msgid "Simplifies the checkout process removing the shipping address."
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: includes/checkout.php:
|
240 |
msgid "Remove checkout order comments"
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: includes/checkout.php:
|
244 |
msgid "Simplifies the checkout process removing the order notes."
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: includes/checkout.php:
|
248 |
msgid "Remove checkout policy text"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: includes/checkout.php:
|
252 |
msgid "Simplifies the checkout process removing the policy text."
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: includes/checkout.php:
|
256 |
msgid "Remove checkout terms and conditions"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: includes/checkout.php:
|
260 |
msgid "Simplifies the checkout process removing the terms and conditions."
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: includes/checkout.php:
|
264 |
msgid "Remove checkout gateway icons"
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: includes/checkout.php:
|
268 |
msgid "Simplifies the checkout view by removing the payment gateway icons."
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: includes/checkout.php:
|
|
|
272 |
msgid "Remove checkout columns"
|
273 |
msgstr ""
|
274 |
|
275 |
-
#: includes/checkout.php:
|
276 |
msgid ""
|
277 |
"Try to remove the columns and display the checkout form and order review in "
|
278 |
"one column."
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: includes/checkout.php:
|
282 |
msgid "Remove order details address"
|
283 |
msgstr ""
|
284 |
|
285 |
-
#: includes/checkout.php:
|
286 |
msgid "Remove the billing address of the customer in the order received page."
|
287 |
msgstr ""
|
288 |
|
289 |
-
#: includes/general.php:
|
290 |
msgid "General"
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: includes/general.php:
|
294 |
msgid "Simplifies the checkout process."
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: includes/general.php:
|
298 |
msgid "Added to cart alert"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: includes/general.php:
|
302 |
msgid "Replace \"View Cart\" alert with direct checkout."
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: includes/general.php:
|
306 |
msgid "Added to cart link"
|
307 |
msgstr ""
|
308 |
|
309 |
-
#: includes/general.php:
|
310 |
msgid "Replace \"View Cart\" link with direct checkout."
|
311 |
msgstr ""
|
312 |
|
313 |
-
#: includes/general.php:
|
314 |
msgid "Added to cart redirect"
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: includes/general.php:
|
318 |
msgid "Add to cart button behaviour."
|
319 |
msgstr ""
|
320 |
|
321 |
-
#: includes/general.php:
|
322 |
msgid "Added to cart redirect to"
|
323 |
msgstr ""
|
324 |
|
325 |
-
#: includes/general.php:
|
326 |
msgid "Redirect to the cart or checkout page after successful addition."
|
327 |
msgstr ""
|
328 |
|
329 |
-
#: includes/general.php:
|
330 |
-
#: includes/products.php:
|
331 |
msgid "Cart"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: includes/general.php:
|
335 |
msgid "Custom URL"
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: includes/general.php:
|
339 |
msgid "Added to cart redirect to custom url"
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: includes/
|
343 |
-
|
|
|
|
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: includes/products.php:
|
347 |
msgid "Products"
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
msgid "Add quick purchase button"
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: includes/products.php:
|
355 |
msgid "Add a quick purchase button to the products pages."
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: includes/products.php:
|
359 |
msgid "Add quick purchase class"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: includes/products.php:
|
363 |
msgid "Add a custom class to the quick purchase button."
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: includes/products.php:
|
367 |
msgid "Redirect quick purchase to"
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: includes/products.php:
|
371 |
msgid "Redirect the quick purchase button to the cart or checkout page."
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: includes/products.php:
|
375 |
msgid "Add quick purchase text"
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: includes/products.php:
|
379 |
msgid "Add a custom text to the quick purchase button."
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: includes/products.php:
|
|
|
383 |
msgid "Purchase Now"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: includes/products.php:
|
387 |
msgid "Add default attributes in variable products"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: includes/products.php:
|
391 |
msgid ""
|
392 |
"Add default attributes in all variable products to avoid disabled Add to "
|
393 |
"cart button."
|
394 |
msgstr ""
|
395 |
|
396 |
-
#: includes/products.php:
|
397 |
msgid "Add quick purchase button to single product page."
|
398 |
msgstr ""
|
399 |
|
400 |
-
#: includes/products.php:
|
401 |
msgid "Add quick purchase custom class."
|
402 |
msgstr ""
|
403 |
|
404 |
-
#: includes/products.php:
|
405 |
msgid "Add quick purchase custom text."
|
406 |
msgstr ""
|
407 |
|
408 |
-
#: includes/products.php:
|
409 |
msgid "Redirect quick purchase to the cart or checkout page."
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: includes/products.php:
|
413 |
-
#:
|
414 |
-
|
|
|
415 |
msgstr ""
|
416 |
|
417 |
-
#: includes/
|
418 |
-
#:
|
419 |
-
msgid "
|
420 |
msgstr ""
|
421 |
|
422 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
#, php-format
|
424 |
msgid ""
|
425 |
"%s allows you to simplifies the checkout process by skipping the shopping "
|
@@ -427,119 +520,94 @@ msgid ""
|
|
427 |
"checkout page and includes the cart inside the checkout page."
|
428 |
msgstr ""
|
429 |
|
430 |
-
#: includes/
|
431 |
msgid "Get Support"
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: includes/
|
435 |
msgid "One page checkout"
|
436 |
msgstr ""
|
437 |
|
438 |
-
#: includes/
|
439 |
#, php-format
|
440 |
msgid ""
|
441 |
"%s allows you to include the cart form in the checkout page allowing your "
|
442 |
"users to edit the cart and confirm the order on the same page."
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: includes/
|
446 |
msgid ""
|
447 |
"Our checkout settings allow you to easily remove the unnecessary fields and "
|
448 |
"reduce the user spend completing those fields like the order comments, "
|
449 |
"shipping address, coupon form, policy text, and terms and conditions."
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: includes/
|
453 |
msgid ""
|
454 |
"This option allows you to simplify the checkout page by removing the two "
|
455 |
"columns in the checkout page."
|
456 |
msgstr ""
|
457 |
|
458 |
-
#: includes/
|
459 |
msgid "Checkout redirect"
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: includes/
|
463 |
msgid ""
|
464 |
"This option allows you to redirect your users directly to the checkout page "
|
465 |
"reducing the total checkout process in one step."
|
466 |
msgstr ""
|
467 |
|
468 |
-
#: includes/
|
469 |
msgid "Quick purchase on single products"
|
470 |
msgstr ""
|
471 |
|
472 |
-
#: includes/
|
473 |
msgid ""
|
474 |
"If you want to give the option to the user to make a direct purchase or the "
|
475 |
"default add to cart product you can include a direct purchase button to the "
|
476 |
"products page."
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: includes/
|
480 |
msgid "Quick view in product archives"
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: includes/
|
484 |
msgid ""
|
485 |
"This option allows you to include a button which displays a quick view in "
|
486 |
"the WooCommerce shop page and products categories."
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: includes/
|
490 |
msgid ""
|
491 |
"This is especially useful for the variable products because it allows users "
|
492 |
"to select the products attributes and include directly into the cart."
|
493 |
msgstr ""
|
494 |
|
495 |
-
#: includes/
|
496 |
msgid "Quick purchase"
|
497 |
msgstr ""
|
498 |
|
499 |
-
#: includes/
|
500 |
msgid ""
|
501 |
"The Quick purchase button allows you to include a direct button in the "
|
502 |
"single products, variable, grouped and virtual products wich redirects user "
|
503 |
"to the checkout page."
|
504 |
msgstr ""
|
505 |
|
506 |
-
#:
|
507 |
-
|
508 |
-
msgid "Hello! Thank you for choosing the %s plugin!"
|
509 |
-
msgstr ""
|
510 |
-
|
511 |
-
#: woocommerce-direct-checkout.php:80
|
512 |
-
msgid ""
|
513 |
-
"Could you please give it a 5-star rating on WordPress? We know its a big "
|
514 |
-
"favor, but we've worked very much and very hard to release this great "
|
515 |
-
"product. Your feedback will boost our motivation and help us promote and "
|
516 |
-
"continue to improve this product."
|
517 |
-
msgstr ""
|
518 |
-
|
519 |
-
#: woocommerce-direct-checkout.php:83
|
520 |
-
msgid "Yes, of course!"
|
521 |
-
msgstr ""
|
522 |
-
|
523 |
-
#: woocommerce-direct-checkout.php:86
|
524 |
-
msgid "Report a bug"
|
525 |
-
msgstr ""
|
526 |
-
|
527 |
-
#: woocommerce-direct-checkout.php:130
|
528 |
-
msgid "Settings"
|
529 |
msgstr ""
|
530 |
|
531 |
#. Plugin Name of the plugin/theme
|
532 |
-
msgid "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 ""
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Direct Checkout for WooCommerce\n"
|
5 |
+
"POT-Creation-Date: 2019-11-28 20:17-0300\n"
|
6 |
"PO-Revision-Date: 2019-08-09 07:24-0300\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: \n"
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
21 |
|
22 |
+
#: includes/controller/archives.php:24 includes/controller/archives.php:32
|
23 |
+
#: includes/view/frontend/archives.php:21
|
24 |
msgid "Archives"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: includes/controller/archives.php:52 includes/controller/products.php:53
|
28 |
+
#: includes/controller/products.php:161
|
29 |
msgid "Replace Add to cart text"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: includes/controller/archives.php:53 includes/controller/products.php:54
|
33 |
+
#: includes/controller/products.php:163
|
34 |
msgid "Replace \"Add to cart\" text."
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: includes/controller/archives.php:58 includes/controller/archives.php:92
|
38 |
+
#: includes/controller/checkout.php:43 includes/controller/checkout.php:120
|
39 |
+
#: includes/controller/checkout.php:132 includes/controller/checkout.php:144
|
40 |
+
#: includes/controller/checkout.php:156 includes/controller/checkout.php:168
|
41 |
+
#: includes/controller/checkout.php:180 includes/controller/checkout.php:192
|
42 |
+
#: includes/controller/general.php:46 includes/controller/general.php:58
|
43 |
+
#: includes/controller/general.php:72 includes/controller/products.php:47
|
44 |
+
#: includes/controller/products.php:59 includes/controller/products.php:78
|
45 |
+
#: includes/controller/products.php:116 includes/controller/products.php:167
|
46 |
+
#: includes/controller/products.php:191
|
47 |
msgid "Yes"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: includes/controller/archives.php:59 includes/controller/archives.php:93
|
51 |
+
#: includes/controller/checkout.php:44 includes/controller/checkout.php:121
|
52 |
+
#: includes/controller/checkout.php:133 includes/controller/checkout.php:145
|
53 |
+
#: includes/controller/checkout.php:157 includes/controller/checkout.php:169
|
54 |
+
#: includes/controller/checkout.php:181 includes/controller/checkout.php:193
|
55 |
+
#: includes/controller/general.php:47 includes/controller/general.php:59
|
56 |
+
#: includes/controller/general.php:70 includes/controller/products.php:48
|
57 |
+
#: includes/controller/products.php:60 includes/controller/products.php:79
|
58 |
+
#: includes/controller/products.php:117 includes/controller/products.php:168
|
59 |
+
#: includes/controller/products.php:192
|
60 |
msgid "No"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: includes/controller/archives.php:64
|
64 |
msgid "Replace Add to cart text in"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: includes/controller/archives.php:65
|
68 |
msgid "Replace \"Add to cart\" text in product types."
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: includes/controller/archives.php:70
|
72 |
msgid "Simple Products"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: includes/controller/archives.php:71
|
76 |
msgid "Grouped Products"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: includes/controller/archives.php:72
|
80 |
msgid "Virtual Products"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: includes/controller/archives.php:73
|
84 |
msgid "Variable Products"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: includes/controller/archives.php:74
|
88 |
msgid "Downloadable Products"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: includes/controller/archives.php:79 includes/controller/products.php:65
|
92 |
+
#: includes/controller/products.php:173
|
93 |
msgid "Replace Add to cart text content"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: includes/controller/archives.php:80 includes/controller/products.php:66
|
97 |
+
#: includes/controller/products.php:175
|
98 |
msgid "Replace \"Add to cart\" text with this text."
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: includes/controller/archives.php:83 includes/controller/products.php:69
|
102 |
+
#: includes/view/backend/pages/parts/header.php:8
|
103 |
msgid "Purchase"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: includes/controller/archives.php:86
|
107 |
msgid "Add quick view button"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: includes/controller/archives.php:87
|
111 |
msgid "Add product quick view modal button."
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: includes/controller/backend.php:31 includes/controller/backend.php:36
|
115 |
+
#: includes/controller/products.php:233
|
116 |
+
msgid "Direct Checkout"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: includes/controller/checkout.php:24 includes/controller/checkout.php:32
|
120 |
+
#: includes/controller/general.php:107 includes/controller/products.php:98
|
121 |
+
#: includes/controller/products.php:222 includes/view/frontend/general.php:29
|
122 |
+
#: includes/view/frontend/general.php:41
|
123 |
msgid "Checkout"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: includes/controller/checkout.php:37
|
127 |
msgid "Add cart to checkout"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: includes/controller/checkout.php:38
|
131 |
msgid ""
|
132 |
"Simplifies the checkout process including the shopping cart page inside "
|
133 |
"checkout."
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: includes/controller/checkout.php:49
|
137 |
msgid "Add cart to checkout fields"
|
138 |
msgstr ""
|
139 |
|
140 |
+
#: includes/controller/checkout.php:50
|
141 |
msgid "Include this fields inside the checkout cart."
|
142 |
msgstr ""
|
143 |
|
144 |
+
#: includes/controller/checkout.php:55
|
145 |
msgid "Remove"
|
146 |
msgstr ""
|
147 |
|
148 |
+
#: includes/controller/checkout.php:56
|
149 |
msgid "Thumbnail"
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: includes/controller/checkout.php:57
|
153 |
msgid "Name"
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: includes/controller/checkout.php:58
|
157 |
msgid "Price"
|
158 |
msgstr ""
|
159 |
|
160 |
+
#: includes/controller/checkout.php:59
|
161 |
msgid "Quantity"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: includes/controller/checkout.php:69
|
165 |
msgid "Remove checkout coupon form"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: includes/controller/checkout.php:70
|
169 |
msgid "Simplifies the checkout process removing the coupon form."
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: includes/controller/checkout.php:75
|
173 |
msgid "Leave coupon form"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: includes/controller/checkout.php:76
|
177 |
msgid "Remove coupon form"
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: includes/controller/checkout.php:77
|
181 |
msgid "Remove coupon toggle"
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: includes/controller/checkout.php:78
|
185 |
msgid "Move to checkout order"
|
186 |
msgstr ""
|
187 |
|
188 |
+
#: includes/controller/checkout.php:83
|
189 |
msgid "Add custom class to cart table"
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: includes/controller/checkout.php:84
|
193 |
msgid "Add a custom class to the cart table form in the checkot."
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: includes/controller/checkout.php:90
|
197 |
+
#: includes/view/backend/pages/premium.php:22
|
198 |
msgid "Remove checkout fields"
|
199 |
msgstr ""
|
200 |
|
201 |
+
#: includes/controller/checkout.php:91
|
202 |
msgid ""
|
203 |
"Simplifies the checkout process removing the unnecessary checkout fields."
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: includes/controller/checkout.php:96
|
207 |
msgid "First Name"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: includes/controller/checkout.php:97
|
211 |
msgid "Last Name"
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: includes/controller/checkout.php:98
|
215 |
msgid "Country"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: includes/controller/checkout.php:99
|
219 |
msgid "State"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: includes/controller/checkout.php:100
|
223 |
msgid "City"
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: includes/controller/checkout.php:101
|
227 |
msgid "Postcode"
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: includes/controller/checkout.php:102
|
231 |
msgid "Address 1"
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: includes/controller/checkout.php:103
|
235 |
msgid "Address 2"
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: includes/controller/checkout.php:104
|
239 |
msgid "Company"
|
240 |
msgstr ""
|
241 |
|
242 |
+
#: includes/controller/checkout.php:105
|
243 |
msgid "Phone"
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: includes/controller/checkout.php:114
|
247 |
msgid "Remove checkout shipping address"
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: includes/controller/checkout.php:115
|
251 |
msgid "Simplifies the checkout process removing the shipping address."
|
252 |
msgstr ""
|
253 |
|
254 |
+
#: includes/controller/checkout.php:126
|
255 |
msgid "Remove checkout order comments"
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: includes/controller/checkout.php:127
|
259 |
msgid "Simplifies the checkout process removing the order notes."
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: includes/controller/checkout.php:138
|
263 |
msgid "Remove checkout policy text"
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: includes/controller/checkout.php:139
|
267 |
msgid "Simplifies the checkout process removing the policy text."
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: includes/controller/checkout.php:150
|
271 |
msgid "Remove checkout terms and conditions"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: includes/controller/checkout.php:151
|
275 |
msgid "Simplifies the checkout process removing the terms and conditions."
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: includes/controller/checkout.php:162
|
279 |
msgid "Remove checkout gateway icons"
|
280 |
msgstr ""
|
281 |
|
282 |
+
#: includes/controller/checkout.php:163
|
283 |
msgid "Simplifies the checkout view by removing the payment gateway icons."
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: includes/controller/checkout.php:174
|
287 |
+
#: includes/view/backend/pages/premium.php:28
|
288 |
msgid "Remove checkout columns"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: includes/controller/checkout.php:175
|
292 |
msgid ""
|
293 |
"Try to remove the columns and display the checkout form and order review in "
|
294 |
"one column."
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: includes/controller/checkout.php:186
|
298 |
msgid "Remove order details address"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: includes/controller/checkout.php:187
|
302 |
msgid "Remove the billing address of the customer in the order received page."
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: includes/controller/general.php:26 includes/controller/general.php:34
|
306 |
msgid "General"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: includes/controller/general.php:36
|
310 |
msgid "Simplifies the checkout process."
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: includes/controller/general.php:40
|
314 |
msgid "Added to cart alert"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: includes/controller/general.php:41
|
318 |
msgid "Replace \"View Cart\" alert with direct checkout."
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: includes/controller/general.php:52
|
322 |
msgid "Added to cart link"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: includes/controller/general.php:53
|
326 |
msgid "Replace \"View Cart\" link with direct checkout."
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: includes/controller/general.php:64
|
330 |
msgid "Added to cart redirect"
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: includes/controller/general.php:65
|
334 |
msgid "Add to cart button behaviour."
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: includes/controller/general.php:100
|
338 |
msgid "Added to cart redirect to"
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: includes/controller/general.php:101 includes/controller/general.php:114
|
342 |
msgid "Redirect to the cart or checkout page after successful addition."
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: includes/controller/general.php:106 includes/controller/products.php:97
|
346 |
+
#: includes/controller/products.php:221
|
347 |
msgid "Cart"
|
348 |
msgstr ""
|
349 |
|
350 |
+
#: includes/controller/general.php:108
|
351 |
msgid "Custom URL"
|
352 |
msgstr ""
|
353 |
|
354 |
+
#: includes/controller/general.php:113
|
355 |
msgid "Added to cart redirect to custom url"
|
356 |
msgstr ""
|
357 |
|
358 |
+
#: includes/controller/premium.php:41 includes/notices.php:84
|
359 |
+
#: includes/view/backend/pages/parts/tabs.php:4
|
360 |
+
#: includes/view/backend/pages/premium.php:6
|
361 |
+
msgid "Premium"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: includes/controller/products.php:28 includes/controller/products.php:36
|
365 |
msgid "Products"
|
366 |
msgstr ""
|
367 |
|
368 |
+
#: includes/controller/products.php:41
|
369 |
+
msgid "Add ajax add to cart"
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: includes/controller/products.php:42
|
373 |
+
msgid "Add products to cart via ajax."
|
374 |
+
msgstr ""
|
375 |
+
|
376 |
+
#: includes/controller/products.php:72 includes/controller/products.php:184
|
377 |
msgid "Add quick purchase button"
|
378 |
msgstr ""
|
379 |
|
380 |
+
#: includes/controller/products.php:73
|
381 |
msgid "Add a quick purchase button to the products pages."
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: includes/controller/products.php:84 includes/controller/products.php:197
|
385 |
msgid "Add quick purchase class"
|
386 |
msgstr ""
|
387 |
|
388 |
+
#: includes/controller/products.php:85
|
389 |
msgid "Add a custom class to the quick purchase button."
|
390 |
msgstr ""
|
391 |
|
392 |
+
#: includes/controller/products.php:91 includes/controller/products.php:215
|
393 |
msgid "Redirect quick purchase to"
|
394 |
msgstr ""
|
395 |
|
396 |
+
#: includes/controller/products.php:92
|
397 |
msgid "Redirect the quick purchase button to the cart or checkout page."
|
398 |
msgstr ""
|
399 |
|
400 |
+
#: includes/controller/products.php:103 includes/controller/products.php:206
|
401 |
msgid "Add quick purchase text"
|
402 |
msgstr ""
|
403 |
|
404 |
+
#: includes/controller/products.php:104
|
405 |
msgid "Add a custom text to the quick purchase button."
|
406 |
msgstr ""
|
407 |
|
408 |
+
#: includes/controller/products.php:107 includes/controller/products.php:273
|
409 |
+
#: includes/view/backend/pages/premium.php:11
|
410 |
msgid "Purchase Now"
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: includes/controller/products.php:110
|
414 |
msgid "Add default attributes in variable products"
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: includes/controller/products.php:111
|
418 |
msgid ""
|
419 |
"Add default attributes in all variable products to avoid disabled Add to "
|
420 |
"cart button."
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: includes/controller/products.php:186
|
424 |
msgid "Add quick purchase button to single product page."
|
425 |
msgstr ""
|
426 |
|
427 |
+
#: includes/controller/products.php:199
|
428 |
msgid "Add quick purchase custom class."
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: includes/controller/products.php:208
|
432 |
msgid "Add quick purchase custom text."
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: includes/controller/products.php:217
|
436 |
msgid "Redirect quick purchase to the cart or checkout page."
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: includes/controller/products.php:272
|
440 |
+
#: includes/view/backend/pages/parts/header.php:9
|
441 |
+
#: includes/view/backend/pages/parts/tabs.php:3
|
442 |
+
msgid "Documentation"
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: includes/controller/suggestions.php:29
|
446 |
+
#: includes/view/backend/pages/parts/header.php:3
|
447 |
+
msgid "Suggestions"
|
448 |
msgstr ""
|
449 |
|
450 |
+
#: includes/notices.php:45
|
451 |
+
#, php-format
|
452 |
+
msgid "Hello! Thank you for choosing the %s plugin!"
|
453 |
+
msgstr ""
|
454 |
+
|
455 |
+
#: includes/notices.php:47
|
456 |
+
msgid ""
|
457 |
+
"Could you please give it a 5-star rating on WordPress? We know its a big "
|
458 |
+
"favor, but we've worked very much and very hard to release this great "
|
459 |
+
"product. Your feedback will boost our motivation and help us promote and "
|
460 |
+
"continue to improve this product."
|
461 |
+
msgstr ""
|
462 |
+
|
463 |
+
#: includes/notices.php:50
|
464 |
+
msgid "Yes, of course!"
|
465 |
+
msgstr ""
|
466 |
+
|
467 |
+
#: includes/notices.php:53
|
468 |
+
msgid "Report a bug"
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
#: includes/notices.php:85
|
472 |
+
msgid "Settings"
|
473 |
+
msgstr ""
|
474 |
+
|
475 |
+
#: includes/suggestions-list-table.php:109
|
476 |
+
msgid "Search Results"
|
477 |
+
msgstr ""
|
478 |
+
|
479 |
+
#: includes/suggestions-list-table.php:112
|
480 |
+
msgctxt "Plugin Installer"
|
481 |
+
msgid "Beta Testing"
|
482 |
+
msgstr ""
|
483 |
+
|
484 |
+
#: includes/suggestions-list-table.php:114
|
485 |
+
msgctxt "Plugin Installer"
|
486 |
+
msgid "Featured"
|
487 |
+
msgstr ""
|
488 |
+
|
489 |
+
#: includes/suggestions-list-table.php:115
|
490 |
+
msgctxt "Plugin Installer"
|
491 |
+
msgid "Popular"
|
492 |
+
msgstr ""
|
493 |
+
|
494 |
+
#: includes/suggestions-list-table.php:116
|
495 |
+
msgctxt "Plugin Installer"
|
496 |
+
msgid "Recommended"
|
497 |
+
msgstr ""
|
498 |
+
|
499 |
+
#: includes/suggestions-list-table.php:117
|
500 |
+
msgctxt "Plugin Installer"
|
501 |
+
msgid "Favorites"
|
502 |
+
msgstr ""
|
503 |
+
|
504 |
+
#: includes/view/backend/pages/parts/header.php:5
|
505 |
+
msgid ""
|
506 |
+
"Thanks for using our product! We recommend these extensions that will add "
|
507 |
+
"new features to stand out your business and improve your sales."
|
508 |
+
msgstr ""
|
509 |
+
|
510 |
+
#. Author of the plugin/theme
|
511 |
+
#: includes/view/backend/pages/parts/header.php:25
|
512 |
+
msgid "QuadLayers"
|
513 |
+
msgstr ""
|
514 |
+
|
515 |
+
#: includes/view/backend/pages/premium.php:8
|
516 |
#, php-format
|
517 |
msgid ""
|
518 |
"%s allows you to simplifies the checkout process by skipping the shopping "
|
520 |
"checkout page and includes the cart inside the checkout page."
|
521 |
msgstr ""
|
522 |
|
523 |
+
#: includes/view/backend/pages/premium.php:12
|
524 |
msgid "Get Support"
|
525 |
msgstr ""
|
526 |
|
527 |
+
#: includes/view/backend/pages/premium.php:16
|
528 |
msgid "One page checkout"
|
529 |
msgstr ""
|
530 |
|
531 |
+
#: includes/view/backend/pages/premium.php:18
|
532 |
#, php-format
|
533 |
msgid ""
|
534 |
"%s allows you to include the cart form in the checkout page allowing your "
|
535 |
"users to edit the cart and confirm the order on the same page."
|
536 |
msgstr ""
|
537 |
|
538 |
+
#: includes/view/backend/pages/premium.php:24
|
539 |
msgid ""
|
540 |
"Our checkout settings allow you to easily remove the unnecessary fields and "
|
541 |
"reduce the user spend completing those fields like the order comments, "
|
542 |
"shipping address, coupon form, policy text, and terms and conditions."
|
543 |
msgstr ""
|
544 |
|
545 |
+
#: includes/view/backend/pages/premium.php:30
|
546 |
msgid ""
|
547 |
"This option allows you to simplify the checkout page by removing the two "
|
548 |
"columns in the checkout page."
|
549 |
msgstr ""
|
550 |
|
551 |
+
#: includes/view/backend/pages/premium.php:42
|
552 |
msgid "Checkout redirect"
|
553 |
msgstr ""
|
554 |
|
555 |
+
#: includes/view/backend/pages/premium.php:44
|
556 |
msgid ""
|
557 |
"This option allows you to redirect your users directly to the checkout page "
|
558 |
"reducing the total checkout process in one step."
|
559 |
msgstr ""
|
560 |
|
561 |
+
#: includes/view/backend/pages/premium.php:48
|
562 |
msgid "Quick purchase on single products"
|
563 |
msgstr ""
|
564 |
|
565 |
+
#: includes/view/backend/pages/premium.php:50
|
566 |
msgid ""
|
567 |
"If you want to give the option to the user to make a direct purchase or the "
|
568 |
"default add to cart product you can include a direct purchase button to the "
|
569 |
"products page."
|
570 |
msgstr ""
|
571 |
|
572 |
+
#: includes/view/backend/pages/premium.php:54
|
573 |
msgid "Quick view in product archives"
|
574 |
msgstr ""
|
575 |
|
576 |
+
#: includes/view/backend/pages/premium.php:56
|
577 |
msgid ""
|
578 |
"This option allows you to include a button which displays a quick view in "
|
579 |
"the WooCommerce shop page and products categories."
|
580 |
msgstr ""
|
581 |
|
582 |
+
#: includes/view/backend/pages/premium.php:59
|
583 |
msgid ""
|
584 |
"This is especially useful for the variable products because it allows users "
|
585 |
"to select the products attributes and include directly into the cart."
|
586 |
msgstr ""
|
587 |
|
588 |
+
#: includes/view/backend/pages/premium.php:64
|
589 |
msgid "Quick purchase"
|
590 |
msgstr ""
|
591 |
|
592 |
+
#: includes/view/backend/pages/premium.php:66
|
593 |
msgid ""
|
594 |
"The Quick purchase button allows you to include a direct button in the "
|
595 |
"single products, variable, grouped and virtual products wich redirects user "
|
596 |
"to the checkout page."
|
597 |
msgstr ""
|
598 |
|
599 |
+
#: includes/view/frontend/general.php:41
|
600 |
+
msgid "View cart"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
msgstr ""
|
602 |
|
603 |
#. Plugin Name of the plugin/theme
|
604 |
+
msgid "WooCommerce Direct Checkout"
|
605 |
msgstr ""
|
606 |
|
607 |
#. Description of the plugin/theme
|
608 |
msgid "Simplifies the checkout process to improve your sales rate."
|
609 |
msgstr ""
|
610 |
|
|
|
|
|
|
|
|
|
611 |
#. Author URI of the plugin/theme
|
612 |
msgid "https://www.quadlayers.com"
|
613 |
msgstr ""
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: quadlayers
|
3 |
Donate link: https://quadlayers.com/portfolio/woocommerce-direct-checkout/
|
4 |
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
|
5 |
-
Requires at least: 4.
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -53,6 +53,9 @@ The premium version of WooCommerce Direct Checkot allows to include a quick purc
|
|
53 |
|
54 |
== Changelog ==
|
55 |
|
|
|
|
|
|
|
56 |
= 2.2.9 =
|
57 |
* Fix: WooCommerce Ajax add to cart grouped products
|
58 |
|
2 |
Contributors: quadlayers
|
3 |
Donate link: https://quadlayers.com/portfolio/woocommerce-direct-checkout/
|
4 |
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
|
5 |
+
Requires at least: 4.6
|
6 |
+
Tested up to: 5.3.0
|
7 |
+
Stable tag: 2.3.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
53 |
|
54 |
== Changelog ==
|
55 |
|
56 |
+
= 2.3.0 =
|
57 |
+
* Fix: code refactoring
|
58 |
+
|
59 |
= 2.2.9 =
|
60 |
* Fix: WooCommerce Ajax add to cart grouped products
|
61 |
|
woocommerce-direct-checkout.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Plugin Name: WooCommerce Direct Checkout
|
5 |
* Description: Simplifies the checkout process to improve your sales rate.
|
6 |
-
* Version: 2.
|
7 |
* Author: QuadLayers
|
8 |
* Author URI: https://www.quadlayers.com
|
9 |
* Copyright: 2019 QuadLayers (https://www.quadlayers.com)
|
@@ -16,7 +16,7 @@ if (!defined('QLWCDC_PLUGIN_NAME')) {
|
|
16 |
define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
|
17 |
}
|
18 |
if (!defined('QLWCDC_PLUGIN_VERSION')) {
|
19 |
-
define('QLWCDC_PLUGIN_VERSION', '2.
|
20 |
}
|
21 |
if (!defined('QLWCDC_PLUGIN_FILE')) {
|
22 |
define('QLWCDC_PLUGIN_FILE', __FILE__);
|
3 |
/**
|
4 |
* Plugin Name: WooCommerce Direct Checkout
|
5 |
* Description: Simplifies the checkout process to improve your sales rate.
|
6 |
+
* Version: 2.3.0
|
7 |
* Author: QuadLayers
|
8 |
* Author URI: https://www.quadlayers.com
|
9 |
* Copyright: 2019 QuadLayers (https://www.quadlayers.com)
|
16 |
define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
|
17 |
}
|
18 |
if (!defined('QLWCDC_PLUGIN_VERSION')) {
|
19 |
+
define('QLWCDC_PLUGIN_VERSION', '2.3.0');
|
20 |
}
|
21 |
if (!defined('QLWCDC_PLUGIN_FILE')) {
|
22 |
define('QLWCDC_PLUGIN_FILE', __FILE__);
|