They don't forbid charging a different price, or even advertising a different price; they only forbid advertising a surcharge for using a card. An advertised cash discount is acceptable. States may have further requirements, for example, California requires gas stations report credit prices in at least the same size numbers as cash prices, but enforcement is light.
In the US, that is no longer true. They can at least have a minimum, not sure if they can charge differently, but for small purchases it is effectively the same