woocommerce/plugins/woocommerce-blocks/assets/js/blocks/product-collection/edit
Manish Menaria d43b3af43f
Product Collection: Add "Related by" setting to Related Products collection (#52580)
* feat: Add related by setting to related products collection

This commit adds a new setting to the related products collection that allows
users to control how products are related. Users can choose to relate products
by categories, tags, or attributes.

* Remove attributes from related by control

This commit removes the attributes option from the related by control in the
Product Collection block. This option was not being used in the backend and
was potentially misleading to users.

Changes made:
- Removed attributes checkbox from RelatedByControl component
- Removed attributes from RelatedBy type definition
- Cleaned up PHP code by using PHP_INT_MAX instead of magic number

* feat: Set default values for related by setting

This commit sets the default values for the relatedBy setting in the Product
Collection block. By default, products will be related by both categories and
tags.

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* Add tracking for related-by filter

* Add e2e test for "Related by" setting in Related Products collection

* Remove unused import for VStack

* Add optional chaining operator for query.relatedBy

Since relatedBy is an optional prop, add the optional chaining operator to
safely access it and prevent potential undefined property access errors.

* Add tracking for related by changes in Product Collection block

This commit adds tracking for when users change the "Related by" settings in
the Product Collection block inspector controls. It records whether categories
and tags are enabled or disabled.

* Update panel title from "Relate by" to "Related by"

* Remove `blocks_product_collection_inspector_control_related_by_changed` track event

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-11-11 15:12:17 -03:00
..
inspector-advanced-controls Product Collection: Rename "Force Page Reload" control to "Reload Full Page" and update copy (#52631) 2024-11-08 10:16:01 +01:00
inspector-controls Product Collection: Add "Related by" setting to Related Products collection (#52580) 2024-11-11 15:12:17 -03:00
toolbar-controls Product Collection: Support registering product collection that isn't displayed in Collection Chooser (#52057) 2024-10-22 14:02:32 +05:30
ProductPicker.tsx Product Collection - Add Editor UI for missing product reference (#51114) 2024-09-17 14:08:24 +05:30
collection-chooser.tsx Product Collection: Support registering product collection that isn't displayed in Collection Chooser (#52057) 2024-10-22 14:02:32 +05:30
collection-selection-modal.tsx Record `Cancel` and `Close` events on modal to change collection type (#52314) 2024-10-28 11:31:19 -03:00
editor.scss Product Collection: Add option for current product as a reference (#51359) 2024-09-22 15:30:29 +05:30
index.tsx Add tracking to collection replacement (#52266) 2024-10-28 10:42:34 +01:00
product-collection-content.tsx Add Dimensions controls to Product Collection block (#51420) 2024-09-27 05:04:16 +02:00
product-collection-placeholder.tsx Add tracking to collection replacement (#52266) 2024-10-28 10:42:34 +01:00