Have you ever felt confused about why Chinese say "买东西 (mǎi dōng xi, shopping)" instead of "买南北 (mǎi nán běi)"? "东 (dōng, east), 西 (xī, west), 南 (nán, south) and 北 (běi, north)" are all nouns of locality in Chinese, but why are "东" and "西" used to stand for goods?
One story is that "东西 (dōng xi)" dates from Tang Dynasty, whose capital was located in "长安 (cháng ān)", as you see in the picture below.
Chang'an Imperial City was located in the north, surrounded by many oblong "坊 (fāng, lanes)" and "市 (shì, market)" enclosed by high walls. In the east and west of Chang'an City, there were two markets, namely 东市 (dōng shì, East Market) and 西市 (xī shì, West Market). They were both a large goods distributing centre. At that time, residents were forbidden to buy goods along the roadside, so they had to go to the East Market or West Market instead. Shopping at the East Market was called "买东 (mǎi dōng)", and "买西 (mǎi xī)" at the West Market. As time passes, "东西 (dōng xi)" has become a word meaning goods and then the phrase "买东西 (mǎi dōng xī)" has spread far and wide.
Another story is that "买东西 (mǎi dōng xī)" comes from "五行" or "five elements" (wǔ xíng, a fivefold conceptual scheme that many traditional Chinese fields were used to explain a wide array of phenomena) in Chinese traditional culture. Ancient Chinese people discovered the five elements "金 (metal, jīn), 木 (wood, mù), 水 (water, shuǐ), 火 (fire, huǒ), 土 (earth, tǔ)" could form many other new substances after being mixed and processed. They thought almost everything in daily life were made from "金 (jīn)" and "木 (mù)" which corresponded to the directions of west and east. Therefore, "东西" was naturally taken as the general word referring to all stuff and objects. Nowadays, with the development of science and technology, modern people have gained a new understanding about the world, but they keep using "东西 (dōng xī)".