Handle search params in filters

Closes #12685
This commit is contained in:
Mike Jolley 2016-12-23 14:45:58 +00:00
parent a3f8ffb101
commit e9be3a425a
2 changed files with 8 additions and 0 deletions

View File

@ -165,6 +165,10 @@ class WC_Widget_Price_Filter extends WC_Widget {
AND price_meta.meta_value > '' "; AND price_meta.meta_value > '' ";
$sql .= $tax_query_sql['where'] . $meta_query_sql['where']; $sql .= $tax_query_sql['where'] . $meta_query_sql['where'];
if ( $search = WC_Query::get_main_search_query_sql() ) {
$sql .= ' AND ' . $search;
}
return $wpdb->get_row( $sql ); return $wpdb->get_row( $sql );
} }
} }

View File

@ -129,6 +129,10 @@ class WC_Widget_Rating_Filter extends WC_Widget {
$sql .= " WHERE {$wpdb->posts}.post_type = 'product' AND {$wpdb->posts}.post_status = 'publish' "; $sql .= " WHERE {$wpdb->posts}.post_type = 'product' AND {$wpdb->posts}.post_status = 'publish' ";
$sql .= $tax_query_sql['where'] . $meta_query_sql['where']; $sql .= $tax_query_sql['where'] . $meta_query_sql['where'];
if ( $search = WC_Query::get_main_search_query_sql() ) {
$sql .= ' AND ' . $search;
}
return absint( $wpdb->get_var( $sql ) ); return absint( $wpdb->get_var( $sql ) );
} }