Merge pull request #14352 from woocommerce/fix/grouped-sale-badge
Grouped sale badge fix
This commit is contained in:
commit
a0822e6d1f
|
@ -52,7 +52,7 @@ class WC_Product_Grouped extends WC_Product {
|
|||
public function is_on_sale( $context = 'view' ) {
|
||||
global $wpdb;
|
||||
|
||||
$on_sale = $this->get_children() && 1 === $wpdb->get_var( "SELECT 1 FROM $wpdb->postmeta WHERE meta_key = '_sale_price' AND meta_value > 0 AND post_id IN (" . implode( ',', array_map( 'esc_sql', $this->get_children() ) ) . ");" );
|
||||
$on_sale = $this->get_children() && null !== $wpdb->get_var( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_sale_price' AND meta_value > 0 AND post_id IN (" . implode( ',', array_map( 'esc_sql', $this->get_children() ) ) . ");" );
|
||||
|
||||
return 'view' === $context ? apply_filters( 'woocommerce_product_is_on_sale', $on_sale, $this ) : $on_sale;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue