For my understanding, your
Tomaten auf den Ohren haben
it is simply a humorous ad-hoc variation of the quite common idiom
Tomaten auf den Augen haben
I even would not take the detour via Möhren in den Ohren haben (see the other answer on this page), as Möhren in den Ohren haben is very rare, and is farer away from Tomaten auf den Augen haben, as not one but two elements are replaced (Augen by Ohren, Tomaten by Möhren).
Unnecessary to add that the meaning would be "not hearing" or "not listening".
As for etymology, one opinion published by Duden is that Tomaten auf den Augen refers to someone having red puffy eyes due to some infection or whatever, and therefore not being able to see properly. I personally am sceptical about this explanation, but I do not have a better one so far.
Regarding what produce people are sticking into their ears, parsley should be more relevant than carrots. There is a famous scene in Asterix where Roman soldiers get into a habit of sticking parsley into their ears due to some misunderstanding. This again refers to on an old household remedy to treat earache with parsley.