Merge pull request #8754 from JeroenSormani/is_on_sale

FIx is_on_sale bug on variable products
This commit is contained in:
Mike Jolley 2015-08-10 15:43:35 +01:00
commit 77b2316d80
1 changed files with 1 additions and 1 deletions

View File

@ -201,7 +201,7 @@ class WC_Product_Variable extends WC_Product {
public function is_on_sale() { public function is_on_sale() {
$is_on_sale = false; $is_on_sale = false;
$prices = $this->get_variation_prices(); $prices = $this->get_variation_prices();
if ( $prices['regular_price'] !== $prices['price'] ) { if ( $prices['regular_price'] !== $prices['sale_price'] && $prices['sale_price'] === $prices['price'] ) {
$is_on_sale = true; $is_on_sale = true;
} }
return apply_filters( 'woocommerce_product_is_on_sale', $is_on_sale, $this ); return apply_filters( 'woocommerce_product_is_on_sale', $is_on_sale, $this );