Automattic\WooCommerce\Blocks\Templates

ClassicTemplatesCompatibility::set_filterable_product_data()publicWC 1.0

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.

Метод класса: ClassicTemplatesCompatibility{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$ClassicTemplatesCompatibility = new ClassicTemplatesCompatibility();
$ClassicTemplatesCompatibility->set_filterable_product_data();

Код ClassicTemplatesCompatibility::set_filterable_product_data() WC 8.7.0

public function set_filterable_product_data() {
	global $pagenow;

	if ( is_shop() || is_product_taxonomy() || 'widgets.php' === $pagenow ) {
		$this->asset_data_registry->add( 'hasFilterableProducts', true, true );
	}
}