taxonomy – How to force child product categories to use parent custom template in Woocommerce?


I created a custom product category template for my parent category.(It works correctly on my parent category page). In my taxonomy-product-cat.php trying to force the child categories to use the parent template with this code but still only the parent category page uses the template.

if ( is_product_category( 'car-parts' ) || term_is_ancestor_of( 19, get_queried_object_id(), 'product_cat' ) ) { 
wc_get_template( 'archive-product-car-parts.php' ); } else { wc_get_template( 'archive-product.php' );

Joseph 4 months 2021-06-17T05:10:44-05:00 0 Answers 0 views 0

Leave an answer