From fbc20c35eaf0220b84a92a509ddcc461b323a84f Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Fri, 25 Mar 2022 16:15:18 +0400 Subject: [PATCH 1/4] Fix the product price amount calculation --- .../js/modules/ContextBootstrap/SingleProductBootstap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index 33658d9c2..8192be38f 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -48,8 +48,8 @@ class SingleProductBootstap { else if (document.querySelector('form.cart .woocommerce-Price-amount')) { priceText = document.querySelector('form.cart .woocommerce-Price-amount').innerText; } - else if (document.querySelector('.woocommerce-Price-amount')) { - priceText = document.querySelector('.woocommerce-Price-amount').innerText; + else if (document.querySelector('.product .woocommerce-Price-amount')) { + priceText = document.querySelector('.product .woocommerce-Price-amount').innerText; } const amount = parseFloat(priceText.replace(/([^\d,\.\s]*)/g, '')); return amount === 0; From 0f47429d916bc885554469f6ec8540f4a9a8820d Mon Sep 17 00:00:00 2001 From: dinamiko Date: Mon, 28 Mar 2022 15:24:46 +0200 Subject: [PATCH 2/4] Remove vaulting conditional on minicart render buttons --- .../resources/js/modules/ContextBootstrap/MiniCartBootstap.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js index 1942417a0..1a45e6814 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js @@ -22,10 +22,6 @@ class MiniCartBootstap { } shouldRender() { - if (!this.gateway.can_save_vault_token) { - return; - } - return document.querySelector(this.gateway.button.mini_cart_wrapper) !== null || document.querySelector(this.gateway.hosted_fields.mini_cart_wrapper) !== null; } From 78d98be098f1273bcc08e1b5f8486c2a99bddf9e Mon Sep 17 00:00:00 2001 From: dinamiko Date: Mon, 28 Mar 2022 16:33:45 +0200 Subject: [PATCH 3/4] Move up pay order render button before checking empty cart --- modules/ppcp-button/src/Assets/SmartButton.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 853c14dc5..2420b9277 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -352,6 +352,8 @@ class SmartButton implements SmartButtonInterface { ); } + add_action( $this->pay_order_renderer_hook(), array( $this, 'button_renderer' ), 10 ); + if ( $this->is_cart_price_total_zero() ) { return false; } @@ -390,7 +392,6 @@ class SmartButton implements SmartButtonInterface { } add_action( $this->checkout_button_renderer_hook(), array( $this, 'button_renderer' ), 10 ); - add_action( $this->pay_order_renderer_hook(), array( $this, 'button_renderer' ), 10 ); return true; } From d8e1b09ad6a1d368c67081d3e89c719c5750a3be Mon Sep 17 00:00:00 2001 From: dinamiko Date: Mon, 28 Mar 2022 17:16:56 +0200 Subject: [PATCH 4/4] Update changelog --- changelog.txt | 3 +++ readme.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/changelog.txt b/changelog.txt index 137b2a363..49beeadf4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,9 @@ * Fix - Incorrect TAX details on PayPal order overview #541 * Fix - "Place order" button looking unstyled in the Twenty Twenty-Two theme #478 * Fix - PayPal options available on minicart when adding subscription to the cart from shop page without vaulting enabled #518 +* Fix - Buttons not visible on products page #551 +* Fix - Buttons not visible in mini-cart #553 +* Fix - PayPal button missing on pay for order page #555 * Enhancement - PayPal buttons loading time #533 * Enhancement - Improve payment token checking for subscriptions #525 * Enhancement - Add Spain and Italy to messaging #497 diff --git a/readme.txt b/readme.txt index 2a0388fdb..1b8288ca9 100644 --- a/readme.txt +++ b/readme.txt @@ -88,6 +88,9 @@ Follow the steps below to connect the plugin to your PayPal account: * Fix - Incorrect TAX details on PayPal order overview #541 * Fix - "Place order" button looking unstyled in the Twenty Twenty-Two theme #478 * Fix - PayPal options available on minicart when adding subscription to the cart from shop page without vaulting enabled #518 +* Fix - Buttons not visible on products page #551 +* Fix - Buttons not visible in mini-cart #553 +* Fix - PayPal button missing on pay for order page #555 * Enhancement - PayPal buttons loading time #533 * Enhancement - Improve payment token checking for subscriptions #525 * Enhancement - Add Spain and Italy to messaging #497