There is risk of theft too, not just robbery but from employees.
Usually the main reason some shops prefer cash is because they can put the cash directly in their pocket and do tax fraud on a percentage of their revenue.
The easiest one is the time it takes to correctly count at the end of the day. That can easily take an hour even for small shops. If you go card only, you can just lock the door after the last customer and leave. Accounting for revenues and discrepancies (which always happen) correctly is a huge hidden cost.