Realistically, the price difference is probably not worth the hassle of needing two prices and card sales are probably affordable enough and common enough to not bother.
https://www.ca5.uscourts.gov/opinions/pub/15/15-50168-CV0.pd...
They basically said a surcharge for credit is effectively the same thing as a discount for cash, and because of freedom of speech, merchants are free to communicate the difference to their customers either way.
It's probably different when you're at a much larger scale than I am, but even Wal-Mart (who I was employed by in my late teens) has all sorts of cash-handling procedures to mitigate the risk of money just walking away. Even a their scale, they spend 1% on CC processing, but by the time they added up all of the labor and expenses of cash handling,it might be comparable. And for a small business it's likely more.
And then there's the data collection which has value too.
People act like accepting cash is free, it is not.