Humorously, there are laws against credit card surcharges but not against cash discounts.
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.
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.
Gas stations do the cash discount for a particular reason - to get you inside the building where you might buy profitable convenience-store items, which you won't if you just stay at the pump. (Though yes, the differential might be less than the kickback from a card rewards program.)