Amazon.com Inc. (AMZN) - Get Report is preparing to dish out $13.7 billion in cash to buy high-end grocer Whole Foods Market Inc. (WFM) , which clearly is struggling to get customers through its doors.

On Wednesday, July 26, Whole Foods surprised Wall Street by dropping its third-quarter earnings in the middle of the afternoon (the company was set to release the report after the market close). Although it beat expectations on earnings, what was revealed should alarm investors.

Whole Foods reported that its same-store sales fell 1.9% and its revenue increased a tepid 0.6% to $3.7 billion, in line with Wall Street's expectations, for the 12-week period ended July 2. For the 40-week period ended July 2, the grocer's comparable store sales plunged 2.4%.

On June 16, Amazon announced that it would acquire, subject to regulatory approval, Whole Foods for $42 a share.

The deal was viewed as Whole Foods CEO and Co-Founder John Mackey giving into the demands of activist investor Jana Partners' Barry Rosenstein, who had been pushing the grocer to sell itself amid declining same-store sales. Although Whole Foods' actions of shaking up its board of directors in May, prior to the sale announcement in an effort to fend off Jana Partners, the activist maintained that it would "keep all options on the table." That included launching a director-election contest.

Image placeholder title

In May, Barclays analyst Karen Short told TheStreet that she didn't think Jana Partners would be satisfied with the board shakeup. She guessed right.

"I think [Mackey's] view is that he outsmarted [Jana]," Short said at the time. "I wouldn't make the bet that you outsmarted a highly intelligent investor."

Short has estimated that Whole Foods, once the "creator and owner" of the organic grocers market, has lost a "staggering" 9 million to 14 million customer visits over the past 18 months to competitors Kroger Co.  (KR) - Get Report , Trader Joe's Co., Costco Wholesale Corp. (COST) - Get Report , Sprouts Farmers Markets Inc. (SFM) - Get Report  and Natural Grocers by Vitamin Cottage Inc. (NGVC) - Get Report .

If any company can fix the situation at Whole Foods, it may be Amazon, the e-commerce conglomerate that has upended every industry it has tackled, including tech and retail.

Read More: