Fix filtering by product type on Store API (https://github.com/woocommerce/woocommerce-blocks/pull/4422)
* Fixed $tax_query being set to an empty array * Remove whitespace causing PHP coding standards test to fail * Cleanup: add line break Co-authored-by: Michael P. Pfeiffer <frontdevde@users.noreply.github.com>
This commit is contained in:
parent
522f722b2b
commit
f3e798d7dd
|
@ -41,6 +41,9 @@ class ProductQuery {
|
|||
$args['post_type'] = [ 'product', 'product_variation' ];
|
||||
}
|
||||
|
||||
// Taxonomy query to filter products by type, category, tag, shipping class, and attribute.
|
||||
$tax_query = [];
|
||||
|
||||
// Filter product type by slug.
|
||||
if ( ! empty( $request['type'] ) ) {
|
||||
if ( 'variation' === $request['type'] ) {
|
||||
|
@ -88,9 +91,6 @@ class ProductQuery {
|
|||
}
|
||||
}
|
||||
|
||||
// Taxonomy query to filter products by type, category, tag, shipping class, and attribute.
|
||||
$tax_query = [];
|
||||
|
||||
$operator_mapping = [
|
||||
'in' => 'IN',
|
||||
'not_in' => 'NOT IN',
|
||||
|
|
Loading…
Reference in New Issue