check if we are in checkout before disabling button

This commit is contained in:
David Remer 2020-07-14 10:05:21 +03:00
parent 4c122daf75
commit a82dda6cd9

View file

@ -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()