-
Notifications
You must be signed in to change notification settings - Fork 219
Product Query - add support for the global query #7382
Conversation
…ocks into fix/product-query-update
…ocks into add/price_filter_support
Product Query - Add support for the Filter By Price Block
Product Query - Add support for the Filter By Attributes block
…erce/woocommerce-blocks into add/price_filter_support
…erce/woocommerce-blocks into add/attribute_filter_support
…commerce/woocommerce-blocks into add/attribute_filter_support
…ocks into add/attribute_filter_support
…ocks into add/attribute_filter_support
Product Query - Add support for the Filter By Stock Block
…e variation #7245 fix filter blocks: the data (e.g: max price or stock-status) match the variation
…om/woocommerce/woocommerce-blocks into fix/product-query-global-query
…ocks into fix/product-query-global-query
This PR has been marked as If deemed still relevant, the pr can be kept active by ensuring it's up to date with the main branch and removing the stale label. |
and preparing the input arrays
…ocks into fix/product-query-global-query
…ce/woocommerce-blocks into fix/product-query-global-query
e99c466
to
dac0895
Compare
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the |
Hey @dinhtungdu, |
// This is a feature flag to enable the custom inherit Global Query implementation. | ||
// This is not intended to be a permanent feature flag, but rather a temporary. | ||
// https://github.com/woocommerce/woocommerce-blocks/pull/7382 | ||
const isCustomInheritGlobalQueryImplementationEnabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using an experimental flag here instead? I think we just need to limit the global query support to experimental/development build only. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just need to limit the global query support to experimental/development build only.
At least for now, we want to show the option inherited query from the template from Gutenberg. The Product Query is a foundation for other blocks, too (for example, Buy it again
), and having two inherit query from template
options can be confusing for the developers that check the block for the first time.
Also, this is a super WIP code because there is still a discussion about how we should approach the problem: this is why I used this approach.
For me, It is fine to change it, but I think it could not be very clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Product Query is a foundation for other blocks, too (for example, Buy it again), and having two inherit query from template options can be confusing for the developers that check the block for the first time.
Make senses!
Can you explain how can we use this flag for development later? I mean what do we need to do to enable the flag? At glance, we have to temporarily change the flag in the source code, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain how can we use this flag for development later? I mean what do we need to do to enable the flag? At glance, we have to temporarily change the flag in the source code, right?
Yes! Just set isCustomInheritGlobalQueryImplementationEnabled
and is_custom_inherit_global_query_implementation_enabled
to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe adding a note here to update the PHP flag too? (and vice-versa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense! I updated the comments!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation! I left an optional comment but as discussed, this is LGTM so approving!
// This is a feature flag to enable the custom inherit Global Query implementation. | ||
// This is not intended to be a permanent feature flag, but rather a temporary. | ||
// https://github.com/woocommerce/woocommerce-blocks/pull/7382 | ||
const isCustomInheritGlobalQueryImplementationEnabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe adding a note here to update the PHP flag too? (and vice-versa)
…ocks into fix/product-query-global-query
…oocommerce/woocommerce-blocks into fix/product-query-global-query
This PR is blocked by #7257.
This PR adds:
Fixes #6863
Other Checks
Screenshots
Testing
Automated Tests
User Facing Testing
Product Search Template
Product Search
template.Product Search
block.woo inherit query from template
setting to true.Product Search
block, search a product and be sure that the results that the Product Query renders are correct.Product Search
template.on-sale
setting. Go on the front end.Product Search
block, search a product and add some filters and be sure that the results that the Product Query renders are correct.Products By Category Template
Products by Category
template.woo inherit query from template
setting to true.product-category/clothing/tshirts/
. In this way, theProduct by Category
will be rendered and should be rendered only products that are in the T-shirts category.Products By Category
template.on-sale
setting. Go on the front end.product-category/clothing/tshirts/
. In this way, theProduct by Category
will be rendered and should be rendered only products that are in the T-shirts category and match the filters/variation.Products By Tag Template
Products by Tag
template.woo inherit query from template
setting to true./product-tag/${name_tag}/
. In this way, theProduct by Tag
will be rendered and should be rendered only products that are in the selected tag.Products By Tag
template.on-sale
setting. Go on the front end./product-tag/${name_tag}/
. In this way, theProducts By Tag
template will be rendered and should be rendered only products that are in the selected tag and match the filters/variation.WooCommerce Visibility