In asking for a better solution under capitalism, you are asking a question that many here will reject outright- there is no "better" under capitalism any more than there were more comfortable deck chairs on the titanic as it went down. All of the choices are bad, and especially if you are engaging in a capitalist exchange for the food you ask about.
Expropriation, gleaning, or just straight mooching are all agreat ways to get food. Working and then shopping at a co-op is fine, but it is not better somehow than not paying for food. And everyone shopping at co-ops means that we have mass produced vegetables and fair-traded items picked and manufactured by people who still have to do so to live, and sold to us by people doing the same.
It also means we feel good about our purchases and equate them with having done the right thing. Which can be where we start to relate that sense of having done right with black and white morals and binary ideas of what are or aren't good ways of dealing, when it is really all dependent on many things.
Instead, I would posit that we should be looking for ways to avoid shopping altogether, and recognize that sometimes we choose to shop at co-ops to lessen our impact in a game withno good outcomes, and that sometimes we shop at Safeway or Kroger, or Walmart because it is what we have to do, can afford to do, or is just the easiest way to have a limited engagement with capitalism. Neither is good, and in some cases what is worse isn't as clear as it might seem.