Houaiss dictionary has detailed entries for the suffixes -eria and -aria. The only rule appears to be: wait until usage establishes one form, the other, or both. The form -aria is a lot more common; when an -eria word exists it usually has an -aria twin; some -eria words were adapted from or influenced by Spanish -ería or French -erie, but they have been around since the 15th century. I now quote the Houaiss dictionary (Lisbon, 2002; original abbreviations expanded into full words; English translation below):
-aria sufixo importa remontá-lo a duas fontes, -IA (ver) e -EIRO (ver), donde resultaram -eria e este -aria, sendo que -eria tanto pode ter tido formação portuguesa interna (à analogia e, por vezes, influência do espanhol -eria e do francês -erie), como pode ter sido desde o início concorrente de -aria pelas influências referidas;
The entry goes on to explain that this suffix -aria was highly productive, and lists over 300 words, and the list is not exhaustive. I especially resent the omission of gataria.
-eria sufixo do francês -erie, em curso no português já no século XV, vem sendo objeto de rejeição didática purista, mas apresenta certos casos em que o sufixo -aria, ver, canónico poderia ser fonte de ambiguidade, como em bateria, galeria, sobranceria; em vários casos são registadas as duas formas, como amideria/amidaria, bijuteria/bijutaria, bilheteria/bilhetaria, charcuteria/charcutaria, engraxateria/engraxataria, glutoneria/glutonaria, guasqueria/guascaria, grosseria/grossaria, infanteria/infantaria, joalheria/joalharia, leiteria/leitaria, lavanderia/lavandaria, loteria/lotaria, mamposteria/mampostaria, parceria/parçaria, pedanteria/pedantaria, peleria/pelaria, selvageria/selvajaria, sorveteria/sorvetaria, talabarteria/talabartaria, tolderia/toldaria, uisqueria/uiscaria, vozeria/vozaria; a forma -eria é, em certo sentido, coonestada pelo sufixo conexo de agente -EIRO, ver
Again, this list is not exhaustive. In entry -aria we can still find (all these have an -aria twin): chocolateria, carniceria, gendarmeria, barganteria, galanteria, guacheria, carroceria. Cafeteria and cafetaria don’t appear in either list (they have their own entries though).
Houaiss entries translated
-aria suffix it is important to trace them to two origins, -IA (see) and -EIRO (see), from which -eria and this -aria resulted; -eria may have been internally formed in the Portuguese language (by analogy to and, sometimes, influenced by, Spanish -ería and French -erie) as well as a competitor from the beginning to -aria under the aforementioned influence.
-eria suffix from French -erie, already in use in Portuguese in the 15th century, it keeps being the target of purist, didactical objection, but there are certain cases where the canonical suffix -aria, see, could give rise to ambiguity, as in bateria, galeria, sobranceria; in various cases both forms have been recorded [word list]; the form -eria is, in some sense, made to look honest/legitimated by the related agency suffix -EIRO, see