In Denmark it is illegal to not accept legal tender when running a business. Very few exceptions from this law (late night 7-11 stores might be except for security reasons). Don't know about UK
Back when I worked at a smoothie shop that didn't accept cash (USA) I would just let the customers pay me their cash and then I'd buy them the item at employee discount 🤣