Different custom templates for product category [closed]

try to use get_template_part(‘yourfile’) instead.

the get_template_part() goes from theme root path.

so if you have your template in woocommerce folder use:

if( has_term( 'course', 'product_cat' ) ) {
   get_template_part('woocommerce/single-product-course' );
} else {
   wc_get_template_part( 'content', 'single-product' );
}

however probably should be better to make a folder that its not woocommerce, once woocoomerce folder will searched for woocommerce files, and if there is somewhere a file with that name with make conflict.

also, are you calling the single-product template from the same file, probably would be better to make a second file and paste the code there.