Fix is_on_sale for variations. Closes #3247.
This commit is contained in:
parent
4e5558490c
commit
05d8b708bb
|
@ -210,8 +210,9 @@ class WC_Product_Variable extends WC_Product {
|
|||
if ( $this->has_child() ) {
|
||||
|
||||
foreach ( $this->get_children() as $child_id ) {
|
||||
$price = get_post_meta( $child_id, '_price', true );
|
||||
$sale_price = get_post_meta( $child_id, '_sale_price', true );
|
||||
if ( $sale_price !== "" && $sale_price >= 0 )
|
||||
if ( $sale_price !== "" && $sale_price >= 0 && $sale_price == $price )
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue