Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection

Renderer::context_provides_cart_reference │ private │ WC 1.0

Whether the given block context provides a cart product reference (see the PRODUCT_REFERENCE_CONTEXT constant).

Method of the class: Renderer{}

No Hooks.

Returns

bool.

Usage

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

Renderer::context_provides_cart_reference() code WC 11.3.0

private function context_provides_cart_reference( $context ) {
	return self::REFERENCE_TYPE_CART === ( $context[ self::PRODUCT_REFERENCE_CONTEXT ] ?? null );
}