diff --git a/modules/ppcp-blocks/resources/js/checkout-block.js b/modules/ppcp-blocks/resources/js/checkout-block.js index cbf57eba1..8b931d745 100644 --- a/modules/ppcp-blocks/resources/js/checkout-block.js +++ b/modules/ppcp-blocks/resources/js/checkout-block.js @@ -466,9 +466,10 @@ const features = ['products']; let block_enabled = true; if(cartHasSubscriptionProducts(config.scriptData)) { - // Don't show buttons on block cart page if using vault v2 + // Don't show buttons on block cart page if using vault v2 and user is not logged in if ( - config.scriptData.context === "cart-block" + ! config.scriptData.user.is_logged + && config.scriptData.context === "cart-block" && ! isPayPalSubscription(config.scriptData) // using vaulting && ! config.scriptData?.save_payment_methods?.id_token // not vault v3 ) { diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 2f6a24781..8cdc679c0 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -1170,6 +1170,9 @@ document.querySelector("#payment").before(document.querySelector("#ppcp-messages 'basic_checkout_validation_enabled' => $this->basic_checkout_validation_enabled, 'early_checkout_validation_enabled' => $this->early_validation_enabled, 'funding_sources_without_redirect' => $this->funding_sources_without_redirect, + 'user' => array( + 'is_logged' => is_user_logged_in(), + ), ); if ( 'pay-now' === $this->context() ) {