warum is usually translated as plain "why", e.g. why are you going to the store?
Wofür and für was are both usually translated as "what for", e.g. for what are you going to the store?
In this case, for what means usually what are you getting to the store, but can sometimes mean similar things as why. In this case, the question with why could be answered with " For shopping" vs the questions with for what could be answered with "I want to buy ...." So focusing more on the item in this example.
As for "für was" vs. "wofür": wofür is the standard German word vs für was is the "slang" term or the one usually used just in daily life.