My approach to that has been indirect.
In any town of any size, there will be a local practicioner who handles supplies for others in the trade. That person essentially runs a shop.
If someone wants to buy an item, this is the guy they'll be directed to. And he almost certainly won't have it.
Oh, he'll have some scrolls and a few potions, maybe some alchemical stuff. Most of what he has though is relatively mundane, things commoners will like and can afford.
But if you want adventurer class gear, well, it's probably in the hands of an adventurer someplace. What he does is connect people with magic to sell or trade. You pay him a research fee, and he starts contacting people he knows in the trade. Get back to him in a week and he may know who has the item you want, or something close at least. Then he acts as broker for the deal, taking a slice of the action for his trouble.
Typically, such trades are done as trades more than purchases. You trade some magic, plus some money, for bigger magic.
What this does for me, as DM, is quell the appetite for instant gratification, while allowing such trade to go on in a reasonable fashion. It also gives me time to consider whether or not to let the PC have the item he wants. Sometimes he gets something close, sometimes the guy just comes up cold.
This is also the guy you go to to sell magic items and related loot.
Which takes us to the other side of things: He doesn't keep huge amounts of cash just sitting around, so selling items may take a week or so while he spreads the word to others like himself, seeking a buyer.