Merge pull request #1344 from helgatheviking/helgafork

switch get_price() checks to is_purchasable() for displaying Add to Cart...
This commit is contained in:
Mike Jolley 2012-08-07 01:25:06 -07:00
commit be48ed5be5
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