New York CNN Business  — 

Walmart sales soared as Americans stockpiled groceries and household essentials during the coronavirus pandemic.

The retailer said Tuesday that sales at stores open for at least a year soared 10% in the three months ending on April 30, compared with the year prior. Online sales spiked 74%.

Walmart is this country’s largest retailer and has benefited from shifting shopping patterns during the crisis. Consumers cut back on some discretionary spending but continued to buy food and household goods as they sheltered at home. Walmart said it got a boost in April from shoppers using their government stimulus payments.

The company’s investments in ecommerce also paid off in the quarter. To fight Amazon (AMZN), Walmart had built out its curbside pickup and home delivery network for groceries in recent years. Walmart has nearly 3,300 store pickup locations, and more than 1,850 stores offered same-day grocery delivery.

“We experienced unprecedented demand in categories like paper goods, surface cleaners and grocery staples,” Walmart CEO Doug McMillon said on the company’s earnings call. “For many of these items, we were selling in two or three hours what we normally sell in two or three days.”

In addition to groceries, electronics, toys, sporting goods and arts and craft sales were also strong, the company said. McMillon told analysts that Walmart was having trouble keeping laptops, office chairs and fabric in stock. But clothing sales dropped 14% last quarter.

Americans slowed their trips to stores, but bought in bulk when they shopped. Although Walmart recorded nearly 6% fewer transactions during the past three months, the average receipt soared 16.5%, the company said.

A similar trend played out at Home Depot (HD) amid the pandemic: Transactions at stores last quarter dipped 4%, but the average receipt jumped 11%, the company said Tuesday.

Walmart and Home Depot were deemed “essential” businesses during the crisis and kept stores open.

Retailers that were forced to shutter stores, such as Kohl’s (KSS), struggled. Kohl’s (KSS) said Tuesday that its total sales dropped 43% last quarter compared with the same time frame last year.

The pandemic has crushed much of the retail sector and tipped several chains, including JCPenney, J.Crew and Neiman Marcus, into bankruptcy.

Walmart’s (WMT) stock rose around 2% in early trading before paring gains. Heading into Tuesday, Walmart’s (WMT) stock had gained 7% this year, even as the S&P 500 slipped 8%.

Walmart said that its expenses last quarter rose $900 million from “associate investments, wage pressures and increased maintenance costs.” Walmart has paid out two cash bonuses to workers during the crisis and hired 235,000 new employees, most on a temporary basis.

On Tuesday, Walmart said it would search for ways to test employees for the coronavirus.

“We’re pursuing strategies with testing associates in the longer term, antibody testing,” McMillon said.

The company withdrew its previous financial guidance to investors because of “significant uncertainty” from coronavirus on the global economy but said that it was well-positioned in the long-term.