Which countries? And, again, I doubt that this is the full picture because there are many cases where people simply don't "print a receipt" perfectly legally...
https://www.lexware.de/wissen/buchhaltung-finanzen/neue-rege... https://www.lexware.de/wissen/buchhaltung-finanzen/kassenbon...
Many other EU countries have similar regulations, and in some cases had them for a long time.
Receipts or invoices are the basis for a firm's whole economic activity, including the underpinning of their financial reporting, their tax burdens etc. And businesses failing to provide receipts erodes not only the tax base, but also any rights a consumer may have.