Automattic\WooCommerce\Blocks\Templates
ClassicTemplatesCompatibility::set_filterable_product_data
This method passes the value has_filterable_products to the front-end for product archive pages, so that widget product filter blocks are aware of the context they are in and can render accordingly.
Method of the class: ClassicTemplatesCompatibility{}
No Hooks.
Returns
null
. Nothing (null).
Usage
$ClassicTemplatesCompatibility = new ClassicTemplatesCompatibility(); $ClassicTemplatesCompatibility->set_filterable_product_data();
ClassicTemplatesCompatibility::set_filterable_product_data() ClassicTemplatesCompatibility::set filterable product data code WC 9.9.4
public function set_filterable_product_data() { global $pagenow; if ( is_shop() || is_product_taxonomy() || 'widgets.php' === $pagenow ) { $this->asset_data_registry->add( 'hasFilterableProducts', true ); } }