WooCommerce Direct Checkout - Version 2.2.8

Version Description

  • Fix: suggestions plugins update
  • Fix: WooCommerce Direct Checkout products variations quick purchase
Download this release

Release Info

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

Code changes from version 2.2.7 to 2.2.8

assets/frontend/qlwcdc.js CHANGED
@@ -92,12 +92,7 @@
92
  $form = $(e.delegateTarget);
93
 
94
  var product_id = $form.find('[name=add-to-cart]').val() || 0,
95
- variation_id = $form.find('[name=variation_id]').val() || 0,
96
- quantity = $form.find('[name=quantity]').val() || 1,
97
- license_key = $form.find('[name=license_key]').val() || 0,
98
- license_email = $form.find('[name=license_email]').val() || 0,
99
- license_renewal = $form.find('[name=license_renewal]').val() || 0,
100
- addons = $form.find('.wc-pao-addon-field').serialize().replace(/\%5B%5D/g, '[]') || 0;
101
 
102
  $button.attr('data-href', function (i, h) {
103
  if (h.indexOf('?') != -1) {
@@ -107,28 +102,8 @@
107
  }
108
  });
109
 
110
- if (variation_id) {
111
- $button.attr('data-href', $button.attr('data-href') + '&variation_id=' + variation_id);
112
- }
113
-
114
- if (quantity) {
115
- $button.attr('data-href', $button.attr('data-href') + '&quantity=' + quantity);
116
- }
117
-
118
- if (addons) {
119
- $button.attr('data-href', $button.attr('data-href') + '&' + addons);
120
- }
121
-
122
- if (license_key) {
123
- $button.attr('data-href', $button.attr('data-href') + '&license_key=' + license_key);
124
- }
125
-
126
- if (license_email) {
127
- $button.attr('data-href', $button.attr('data-href') + '&license_email=' + license_email);
128
- }
129
-
130
- if (license_renewal) {
131
- $button.attr('data-href', $button.attr('data-href') + '&license_renewal=' + license_renewal);
132
  }
133
 
134
  if ($button.attr('data-href') != 'undefined') {
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) {
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') {
assets/frontend/qlwcdc.min.js CHANGED
@@ -1 +1,2 @@
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);
 
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/products.php CHANGED
@@ -143,7 +143,7 @@ if (!class_exists('QLWCDC_Products')) {
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'),
@@ -255,6 +255,12 @@ if (!class_exists('QLWCDC_Products')) {
255
  $this->add_setting_field($field);
256
  }
257
  ?>
 
 
 
 
 
 
258
  </div>
259
  <?php
260
  }
@@ -266,7 +272,7 @@ if (!class_exists('QLWCDC_Products')) {
266
  }
267
 
268
  return $text;
269
- }
270
 
271
  function validate_add_cart_item($passed, $product_id, $qty, $post_data = null) {
272
 
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'),
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
  }
272
  }
273
 
274
  return $text;
275
+ }
276
 
277
  function validate_add_cart_item($passed, $product_id, $qty, $post_data = null) {
278
 
includes/suggestions-list-table.php CHANGED
@@ -99,6 +99,7 @@ class QLWCDC_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
99
  wp_enqueue_script('plugin-install');
100
  wp_enqueue_script('thickbox');
101
  wp_enqueue_script('updates');
 
102
 
103
  wp_reset_vars(array('tab'));
104
 
@@ -127,6 +128,11 @@ class QLWCDC_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
127
  }
128
 
129
  $this->items = $this->get_plugins();
 
 
 
 
 
130
  }
131
 
132
  }
99
  wp_enqueue_script('plugin-install');
100
  wp_enqueue_script('thickbox');
101
  wp_enqueue_script('updates');
102
+ wp_localize_script('updates', 'pagenow', 'plugin-install-network');
103
 
104
  wp_reset_vars(array('tab'));
105
 
128
  }
129
 
130
  $this->items = $this->get_plugins();
131
+
132
+
133
+ wp_localize_script('updates', '_wpUpdatesItemCounts', array(
134
+ 'totals' => wp_get_update_data())
135
+ );
136
  }
137
 
138
  }
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.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -53,6 +53,10 @@ The premium version of WooCommerce Direct Checkot allows to include a quick purc
53
 
54
  == Changelog ==
55
 
 
 
 
 
56
  = 2.2.7 =
57
  * Fix. WooCommerce Direct Checkout Premium compatibility
58
 
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.8
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.8 =
57
+ * Fix: suggestions plugins update
58
+ * Fix: WooCommerce Direct Checkout products variations quick purchase
59
+
60
  = 2.2.7 =
61
  * Fix. WooCommerce Direct Checkout Premium compatibility
62
 
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.7
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.7');
19
  }
20
  if (!defined('QLWCDC_PLUGIN_FILE')) {
21
  define('QLWCDC_PLUGIN_FILE', __FILE__);
2
  /**
3
  * Plugin Name: WooCommerce Direct Checkout
4
  * Description: Simplifies the checkout process to improve your sales rate.
5
+ * Version: 2.2.8
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.8');
19
  }
20
  if (!defined('QLWCDC_PLUGIN_FILE')) {
21
  define('QLWCDC_PLUGIN_FILE', __FILE__);