function get_custom_single_template($single_template) {
global $post;
$terms = get_the_terms( $post->ID, 'products_type' );
$terms_slug = $terms[0]->slug;
$post_type = get_post_type( $post->ID );
$single_template = dirname( __FILE__ ) . '/single-' . $post_type . '-' . $terms_slug . '.php';
if ( !file_exists( $single_template ) ) {
$single_template = dirname( __FILE__ ) . '/single.php';
}
return $single_template;
}