Woocommerce Breadcrumbs for tag archives

1k views Asked by At

I want to display breadcrumbs on the woocommerce tag archive pages (ex. website.com/product-tag/jesse-marsh/).

The breadcrumbs are currently visible on woocommerce product & category pages. I have no idea where to add code in order for the breadcrumbs to be visible on the tag archive pages.

Any suggestions? thanks!

1

There are 1 answers

1
wildt On

I had to edit woocommerce plugin:

wp-content/plugins/woocommerce/includes/class-wc-breadcrumb.php

/**
 * Product tag trail.
 */
private function add_crumbs_product_tag() {
    $current_term = $GLOBALS['wp_query']->get_queried_object();

    $this->prepend_shop_page();


    //$this->add_crumb( sprintf( __( 'Products tagged “%s”', 'woocommerce' ), $current_term->name ) );

    $this->add_crumb( sprintf('%s', $current_term->name ) );
}