条件标签不起作用,为什么?

Im trying to use a custom template for a woocommerce category, but can't get the conditional to work, do I miss something here? Im trying to change

<?php woocommerce_get_template_part( 'content', 'single-product-cans' ); ?>

To this:

<?php if (is_product_category( 'cans' ) {
woocommerce_get_template_part( 'content', 'single-product-cans' );
}else{
woocommerce_get_template_part( 'content', 'single-product' );
} ?>

This throws this error: syntax error, unexpected '{'

cause missing one more )(closing parenthesis) try to replace

if (is_product_category( 'cans' ) {

to

if (is_product_category( 'cans' )) {

Also try to read error properly which gives you line number and description what you missing

change

if (is_product_category( 'cans' ) {

to

if (is_product_category( 'cans' )) {