switch get_price() checks to is_purchasable() for displaying Add to Cart button

This commit is contained in:
kathy 2012-08-06 19:27:24 -05:00
parent cedcca7fe7
commit f2415b3761
3 changed files with 3 additions and 3 deletions

View File

@ -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 */

View File

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

View File

@ -5,7 +5,7 @@
global $woocommerce, $product;
if ( $product->get_price() === '' ) return;
if ( ! $product->is_purchasable() ) return;
?>
<?php