As people in China retreated indoors in late January to avoid the coronavirus, Alibaba's supermarket chain Freshippo faced a dilemma: online orders for fruit were soaring but supplies were low.
To ease the crunch, Freshippo asked staff to rip up bulk fruit boxes, originally prepared as Lunar New Year gift sets, break them up and sell them individually to serve more locked-down customers.
Freshippo, which has about 200 stores across the country and is known as Hema in Chinese, also launched a group-buying scheme for locked-down Wuhan - the epicentre of the outbreak.
The company then delivered goods via commissioned buses instead of its usual bike-riding couriers, who deliver individual bags of groceries.
Freshippo's measures offer some lessons to retailers in Europe and the United States as they brace for a similar spread of the disease, with panic-buying leaving supermarket shelves stripped of many staples and other essential items.
"Nobody saw this coming," Hou Yi, president of Freshippo said in an interview with Reuters.
"A whole ton of challenges surfaced."
Hou said supermarkets might face more difficulties in the United States because most stores were less equipped to deal with large numbers of online orders compared with their counterparts in China.
Freshippo, which had stocked up ahead of the Lunar New Year holiday to meet the usual surge in demand, sent its inventory of dry goods such as noodles and flour to a warehouse in Shanghai to centralise delivery.
Five-year-old Freshippo's biggest challenge was delivering in Wuhan and its province of Hubei.
The government set up roadblocks, a shortage of staff disrupted operations and social-distancing requirements hindered last-mile delivery.
Freshippo had to obtain special permits to enter and exit Hubei and find volunteers from within its staff to drive trucks into the disease-stricken province, as they faced a mandatory 14-day quarantine after coming back out, Hou said.
To cope with low staff numbers in stores, the company hired thousands of people from restaurants and shops, employing those thrown out of work because of government-mandated shutdowns of small business.
"We simplified our procedures to make everything easier to understand," Hou said about in-store training. "Usually after two hours of instruction, they could hit the ground running."
Freshippo services outside Hubei went back to normal on March 2, Hou wrote in a social media post, though its 19 stores in Wuhan remain delivery only.
Hubei has only just started lifting curbs while the rest of China has largely relaxed restrictions and people are going back to work.