woocommerce/plugins/woocommerce-blocks/assets/js/blocks/product-collection
Manish Menaria 033a92d536 Product Collection: Add support for filtering products by featured status (https://github.com/woocommerce/woocommerce-blocks/pull/11522)
* Add support for filtering products by featured status

- Added `featured` attribute to `ProductCollectionQuery` type to enable filtering by featured status.
- Implemented `FeaturedProductsControl` to provide a toggle option in the inspector controls.
- Integrated `FeaturedProductsControl` into `ProductCollectionInspectorControls`.
- Added `get_featured_query` function in `ProductCollection` class to generate query for fetching featured products.
- Updated existing functions and queries in `ProductCollection` class to support featured products filtering.

* Revert changes to composer.lock

* Refactor handling of 'featured' parameter

This commit makes the handling of the 'featured' parameter consistent in the ProductCollection class. Previously, the 'featured' parameter was being type-casted to boolean, which was not necessary and could lead to incorrect results. Now, the 'featured' parameter is used directly without type-casting, and the check for 'featured' products in the get_featured_query method has been updated accordingly. This ensures that the 'featured' parameter is handled consistently and correctly throughout the class.

* Handle undefined 'featured' index

This commit adds null coalescing operator to handle the case when 'featured' index is not set in the $query array. This prevents potential PHP notices or errors that may arise when trying to access an undefined index.
2023-11-08 15:37:32 +05:30
..
inspector-controls Product Collection: Add support for filtering products by featured status (https://github.com/woocommerce/woocommerce-blocks/pull/11522) 2023-11-08 15:37:32 +05:30
toolbar-controls Add pattern chooser in Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10876) 2023-09-14 14:19:16 +02:00
variations Enable Product Collection as a core feature (https://github.com/woocommerce/woocommerce-blocks/pull/10524) 2023-08-25 15:58:11 +02:00
block.json Enable Product Collection as a core feature (https://github.com/woocommerce/woocommerce-blocks/pull/10524) 2023-08-25 15:58:11 +02:00
constants.ts Product Collection: Add support for filtering products by featured status (https://github.com/woocommerce/woocommerce-blocks/pull/11522) 2023-11-08 15:37:32 +05:30
edit.tsx Add Display Settings Toolbar to the Product Collection Block (https://github.com/woocommerce/woocommerce-blocks/pull/9747) 2023-06-19 10:37:05 +05:30
editor.scss Add pattern chooser in Product Collection (https://github.com/woocommerce/woocommerce-blocks/pull/10876) 2023-09-14 14:19:16 +02:00
icon.tsx Foundation of New Product Collection Block (https://github.com/woocommerce/woocommerce-blocks/pull/9352) 2023-05-15 08:51:49 +00:00
index.tsx Enable Product Collection as a core feature (https://github.com/woocommerce/woocommerce-blocks/pull/10524) 2023-08-25 15:58:11 +02:00
save.tsx Foundation of New Product Collection Block (https://github.com/woocommerce/woocommerce-blocks/pull/9352) 2023-05-15 08:51:49 +00:00
types.ts Product Collection: Add support for filtering products by featured status (https://github.com/woocommerce/woocommerce-blocks/pull/11522) 2023-11-08 15:37:32 +05:30
utils.tsx Product Collection - Add Inherit query from template control (https://github.com/woocommerce/woocommerce-blocks/pull/9485) 2023-06-05 06:09:11 +00:00