Product Collection: Fix the undefined array key 'woocommerceAttributes' warning after migrating from Products (Beta) (https://github.com/woocommerce/woocommerce-blocks/pull/11494)

This commit is contained in:
Daniel Dudzic 2023-10-30 18:56:04 +01:00 committed by GitHub
parent 53c53f0649
commit 9e3dff34c0
1 changed files with 2 additions and 1 deletions

View File

@ -302,6 +302,7 @@ class ProductCollection extends AbstractBlock {
);
$is_on_sale = $query['woocommerceOnSale'] ?? false;
$product_attributes = $query['woocommerceAttributes'] ?? [];
$taxonomies_query = $this->get_filter_by_taxonomies_query( $query['tax_query'] ?? [] );
$handpicked_products = $query['woocommerceHandPickedProducts'] ?? [];
@ -311,7 +312,7 @@ class ProductCollection extends AbstractBlock {
'on_sale' => $is_on_sale,
'stock_status' => $query['woocommerceStockStatus'],
'orderby' => $query['orderBy'],
'product_attributes' => $query['woocommerceAttributes'],
'product_attributes' => $product_attributes,
'taxonomies_query' => $taxonomies_query,
'handpicked_products' => $handpicked_products,
),