This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Product Query: extend the Query Loop block with capabilities for more specific queries #6795
Labels
block-type: product-grid
Issues related to/affecting all product-grid type blocks.
focus: FSE
Work related to prepare WooCommerce for FSE.
type: enhancement
The issue is a request for an enhancement.
The Query Loop block will need to be extended in such a way as to enable WooCommerce-specific attributes to be passed, to create custom and versatile queries.
Our current proposal is to hook in the
blocks.registerBlockType
filter to add some custom attributes. Since attributes can't be added through this method to specific variations, such attributes should be namespaced, in order to reduce pollution of the core block as much as possible. Something like__woocommerceQuery
should contain said custom attributes. For the POC, we are aiming to support at least one custom query (for example, all products on sale), so, the following attributes are required:variationName
attribute will be used to define different variation names, allowing for easier variation detection, and also for conditionally showing or hiding certain settings depending on the specific variation.showOnlyProductsOnSale
.Later, by hooking in the
editor.BlockEdit
filter forcore/query
we can conditionally extend the settings via a HOC to add controls for those attributes.Specific variations of the block will be implemented as to reduce cognitive overhead for the merchant, by allowing the most common query types to be presets.
We will likely need to implement a
BlockVariationController
extending theAbstractBlock
class to handle block variation registration in our repo (Slack link: 1655812065.438279-slack-C02UBB1EPEF).The text was updated successfully, but these errors were encountered: