0
votes

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
On a standard WooCommerce installation the breadcrumbs do display on the product tag archive pages. I'm thinking your theme is overriding this, perhaps you need to add <?php woocommerce_breadcrumb(); ?> to your archive-product.php. What theme are you using on your WordPress installation? - Ryan Kozak
Thanks Ryan! But this code adds and extra breadcrumb on my shop and cat pages. I'm using Flatsome theme and indeed lot of woocommerce files are overrided by the theme. - Wim

1 Answers

-1
votes

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 &ldquo;%s&rdquo;', 'woocommerce' ), $current_term->name ) );

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