Retailers are abandoning a decades-old strategy of growing sales by blanketing cities with stores, as consumers shop more online. Their shifting habits have prompted chains to close stores in secondary malls and focus on web sales and more upscale shopping centers.