From 62724f56b2758100ce8b3c39635cd9b672fa80cc Mon Sep 17 00:00:00 2001 From: Kcppdevelopers Date: Fri, 21 Jul 2017 19:01:30 +0530 Subject: [PATCH] Express Checkout - In Context Checkout Integration, ref #199 --- assets/js/angelleye-express-checkout.js | 12 +++++++++++- assets/js/angelleye-frontend.js | 8 +------- assets/js/angelleye-in-context-checkout.js | 7 ++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/assets/js/angelleye-express-checkout.js b/assets/js/angelleye-express-checkout.js index 19c4b8e5c..b694affc9 100644 --- a/assets/js/angelleye-express-checkout.js +++ b/assets/js/angelleye-express-checkout.js @@ -7,4 +7,14 @@ })) : void 0; }); } -}).call(this); \ No newline at end of file +}).call(this); + +jQuery(document).ready(function ($) { +var is_set_class = $("div").is(".express-provided-address"); +if (is_set_class) { + jQuery('#express_checkout_button_chekout_page').hide(); + jQuery('#express_checkout_button_text').hide(); + jQuery('.woocommerce-message').hide(); + jQuery('#checkout_paypal_message').hide(); +} +}); \ No newline at end of file diff --git a/assets/js/angelleye-frontend.js b/assets/js/angelleye-frontend.js index 0b4bd4ae0..64534ad14 100644 --- a/assets/js/angelleye-frontend.js +++ b/assets/js/angelleye-frontend.js @@ -41,13 +41,7 @@ jQuery(document).ready(function ($) { } if (angelleye_frontend.is_checkout == "yes") { - var is_set_class = $("div").is(".express-provided-address"); - if (is_set_class) { - jQuery('#express_checkout_button_chekout_page').hide(); - jQuery('#express_checkout_button_text').hide(); - jQuery('.woocommerce-message').hide(); - jQuery('#checkout_paypal_message').hide(); - } + jQuery(".paypal_checkout_button").click(function () { $('.woocommerce').block({ message: null, diff --git a/assets/js/angelleye-in-context-checkout.js b/assets/js/angelleye-in-context-checkout.js index 8b454e222..74fee1fd9 100644 --- a/assets/js/angelleye-in-context-checkout.js +++ b/assets/js/angelleye-in-context-checkout.js @@ -1,9 +1,7 @@ ; (function ($, window, document) { if (angelleye_in_content_param.is_product == 'no') { - var target_url = ''; - window.paypalCheckoutReady = function () { setInterval(function () { @@ -35,7 +33,7 @@ } else { - + window.paypalCheckoutReady = function () { paypal.checkout.setup(angelleye_in_content_param.payer_id, { environment: angelleye_in_content_param.environment, @@ -107,5 +105,8 @@ }); } + + + } })(jQuery, window, document); \ No newline at end of file