WooCommerce Direct Checkout - Version 2.2.6

Version Description

  • Fix. WooCommerce Direct Checkout Premium compatibility
Download this release

Release Info

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

Code changes from version 2.2.5 to 2.2.6

assets/backend/qlwcdc-admin.js CHANGED
@@ -43,28 +43,6 @@
43
  }).change();
44
  // Archive
45
  // -----------------------------------------------------------------
46
- /*$('select#qlwcdc_add_archive_cart_redirect_page').change(function () {
47
- if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_archive_cart').val()) {
48
- $('input#qlwcdc_add_archive_cart_redirect_url').closest('tr, p').fadeIn();
49
- } else {
50
- $('input#qlwcdc_add_archive_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
51
- }
52
- });
53
- $('select#qlwcdc_add_archive_cart').change(function () {
54
- if ('ajax' === $(this).val()) {
55
- $('select#qlwcdc_add_archive_cart_ajax_button').closest('tr, p').fadeIn();
56
- $('select#qlwcdc_add_archive_cart_ajax_message').closest('tr, p').fadeIn();
57
- } else {
58
- $('select#qlwcdc_add_archive_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
59
- $('select#qlwcdc_add_archive_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
60
- }
61
- if ('redirect' === $(this).val()) {
62
- $('select#qlwcdc_add_archive_cart_redirect_page').closest('tr, p').fadeIn();
63
- } else {
64
- $('select#qlwcdc_add_archive_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
65
- }
66
- $('select#qlwcdc_add_archive_cart_redirect_page').change();
67
- }).change();*/
68
  $('select#qlwcdc_add_archive_text').change(function () {
69
  if ('yes' === $(this).val()) {
70
  $('select#qlwcdc_add_archive_text_in').closest('tr, p').fadeIn();
@@ -76,28 +54,7 @@
76
  }).change();
77
  // Product
78
  // -----------------------------------------------------------------
79
- /*$('select#qlwcdc_add_product_cart_redirect_page').change(function () {
80
- if ('url' === $(this).val() && 'redirect' == $('select#qlwcdc_add_product_cart').val()) {
81
- $('input#qlwcdc_add_product_cart_redirect_url').closest('tr, p').fadeIn();
82
- } else {
83
- $('input#qlwcdc_add_product_cart_redirect_url').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
84
- }
85
- });
86
- $('select#qlwcdc_add_product_cart').change(function () {
87
- if ('ajax' === $(this).val()) {
88
- $('select#qlwcdc_add_product_cart_ajax_button').closest('tr, p').fadeIn();
89
- $('select#qlwcdc_add_product_cart_ajax_message').closest('tr, p').fadeIn();
90
- } else {
91
- $('select#qlwcdc_add_product_cart_ajax_button').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
92
- $('select#qlwcdc_add_product_cart_ajax_message').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
93
- }
94
- if ('redirect' === $(this).val()) {
95
- $('select#qlwcdc_add_product_cart_redirect_page').closest('tr, p').fadeIn();
96
- } else {
97
- $('select#qlwcdc_add_product_cart_redirect_page').closest('tr:not(.qlwcdc-premium-field), p').fadeOut();
98
- }
99
- $('select#qlwcdc_add_product_cart_redirect_page').change();
100
- }).change();*/
101
  $('select#qlwcdc_add_product_quick_purchase').change(function () {
102
  if ('yes' === $(this).val()) {
103
  $('select#qlwcdc_add_product_quick_purchase_to').closest('tr, p').fadeIn();
43
  }).change();
44
  // Archive
45
  // -----------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  $('select#qlwcdc_add_archive_text').change(function () {
47
  if ('yes' === $(this).val()) {
48
  $('select#qlwcdc_add_archive_text_in').closest('tr, p').fadeIn();
54
  }).change();
55
  // Product
56
  // -----------------------------------------------------------------
57
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  $('select#qlwcdc_add_product_quick_purchase').change(function () {
59
  if ('yes' === $(this).val()) {
60
  $('select#qlwcdc_add_product_quick_purchase_to').closest('tr, p').fadeIn();
assets/frontend/qlwcdc.js CHANGED
@@ -139,83 +139,6 @@
139
 
140
  });
141
 
142
- /*$(document).on('click', '.single_add_to_cart_button:not(.qlwcdc_quick_purchase):not(.disabled)', function (e) {
143
-
144
- if (qlwcdc.add_product_cart !== 'no') {
145
-
146
- var $thisbutton = $(this),
147
- $form = $thisbutton.closest('form.cart'),
148
- quantity = $form.find('input[name=quantity]').val() || 1,
149
- product_id = $form.find('input[name=variation_id]').val() || $thisbutton.val();
150
-
151
- if (product_id) {
152
-
153
- e.preventDefault();
154
-
155
- var data = {
156
- 'product_id': product_id,
157
- 'quantity': quantity
158
- };
159
-
160
- $(document.body).trigger('adding_to_cart', [$thisbutton, data]);
161
-
162
- $.ajax({
163
- type: 'POST',
164
- url: woocommerce_params.wc_ajax_url.toString().replace('%%endpoint%%', 'add_to_cart'),
165
- data: data,
166
- beforeSend: function (response) {
167
- $thisbutton.removeClass('added').addClass('loading');
168
- },
169
- complete: function (response) {
170
- $thisbutton.addClass('added').removeClass('loading');
171
- },
172
- success: function (response) {
173
-
174
- //if (response.error & response.product_url) {
175
- // window.location = response.product_url;
176
- // return;
177
- //}
178
-
179
- //console.log('test 2');
180
- //console.log(data);
181
- //console.log(response.cart_hash);
182
-
183
- $(document.body).trigger('added_to_cart', [response.fragments, response.cart_hash, $thisbutton]);
184
- },
185
- });
186
-
187
- return false;
188
-
189
- }
190
- }
191
-
192
- });*/
193
-
194
- /*$(document).bind('added_to_cart_message', function (e, cart) {
195
-
196
- $.ajax({
197
- type: 'POST',
198
- url: woocommerce_params.ajax_url,
199
- data: {
200
- action: 'qlwcdc_add_product_cart_ajax_message',
201
- 'queried_object_id': qlwcdc.queried_object_id,
202
- nonce: qlwcdc.nonce
203
- },
204
- beforeSend: function (response) {
205
- block($('.woocommerce-notices-wrapper:first'));
206
- },
207
- complete: function (response) {
208
- unblock($('.woocommerce-notices-wrapper:first'));
209
- },
210
- success: function (response) {
211
- console.log(response);
212
- if (response) {
213
- $('.woocommerce-notices-wrapper:first').replaceWith(response);
214
- }
215
- },
216
- });
217
- });*/
218
-
219
  $(document).on('keyup', '#qlwcdc_order_coupon_code', function (e) {
220
 
221
  var $form = $(this),
139
 
140
  });
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  $(document).on('keyup', '#qlwcdc_order_coupon_code', function (e) {
143
 
144
  var $form = $(this),
assets/frontend/qlwcdc.min.js CHANGED
@@ -1,2 +1 @@
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(k){k.preventDefault();k.stopPropagation();var g=d(this),p=d(k.delegateTarget);var i=p.find("[name=add-to-cart]").val()||0,j=p.find("[name=variation_id]").val()||0,h=p.find("[name=quantity]").val()||1,l=p.find("[name=license_key]").val()||0,o=p.find("[name=license_email]").val()||0,n=p.find("[name=license_renewal]").val()||0,m=p.find(".wc-pao-addon-field").serialize().replace(/\%5B%5D/g,"[]")||0;g.attr("data-href",function(q,r){if(r.indexOf("?")!=-1){g.attr("data-href",g.attr("data-href")+"&add-to-cart="+i)}else{g.attr("data-href",g.attr("data-href")+"?add-to-cart="+i)}});if(j){g.attr("data-href",g.attr("data-href")+"&variation_id="+j)}if(h){g.attr("data-href",g.attr("data-href")+"&quantity="+h)}if(m){g.attr("data-href",g.attr("data-href")+"&"+m)}if(l){g.attr("data-href",g.attr("data-href")+"&license_key="+l)}if(o){g.attr("data-href",g.attr("data-href")+"&license_email="+o)}if(n){g.attr("data-href",g.attr("data-href")+"&license_renewal="+n)}if(g.attr("data-href")!="undefined"){document.location.href=g.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);
 
1
  (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(k){k.preventDefault();k.stopPropagation();var g=d(this),p=d(k.delegateTarget);var i=p.find("[name=add-to-cart]").val()||0,j=p.find("[name=variation_id]").val()||0,h=p.find("[name=quantity]").val()||1,l=p.find("[name=license_key]").val()||0,o=p.find("[name=license_email]").val()||0,n=p.find("[name=license_renewal]").val()||0,m=p.find(".wc-pao-addon-field").serialize().replace(/\%5B%5D/g,"[]")||0;g.attr("data-href",function(q,r){if(r.indexOf("?")!=-1){g.attr("data-href",g.attr("data-href")+"&add-to-cart="+i)}else{g.attr("data-href",g.attr("data-href")+"?add-to-cart="+i)}});if(j){g.attr("data-href",g.attr("data-href")+"&variation_id="+j)}if(h){g.attr("data-href",g.attr("data-href")+"&quantity="+h)}if(m){g.attr("data-href",g.attr("data-href")+"&"+m)}if(l){g.attr("data-href",g.attr("data-href")+"&license_key="+l)}if(o){g.attr("data-href",g.attr("data-href")+"&license_email="+o)}if(n){g.attr("data-href",g.attr("data-href")+"&license_renewal="+n)}if(g.attr("data-href")!="undefined"){document.location.href=g.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/products.php CHANGED
@@ -29,62 +29,18 @@ if (!class_exists('QLWCDC_Products')) {
29
  'type' => 'title',
30
  'id' => 'qlwcdc_products_section_title'
31
  ),
32
- /* 'add_product_cart' => array(
33
- 'name' => esc_html__('Add to cart', 'woocommerce-direct-checkout'),
34
- 'desc_tip' => esc_html__('Add to cart button behaviour in products pages.', 'woocommerce-direct-checkout'),
35
- 'id' => 'qlwcdc_add_product_cart',
36
- 'type' => 'select',
37
- 'class' => 'chosen_select',
38
- 'options' => array(
39
- 'no' => esc_html__('Reload', 'woocommerce-direct-checkout'),
40
- 'ajax' => esc_html__('Ajax', 'woocommerce-direct-checkout'),
41
- 'redirect' => esc_html__('Redirect', 'woocommerce-direct-checkout'),
42
- ),
43
- 'default' => 'no',
44
- ),
45
- 'add_product_cart_ajax_button' => array(
46
- 'name' => esc_html__('Added to cart button', 'woocommerce-direct-checkout'),
47
- 'desc_tip' => esc_html__('Show or hide the added to cart forward button.', 'woocommerce-direct-checkout'),
48
- 'id' => 'qlwcdc_add_product_cart_ajax_button',
49
- 'type' => 'select',
50
- 'options' => array(
51
- 'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
52
- 'no' => esc_html__('No', 'woocommerce-direct-checkout'),
53
- ),
54
- 'default' => 'no',
55
- ),
56
- 'add_product_cart_ajax_message' => array(
57
- 'name' => esc_html__('Added to cart alert', 'woocommerce-direct-checkout'),
58
- 'desc_tip' => esc_html__('Include the "added to cart" alert message in product archives and shop.', 'woocommerce-direct-checkout'),
59
- 'id' => 'qlwcdc_add_product_cart_ajax_message',
60
- 'type' => 'select',
61
- 'class' => 'chosen_select',
62
- 'options' => array(
63
- 'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
64
- 'no' => esc_html__('No', 'woocommerce-direct-checkout'),
65
- ),
66
- 'default' => 'yes',
67
- ),
68
- 'add_product_cart_redirect_page' => array(
69
- 'name' => esc_html__('Added to cart redirect to', 'woocommerce-direct-checkout'),
70
- 'desc_tip' => esc_html__('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
71
- 'id' => 'qlwcdc_add_product_cart_redirect_page',
72
- 'type' => 'select',
73
- 'class' => 'chosen_select',
74
- 'options' => array(
75
- 'cart' => esc_html__('Cart', 'woocommerce-direct-checkout'),
76
- 'checkout' => esc_html__('Checkout', 'woocommerce-direct-checkout'),
77
- 'url' => esc_html__('Custom URL', 'woocommerce-direct-checkout'),
78
- ),
79
- 'default' => 'cart',
80
- ),
81
- 'add_product_cart_redirect_url' => array(
82
- 'name' => esc_html__('Added to cart redirect to custom url', 'woocommerce-direct-checkout'),
83
- 'desc_tip' => esc_html__('Redirect to the cart or checkout page after successful addition.', 'woocommerce-direct-checkout'),
84
- 'id' => 'qlwcdc_add_product_cart_redirect_url',
85
- 'type' => 'text',
86
- 'placeholder' => wc_get_checkout_url(),
87
- ), */
88
  'add_product_text' => array(
89
  'name' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
90
  'desc_tip' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
@@ -308,7 +264,7 @@ if (!class_exists('QLWCDC_Products')) {
308
  function add_product_tabs($tabs) {
309
 
310
  $tabs[QLWCDC_DOMAIN] = array(
311
- 'label' => esc_html__('Direct Checkout', 'qlwdd'),
312
  'target' => 'qlwcdc_options',
313
  );
314
 
@@ -349,46 +305,6 @@ if (!class_exists('QLWCDC_Products')) {
349
  <?php
350
  }
351
 
352
- /* function added_to_cart_button() {
353
-
354
- global $product;
355
-
356
- if ('no' === $this->get_product_option($product->get_id(), 'qlwcdc_add_product_cart_ajax_button', 'no')) {
357
- ?>
358
- <style>
359
- .added_to_cart.wc-forward {
360
- display: none!important;
361
- }
362
- </style>
363
- <?php
364
- }
365
- } */
366
-
367
- /* function add_to_cart_redirect($url) {
368
-
369
- //return 'https://1326';
370
-
371
- if (is_product()) {
372
-
373
- if ('redirect' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart')) {
374
-
375
- if ('cart' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_page')) {
376
- $url = wc_get_cart_url();
377
- }
378
-
379
- if ('checkout' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_page')) {
380
- $url = wc_get_checkout_url();
381
- }
382
-
383
- if ('url' === $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_page')) {
384
- $url = $this->get_product_option(get_queried_object_id(), 'qlwcdc_add_product_cart_redirect_url');
385
- }
386
- }
387
- }
388
-
389
- return $url;
390
- } */
391
-
392
  /* function added_to_cart_message_js() {
393
 
394
  global $product;
@@ -428,35 +344,6 @@ if (!class_exists('QLWCDC_Products')) {
428
  return $text;
429
  }
430
 
431
- /* function add_product_cart_ajax_message() {
432
-
433
- global $wp_query;
434
-
435
- if (!check_ajax_referer('woocommerce-direct-checkout', 'nonce', false)) {
436
- wp_send_json_error(esc_html__('Please reload page.', 'woocommerce-direct-checkout'));
437
- }
438
-
439
- if (isset($_POST['queried_object_id'])) {
440
-
441
- $product_id = absint($_POST['queried_object_id']);
442
-
443
- $args = array(
444
- 'p' => $product_id,
445
- 'post_type' => 'any'
446
- );
447
-
448
- $wp_query = new WP_Query($args);
449
- }
450
-
451
- ob_start();
452
-
453
- woocommerce_output_all_notices();
454
-
455
- $data = ob_get_clean();
456
-
457
- wp_send_json($data);
458
- } */
459
-
460
  /* function add_to_cart_class($class) {
461
 
462
  if (is_product() && get_option('qlwcdc_add_product_ajax')) {
@@ -499,8 +386,6 @@ if (!class_exists('QLWCDC_Products')) {
499
  }
500
 
501
  function init() {
502
- //add_action('wp_ajax_qlwcdc_add_product_cart_ajax_message', array($this, 'add_product_cart_ajax_message'));
503
- //add_action('wp_ajax_nopriv_qlwcdc_add_product_cart_ajax_message', array($this, 'add_product_cart_ajax_message'));
504
  add_filter('qlwcdc_add_sections', array($this, 'add_section'));
505
  add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
506
  //add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
29
  'type' => 'title',
30
  'id' => 'qlwcdc_products_section_title'
31
  ),
32
+ 'add_product_ajax' => array(
33
+ 'name' => esc_html__('Add ajax add to cart', 'woocommerce-direct-checkout'),
34
+ 'desc_tip' => esc_html__('Add products to cart via ajax.', 'woocommerce-direct-checkout'),
35
+ 'id' => 'qlwcdc_add_product_ajax',
36
+ 'type' => 'select',
37
+ 'class' => 'chosen_select qlwcdc-premium-field',
38
+ 'options' => array(
39
+ 'yes' => esc_html__('Yes', 'woocommerce-direct-checkout'),
40
+ 'no' => esc_html__('No', 'woocommerce-direct-checkout'),
41
+ ),
42
+ 'default' => 'no',
43
+ ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  'add_product_text' => array(
45
  'name' => esc_html__('Replace Add to cart text', 'woocommerce-direct-checkout'),
46
  'desc_tip' => esc_html__('Replace "Add to cart" text.', 'woocommerce-direct-checkout'),
264
  function add_product_tabs($tabs) {
265
 
266
  $tabs[QLWCDC_DOMAIN] = array(
267
+ 'label' => esc_html__('Direct Checkout', 'woocommerce-direct-checkout'),
268
  'target' => 'qlwcdc_options',
269
  );
270
 
305
  <?php
306
  }
307
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  /* function added_to_cart_message_js() {
309
 
310
  global $product;
344
  return $text;
345
  }
346
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  /* function add_to_cart_class($class) {
348
 
349
  if (is_product() && get_option('qlwcdc_add_product_ajax')) {
386
  }
387
 
388
  function init() {
 
 
389
  add_filter('qlwcdc_add_sections', array($this, 'add_section'));
390
  add_filter('qlwcdc_add_fields', array($this, 'add_fields'));
391
  //add_filter('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.8
6
  Tested up to: 5.2.2
7
- Stable tag: 2.2.5
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.5 =
57
  * Fix. WooCommerce Direct Checkout rating request remove non admin users
58
  * Fix. WooCommerce Direct Checkout page permissions
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.8
6
  Tested up to: 5.2.2
7
+ Stable tag: 2.2.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
53
 
54
  == Changelog ==
55
 
56
+ = 2.2.6 =
57
+ * Fix. WooCommerce Direct Checkout Premium compatibility
58
+
59
  = 2.2.5 =
60
  * Fix. WooCommerce Direct Checkout rating request remove non admin users
61
  * Fix. WooCommerce Direct Checkout page permissions
woocommerce-direct-checkout.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: WooCommerce Direct Checkout
4
  * Description: Simplifies the checkout process to improve your sales rate.
5
- * Version: 2.2.5
6
  * Author: QuadLayers
7
  * Author URI: https://www.quadlayers.com
8
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
@@ -15,7 +15,7 @@ if (!defined('QLWCDC_PLUGIN_NAME')) {
15
  define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
16
  }
17
  if (!defined('QLWCDC_PLUGIN_VERSION')) {
18
- define('QLWCDC_PLUGIN_VERSION', '2.2.5');
19
  }
20
  if (!defined('QLWCDC_PLUGIN_FILE')) {
21
  define('QLWCDC_PLUGIN_FILE', __FILE__);
@@ -222,6 +222,7 @@ if (!class_exists('QLWCDC')) {
222
  'use strict';
223
  $(window).on('load', function (e) {
224
  $('#qlwcdc_options').css({'opacity': '0.5', 'pointer-events': 'none'});
 
225
  $('label[for=qlwcdc_add_checkout_cart]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
226
  $('label[for=qlwcdc_add_checkout_cart_fields]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
227
  $('label[for=qlwcdc_add_checkout_cart_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
2
  /**
3
  * Plugin Name: WooCommerce Direct Checkout
4
  * Description: Simplifies the checkout process to improve your sales rate.
5
+ * Version: 2.2.6
6
  * Author: QuadLayers
7
  * Author URI: https://www.quadlayers.com
8
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
15
  define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
16
  }
17
  if (!defined('QLWCDC_PLUGIN_VERSION')) {
18
+ define('QLWCDC_PLUGIN_VERSION', '2.2.6');
19
  }
20
  if (!defined('QLWCDC_PLUGIN_FILE')) {
21
  define('QLWCDC_PLUGIN_FILE', __FILE__);
222
  'use strict';
223
  $(window).on('load', function (e) {
224
  $('#qlwcdc_options').css({'opacity': '0.5', 'pointer-events': 'none'});
225
+ $('label[for=qlwcdc_add_product_ajax]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
226
  $('label[for=qlwcdc_add_checkout_cart]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
227
  $('label[for=qlwcdc_add_checkout_cart_fields]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});
228
  $('label[for=qlwcdc_add_checkout_cart_class]').closest('tr').addClass('qlwcdc-premium-field').css({'opacity': '0.5', 'pointer-events': 'none'});