Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection

Renderer::get_block_location_context │ private │ WC 1.0

Get the location context for a block, honoring a context-provided product reference before falling back to page-level detection.

Method of the class: Renderer{}

No Hooks.

Returns

array. The location context.

Usage

// private - for code of main (parent) class only
$result = $this->get_block_location_context( $context );
$context(array) (required)
The block context.

Renderer::get_block_location_context() code WC 11.3.0

private function get_block_location_context( $context ) {
	if ( $this->context_provides_cart_reference( $context ) ) {
		return ProductCollectionUtils::get_cart_location_context();
	}

	return $this->get_location_context();
}