If you visit a city like New York, you'll notice that everything is zoned a bit differently; heck, it looks like it hasn't been zoned at all. Most residential buildings have a store of some kind in the first floor. Consequently, in a city with intermingled commercial and residential buildings, you're never more than a block or three from a grocery or a drug store, and generally never more than a block from a coffee shop or a deli.
Doing your grocery shopping via mass transit is insane. That's why in a city where 75% of the population uses mass transit as their primary form of transportation, you don't. You just walk across the the street.