That's not the case. There are individual laws in each country that govern this.
https://fullfact.org/online/UK-not-only-europe-country-legal...
Either way, there should be no reason grocery stores don't accept cash imo.
https://www.ecb.europa.eu/euro/cash_strategy/faqs/html/index...
Only in a handful of cities and states. There is no federal law requiring businesses to accept cash for goods and services.
But in this case, an emergency, I would assume someone would still know how to take a manual payment receipt!