This commit is contained in:
David Remer 2020-07-14 10:07:31 +03:00
parent a82dda6cd9
commit bf85d3d47d

View file

@ -58,7 +58,8 @@ class SmartButton implements SmartButtonInterface
$buttonRenderer = static function () { $buttonRenderer = static function () {
$product = wc_get_product(); $product = wc_get_product();
if (! is_checkout() && is_a($product, \WC_Product::class) if (
! is_checkout() && is_a($product, \WC_Product::class)
&& ( && (
$product->is_type(['external', 'grouped']) $product->is_type(['external', 'grouped'])
|| ! $product->is_in_stock() || ! $product->is_in_stock()
@ -75,7 +76,8 @@ class SmartButton implements SmartButtonInterface
return; return;
} }
$product = wc_get_product(); $product = wc_get_product();
if (! is_checkout() && is_a($product, \WC_Product::class) if (
! is_checkout() && is_a($product, \WC_Product::class)
&& ( && (
$product->is_type(['external', 'grouped']) $product->is_type(['external', 'grouped'])
|| ! $product->is_in_stock() || ! $product->is_in_stock()