From e4ec8f8630aad69ad064dad9bce85a2308fc7be3 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 17 Oct 2023 09:59:12 +0300 Subject: [PATCH] Fix is_checkout usage --- modules/ppcp-button/src/Assets/SmartButton.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index aaf97e13b..e298c1d1c 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -684,8 +684,10 @@ class SmartButton implements SmartButtonInterface { $product = wc_get_product(); + $location = $this->location(); + if ( - ! is_checkout() && is_a( $product, WC_Product::class ) + $location === 'product' && is_a( $product, WC_Product::class ) /** * The filter returning true if PayPal buttons can be rendered, or false otherwise. */