Sage 9 Woocommerce - Taxonomy archive loads archive-product

I’m using Sage 9 and sage-wooocommerce. I’m trying to add a custom taxonomy to “product” post type and then have a custom taxonomy template (taxonomy-text_tax.blade.php - inside resources/views) but whenever the taxonomy is attached to the “Product” post type it overrides the blade template with archive-product.blade.php (and I can see this by getting $template from the filters).

Important to note if I remove ‘product’ from the post type argument of register_taxonomy, this issue goes away and it finds the correct .blade template.

Any idea why this would happen? I tried to filter out “archive” from the body classes but it seems like something else is making this a lot more confusing than it has to be. Maybe something else from WooCommerce itself is pushing something to the template_include filter?

WooCommerce is detecting any taxonomy with ‘product’ assigned as a post type as a “product taxonomy” which WC will treat differently.

Im not sure exactly of a fix yet, but I know modifying function is_product_taxonomy() in the WC core files (wc-conditional-functions.php) to exclude the new taxonomy ID from the array that returns, fixes the issue.

How I can hook in to this and do that safely I’m not sure yet - but I will post a solution if I find it.

This topic was automatically closed after 42 days. New replies are no longer allowed.