This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Fix All Products block refreshing on Classic Themes. #6324
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rce product archive templates where filters are being used.
tjcafferkey
added
type: bug
The issue/PR concerns a confirmed bug.
focus: template
Related to API powering block template functionality in the Site Editor
labels
Apr 26, 2022
tjcafferkey
commented
Apr 26, 2022
@@ -64,9 +64,14 @@ public function set_filterable_product_data() { | |||
* This method passes the value `is_rendering_php_template` to the front-end of Classic themes, | |||
* so that widget product filter blocks are aware of how to filter the products. | |||
* | |||
* This data only matters on WooCommerce product archive pages. | |||
* On non-archive pages the merchant could be using the All Products block which is not a PHP template. | |||
* | |||
* @return void | |||
*/ | |||
public function set_php_template_data() { |
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.
This method will only get executed on Classic Themes such as Storefront: https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/src/Templates/ClassicTemplatesCompatibility.php#L36-L38
Size Change: 0 B Total Size: 869 kB ℹ️ View Unchanged
|
Aljullu
approved these changes
Apr 26, 2022
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.
LGTM
I just wonder if we should add testing steps for future reference.
Failing E2E tests are unrelated. Merging anyway. |
tarunvijwani
pushed a commit
that referenced
this pull request
Apr 26, 2022
…rce product archive templates where filters are being used. (#6324)
This was referenced Jul 4, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
focus: template
Related to API powering block template functionality in the Site Editor
type: bug
The issue/PR concerns a confirmed bug.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We set
is_rendering_php_template
for the frontend so we can use filter blocks with PHP rendered templates and deprecate the filters widgets in favour of them for Classic Themes such as StorefrontHowever, filter blocks are also used to filter the All Products block which is not rendered server-side so there is no need for a page refresh here.
This PR only sets
is_rendering_php_template
on WooCommerce product archive pages such as the Shop page and product category pages where the products are rendered server side. This means on non-product archive pages where the All Products block may be used, we will not refresh the page when using filter blocks.Testing
Automated Tests
Manual Testing
How to test the changes in this Pull Request:
User Facing Testing
These are steps for user testing (where "user" is someone interacting with this change that is not editing any code).
Changelog