I think you would rather use the preposition "à" when you are buying something at an actual shop (something implying it is a building/place), so in cases like "à la boulangerie", "au supermarché". "au kiosque"
I am not really sure about any set rules for these prepositions, but as far as I know when the vendor is a person would most often use "acheter qc. chez/de qn.". You could also "chez" in this case (at least I have heard and read it that way), but I don't think it is used as frequently as "de".
Bonne chance ^_^