Instead of counting inside your foreach
loop, why not count the result from get_the_terms
. Something like this
$q = count($producers);
From that, you can then use a conditional like
if( 1 == $q ) {
// do something when only one term exists
}else{
// do something for mutliple terms
}