Sure but they weren't trying to price per category, they were trying to grab as much of the area under the demand curve as possible. Given what was possible, that's all they could do.
There is a market solution to this - don't shop at places which do it. If I go to the supermarket and they jack up the price of bread because I'm in a rush and 40 something wearing a suit I'm likely to spew venom, pay that one time, and never, ever come back.