Automattic\WooCommerce\Blocks\Templates

CartTemplate::is_active_template()protectedWC 1.0

True when viewing the cart page or cart endpoint.

Method of the class: CartTemplate{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_active_template();

CartTemplate::is_active_template() code WC 9.4.2

protected function is_active_template() {
	global $post;
	$placeholder = $this->get_placeholder_page();
	return null !== $placeholder && $post instanceof \WP_Post && $placeholder->post_name === $post->post_name;
}