WooCommerce Direct Checkout - Version 2.2.0

Version Description

  • Fix. WooCommerce Quick Purchase button empty
  • Fix. WooCommerce Stripe card form update

=

Download this release

Release Info

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

Code changes from version 2.1.9 to 2.2.0

assets/qlwcdc.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * Version: 2.1.4
3
  */
4
 
5
  (function ($) {
@@ -88,9 +88,9 @@
88
  product_id = $form.find('[name=add-to-cart]').val() || 0,
89
  variation_id = $form.find('[name=variation_id]').val() || 0,
90
  quantity = $form.find('[name=quantity]').val() || 1,
91
- license_key = $form.find('[name=license_key]').val() || 1,
92
- license_email = $form.find('[name=license_email]').val() || 1,
93
- license_renewal = $form.find('[name=license_renewal]').val() || 1,
94
  addons = $form.find('.wc-pao-addon-field').serialize().replace(/\%5B%5D/g, '[]') || 0;
95
 
96
  $button.attr('data-href', function (i, h) {
@@ -289,7 +289,7 @@
289
  },
290
  success: function (response) {
291
  if (response) {
292
- $('#order_review').html($(response).html());
293
  }
294
  },
295
  });
1
  /**
2
+ * Version: 2.2.0
3
  */
4
 
5
  (function ($) {
88
  product_id = $form.find('[name=add-to-cart]').val() || 0,
89
  variation_id = $form.find('[name=variation_id]').val() || 0,
90
  quantity = $form.find('[name=quantity]').val() || 1,
91
+ license_key = $form.find('[name=license_key]').val() || 0,
92
+ license_email = $form.find('[name=license_email]').val() || 0,
93
+ license_renewal = $form.find('[name=license_renewal]').val() || 0,
94
  addons = $form.find('.wc-pao-addon-field').serialize().replace(/\%5B%5D/g, '[]') || 0;
95
 
96
  $button.attr('data-href', function (i, h) {
289
  },
290
  success: function (response) {
291
  if (response) {
292
+ $('#order_review').html($(response).html()).trigger('updated_checkout');
293
  }
294
  },
295
  });
assets/qlwcdc.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- (function(d){var c;var b=1000;var e=function(g){return g.is(".processing")||g.parents(".processing").length};var f=function(g){if(!e(g)){g.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:0.6}})}};var a=function(g){g.removeClass("processing").unblock()};d(document).on("click",".qlwcdc_quick_view",function(i){i.stopPropagation();i.preventDefault();var h=d(this).data("product_id"),g=d("#qlwcdc_quick_view_modal");if(h&&woocommerce_params.ajax_url){d.ajax({type:"post",url:woocommerce_params.ajax_url,data:{action:"qlwcdc_quick_view_modal",nonce:qlwcdc.nonce,product_id:h},complete:function(j){g.addClass("opening");setTimeout(function(){g.addClass("open");g.removeClass("opening")},50)},success:function(k){var j=d(k);j.find(".woocommerce-product-gallery").each(function(){d(this).wc_product_gallery()});j.on("click",".close",function(l){g.addClass("closing");setTimeout(function(){g.removeClass("open");g.removeClass("closing")},600)});g.find(".modal-content").replaceWith(j)}})}return false});d("#qlwcdc_quick_view_modal").on("click",function(h){var g=d(this);if(!g.closest(".modal-body").length){g.addClass("closing");setTimeout(function(){g.removeClass("open");g.removeClass("closing")},600)}});d(document).on("submit","form.cart",function(k){var g=d(k.delegateTarget.activeElement);if(g.hasClass("qlwcdc_quick_purchase")){var p=d(this),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()||1,o=p.find("[name=license_email]").val()||1,n=p.find("[name=license_renewal]").val()||1,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"){window.location=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())}},})},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)}})}return false});d("#qlwcdc_quick_view_modal").on("click",function(h){var g=d(this);if(!g.closest(".modal-body").length){g.addClass("closing");setTimeout(function(){g.removeClass("open");g.removeClass("closing")},600)}});d(document).on("submit","form.cart",function(k){var g=d(k.delegateTarget.activeElement);if(g.hasClass("qlwcdc_quick_purchase")){var p=d(this),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"){window.location=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);
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.1.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -49,6 +49,12 @@ The premium version of WooCommerce Direct Checkot allows to include a quick purc
49
 
50
  == Changelog ==
51
 
 
 
 
 
 
 
52
  = 2.1.9 =
53
  * Fix. WooCommerce Stripe card form update
54
 
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.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
49
 
50
  == Changelog ==
51
 
52
+ = 2.2.0 =
53
+ * Fix. WooCommerce Quick Purchase button empty
54
+ * Fix. WooCommerce Stripe card form update
55
+
56
+ == Changelog ==
57
+
58
  = 2.1.9 =
59
  * Fix. WooCommerce Stripe card form update
60
 
woocommerce-direct-checkout.php CHANGED
@@ -2,13 +2,12 @@
2
  /**
3
  * Plugin Name: WooCommerce Direct Checkout
4
  * Description: Simplifies the checkout process to improve your sales rate.
5
- * Version: 2.1.9
6
  * Author: QuadLayers
7
  * Author URI: https://www.quadlayers.com
8
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
9
  * Text Domain: woocommerce-direct-checkout
10
  */
11
-
12
  if (!defined('ABSPATH')) {
13
  die('-1');
14
  }
@@ -16,7 +15,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.1.9');
20
  }
21
  if (!defined('QLWCDC_PLUGIN_FILE')) {
22
  define('QLWCDC_PLUGIN_FILE', __FILE__);
@@ -114,7 +113,7 @@ if (!class_exists('QLWCDC')) {
114
  </script>
115
  <?php
116
  }
117
- }
118
 
119
  function get_product_option($product_id = null, $meta_key = null, $default = null) {
120
 
@@ -123,7 +122,10 @@ if (!class_exists('QLWCDC')) {
123
  }
124
 
125
  if ($product_id && metadata_exists('post', $product_id, $meta_key)) {
126
- return get_post_meta($product_id, $meta_key, true);
 
 
 
127
  }
128
 
129
  return get_option($meta_key, $default);
2
  /**
3
  * Plugin Name: WooCommerce Direct Checkout
4
  * Description: Simplifies the checkout process to improve your sales rate.
5
+ * Version: 2.2.0
6
  * Author: QuadLayers
7
  * Author URI: https://www.quadlayers.com
8
  * Copyright: 2019 QuadLayers (https://www.quadlayers.com)
9
  * Text Domain: woocommerce-direct-checkout
10
  */
 
11
  if (!defined('ABSPATH')) {
12
  die('-1');
13
  }
15
  define('QLWCDC_PLUGIN_NAME', 'WooCommerce Direct Checkout');
16
  }
17
  if (!defined('QLWCDC_PLUGIN_VERSION')) {
18
+ define('QLWCDC_PLUGIN_VERSION', '2.2.0');
19
  }
20
  if (!defined('QLWCDC_PLUGIN_FILE')) {
21
  define('QLWCDC_PLUGIN_FILE', __FILE__);
113
  </script>
114
  <?php
115
  }
116
+ }
117
 
118
  function get_product_option($product_id = null, $meta_key = null, $default = null) {
119
 
122
  }
123
 
124
  if ($product_id && metadata_exists('post', $product_id, $meta_key)) {
125
+
126
+ if ($value = get_post_meta($product_id, $meta_key, true)) {
127
+ return $value;
128
+ }
129
  }
130
 
131
  return get_option($meta_key, $default);