When you wanted to shop, you went to the mall and confined your search to the stores you found there.
You only shopped at stores in the mall when you went shopping.
The mall was only one of many places you ended up shopping at.