Walmart was one of the first major international brands to enter China, having opened its first store in 1996.

Despite the early start, the brand has struggled to dominate in China as it has in the US, stalling out with a little over 400 stores.

I visited a branch in Beijing recently. From the poorly designed store to the confused inventory of products, it was obvious why Walmart has struggled in the country.

Walmart was one of the first big international brands to enter China, drawn by the promise of big profits from the country's exploding middle class, which is projected to grow to 550 million people by 2022.

Walmart opened its first store in China in 1996, in the city of Shenzhen, and has grown to 424 stores in the intervening years.

But despite this growth, it has stumbled mightily in its expansion efforts. By most accounts, Walmart failed to properly read Chinese consumers' desires and cater its stores to the market. The resulting middling sales, combined with food safety scandals, rapid turnover of CEOs, and scuffles with the government, prevented the US retail giant from capitalizing on what many thought was a golden opportunity.

In recent years, Walmart has recovered some by investing in and partnering with JD.com, China's largest e-commerce retailer after Alibaba. That the retailer has placed its eggs in JD's e-commerce basket isn't a bad strategy, as Chinese consumers shift their spending to online.

By the most recent measures, e-commerce accounts for a whopping 21.4% of total retail in China. By comparison, the US is hovering around 12%. In recent years, Walmart has built out a robust online grocery business.

During a recent visit to China, I decided to check out a Walmart in Beijing. The store — which was in many ways nothing like its US counterpart — provided a clear indication why the retailer's China strategy has been failing for so long.

Here's what it was like.