switch get_price() checks to is_purchasable() for displaying Add to Cart button
This commit is contained in:
parent
cedcca7fe7
commit
f2415b3761
|
@ -605,7 +605,7 @@ class WC_Product {
|
|||
elseif ( $this->get_price() === '' )
|
||||
$purchasable = false;
|
||||
|
||||
return apply_filters( 'woocommerce_is_purchasable', $purchasable );
|
||||
return apply_filters( 'woocommerce_is_purchasable', $purchasable, $this );
|
||||
}
|
||||
|
||||
/** Returns the price (excluding tax) - ignores tax_class filters since the price may *include* tax and thus needs subtracting */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
global $product;
|
||||
|
||||
if ( $product->get_price() === '' && $product->product_type != 'external' ) return;
|
||||
if ( ! $product->is_purchasable() && $product->product_type != 'external' ) return;
|
||||
?>
|
||||
|
||||
<?php if ( ! $product->is_in_stock() ) : ?>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
global $woocommerce, $product;
|
||||
|
||||
if ( $product->get_price() === '' ) return;
|
||||
if ( ! $product->is_purchasable() ) return;
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue