Fix for 0 sale price not returning true in is_on_sale

As committed on master branch:
- 97ad6e0cda
This commit is contained in:
Coen Jacobs 2013-05-08 13:54:06 +02:00
parent 86e03c1048
commit 628677d4a0
2 changed files with 2 additions and 1 deletions

View File

@ -637,7 +637,7 @@ class WC_Product {
* @return bool
*/
function is_on_sale() {
return $this->sale_price && $this->sale_price == $this->price ? true : false;
return isset( $this->sale_price ) && $this->sale_price == $this->price ? true : false;
}

View File

@ -174,6 +174,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Have the remove_taxes() method set subtotal to subtotal_ex_tax
* Fix - Allow layered nav to work with non pa_ prepended taxonomies
* Fix - Better backwards compatibility with _woocommerce_exclude_image
* Fix - is_on_sale() method now returns true for products with a sale product of 0
= 2.0.9 - 02/05/2013 =
* Feature - Added is_product_taxonomy() conditonal.