I am trying to build out a custom view for single product pages within WooCommerce. If a product say lives in a category called 'custom' I want WooCommerce to detect this by switching to a custom page layout if the product lives in that category.
I have tried to do this by adding the following code to single-product.php
if (is_product_category( 'custom')) {
wc_get_template_part( 'content', 'single-product-custom' );
} else {
wc_get_template_part( 'content', 'single-product' );
}
I have created a category called 'custom' and also created a template called 'conent-single-product-custom.php'but I get an error if I place an item in the custom category which is the following:
Warning: include(/home/website/public_html/wp-content/themes/theme/woocommerce/single-product-custom.php): failed to open stream: No such file or directory in /home/website/public_html/wp-includes/template-loader.php on line 89