most often Russians use these:

ходить в магазин - implies bying food, buy groceries, (typically a food supermarket, where you can also buy cleaning stuff, etc.)
ходить по магазинам - go shopping, meaning clothes, or some household items.

Ходить за покупками is a calque, looks like a textbook phrase. It is 100% understood but it's not how people usually speak.