WC_Product::is_visible_core │ protected │ WC 1.0

Returns whether or not the product is visible in the catalog (doesn't trigger filters).

Method of the class: WC_Product{}

No Hooks.

Returns

bool.

Usage

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

WC_Product::is_visible_core() code WC 11.1.2

protected function is_visible_core() {
	$visible = CatalogVisibility::VISIBLE === $this->get_catalog_visibility() || ( is_search() && CatalogVisibility::SEARCH === $this->get_catalog_visibility() ) || ( ! is_search() && CatalogVisibility::CATALOG === $this->get_catalog_visibility() );

	if ( ProductStatus::TRASH === $this->get_status() || ! $this->is_viewable() ) {
		$visible = false;
	}

	if ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) && ! $this->is_in_stock() ) {
		$visible = false;
	}

	return $visible;
}