Which they don't and also it's illegal. You can charge less for cash, but no one does that. (Except your one or two examples out of the thousands of stores)
It's not illegal, but it is against Visa and Mastercard's rules, to levy a fee or surcharge to use a credit card. What IS illegal is to prohibit merchants from offering a discount to induce customers to pay by cash or check, which is why merchants that do so don't end up having their Visa and Mastercard contracts cancelled.