Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix All Products block refreshing on Classic Themes. #6324

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Templates/ClassicTemplatesCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->asset_data_registry->add( 'is_rendering_php_template', true, null );
if ( is_shop() || is_product_taxonomy() ) {
$this->asset_data_registry->add( 'is_rendering_php_template', true, null );
}
}
}