Merge pull request #8754 from JeroenSormani/is_on_sale
FIx is_on_sale bug on variable products
This commit is contained in:
commit
77b2316d80
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue