I want to set different template for the relevant product category. I changed single-product.php file
if (is_product_category( 'first-category' )) {
woocommerce_get_template_part( 'content', 'single-product' );
}else{
woocommerce_get_template_part( 'content', 'single-product-other' );
}
Still is loading content-single-product-other.php file content. I'm sure that the category of the product is checked
it can happen if you have putted single-product-other.php in (yourtheme/woocommerce/) folder and single-product.php in plugin folder. All you have to do is put both template in your theme's woocommerce folder(it is the proper way to customize original code).
still if it does not work then try to replace your code
woocommerce_get_template_part( 'content', 'single-product' );
with this. wc_get_template_part( 'content', 'single-product' );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With