For a little positivity, I thought I'd mention one campaign where the idea of magic shops was not only integral, it was also perfect for flavor and the main source of player entertainment.
This was an HP Lovecraft's Dreamlands campaign. The characters were locked away in insane asylums, trying to still complete missions to save the world after no one would believe them. This involved linking up in the Dreamlands where Cthulhoid entities have some of their consciousness invested.
Item shops were everywhere. Later, characters learned how to dream up items, literally. You want a sword? Concentrate on the idea and watch it materialize in your hand. No problem.
However, in times of stress or terror, there were nightmare checks. If you had a sanity / nightmare failure, your sword might turn into a serpent or a scorpion tail (or whatever you're phobic of) and attack you. Conversely, if you were a very powerful dreamer, you could not only keep your sanity, but force nightmare checks on enemies.
Things get interesting as the characters want more powerful items. You want a sword of Deep One slaying? Sure, but that requires you to dream about Deep Ones, and dreaming about them beckons their attention. Hope you get that sword quickly, because you'll be needing it.
Not 100% applicable to D&D (although it would make a great side campaign), but an example of a gameworld where I feel magic shops should absolutely exist. Heroic fantasy, though? Not so much. The best treasures are earned through blood, not gold.