This set up avoided many of my misgivings about magical items shops - there is no guarantee that the PCs will get what they want. I feel that the random roll is very important.
Bingo! Sir, you have hit the jackpot!
Random determination of what's available for sale is crucial, and also kinda reflects how it likely would work in the setting. The way I see it, items for sale all probably come from some combination of a few sources:
Other adventuring parties (by far the most common source)
Estate sales
Artificers selling commissioned items that were never claimed
Artificers selling experiments (buyer beware!!!)
Wizard guilds (potions, scrolls, and spellbooks only, for the most part)
Whenever the PCs in my game get to any significant town they haven't visited for a while I get players clamouring for a "shopping list". I then do a bit of quick dice-rolling to give me an idea of how many items are for sale, after which it's Excel spreadsheets to the rescue: within a few seconds I can generate a weighted-random* list X items long, where X is the number of things my dice tell me are available at the moment, from a rather gargantuan items list that's being expanded all the time. A really big shopping list in a large city might have as many as 30 items, but that's unusual.
This list can also include cursed and-or useless items; and rather than just hand the list to the players I read out what's on it (and, if relevant, who's selling it), and once in a rare while they'll get ripped off by buying a cursed item or something that isn't what was advertised.
* - by this I mean the odds are set such that low-magic or common items (e.g. potions, scrolls, +1 whatevers) will in theory turn up much more frequently than high-magic or rare/exotic items. For example, the odds of a +1 Longsword being on a list are way way way higher than the odds of a +5 Longsword; while the odds of a +5 Trident are even lower as trident is a less common weapon than longsword.