WC_Breadcrumb::add_crumbs_product_category()protectedWC 1.0

Product category trail.

Method of the class: WC_Breadcrumb{}

No Hooks.

Return

null. Nothing (null).

Usage

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

WC_Breadcrumb::add_crumbs_product_category() code WC 8.7.0

protected function add_crumbs_product_category() {
	$current_term = $GLOBALS['wp_query']->get_queried_object();

	$this->prepend_shop_page();
	$this->term_ancestors( $current_term->term_id, 'product_cat' );
	$this->add_crumb( $current_term->name, get_term_link( $current_term, 'product_cat' ) );
}