WooCommerce - How to create multiple single product template based on category?

/* Diamond Category  */
add_filter( 'template_include', 'so_25789472_template_include' );

function so_25789472_template_include( $template ) {
  if ( is_singular('product') && (has_term( 'diamond', 'product_cat')) ) {
    $template = get_stylesheet_directory() . '/woocommerce/single-product-diamond.php';
  } 
  return $template;
}



Comments

Popular posts from this blog

dynamic create multiple ckeditor onclick event using jquery

get lat and long from city name using jquery

membership registration and login system in php