From a82dda6cd9147ed7610cd7006235f3544c150170 Mon Sep 17 00:00:00 2001 From: David Remer Date: Tue, 14 Jul 2020 10:05:21 +0300 Subject: [PATCH] check if we are in checkout before disabling button --- modules.local/ppcp-button/src/Assets/SmartButton.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules.local/ppcp-button/src/Assets/SmartButton.php b/modules.local/ppcp-button/src/Assets/SmartButton.php index bb9d5bb63..ab7add156 100644 --- a/modules.local/ppcp-button/src/Assets/SmartButton.php +++ b/modules.local/ppcp-button/src/Assets/SmartButton.php @@ -58,7 +58,7 @@ class SmartButton implements SmartButtonInterface $buttonRenderer = static function () { $product = wc_get_product(); - if (is_a($product, \WC_Product::class) + if (! is_checkout() && is_a($product, \WC_Product::class) && ( $product->is_type(['external', 'grouped']) || ! $product->is_in_stock() @@ -75,7 +75,7 @@ class SmartButton implements SmartButtonInterface return; } $product = wc_get_product(); - if (is_a($product, \WC_Product::class) + if (! is_checkout() && is_a($product, \WC_Product::class) && ( $product->is_type(['external', 'grouped']) || ! $product->is_in_stock()