The Talbot Inn and The Wentworth Arms, in Mapplewell, teamed up to sell the fresh produce that would have gone unused in the wake of the coronavirus outbreak.
On Sunday, the two pubs held a stall selling fresh foods including milk, eggs, vegetables and crisps.
Residents were encouraged to donate a small fee which would be donated to Louie’s Pace, a campaign to raise money for a local youngster.
Louie George, of Greenside, Mapplewell, was born prematurely at 28 weeks, weighing only 1lb 15oz.
He was also diagnosed with spastic quadriplegic cerebral palsy, and his parents have been attempting to raise £120,000 for vital surgery.
Jodie Morgan, Louie’s mum, added: “We continue to be absolutely blown away by our community’s selflessness.
“Both The Talbot and The Wentworth Arms didn’t need to do that, especially as they’re struggling themselves because of the outbreak.
“It just goes to show that community spirit is still high with people.
“We can’t thank the staff enough for their generosity during these uncertain and scary times.”