Having a single flat price is/was due to labor prices being high enough in the developed world to ignore potential profits from price discrimination.

When my grandparents went to the market in the developing country they immigrated from, they would bargain for everything, and every customer got a different price.

The developed world was rich enough that grocery stores didn’t need to waste time doing this, and could simply price high enough to earn a consistent profit margin and expect consistent sales. They did engage in price discrimination via coupons. Just not individually, until smartphones and apps came along.

Now that automation can handle a lot of the price discrimination, expect more of it, everywhere.

It is not only about labor prices being high enough (creating consumers who can buy more). There is a significant religious component to the introduction of fixed pricing. Quakers are often credited with introducing fixed pricing in the Western world, because they felt that charging higher prices to those less able to haggle (or higher prices by age, gender, race) was immoral, dishonest in the eyes of God. They then experienced greater sales because you could send your kid to the store and trust the kid wouldn't get ripped off. It just took a layer of stress off going to the store. John Wanamaker (a Presbyterian?) I think is the one who really started a retail empire on fixed pricing. One of his main selling points was one price for anyone, and a fair return policy.

The behavioral economics here is that many people will pay a consistent (fair) price to not be surprised and not feel ripped off.

Agree that automation will engage in price discrimination whenever possible. When will we see the backlash? I have heard stories of outrage ("when I looked for airline tickets at work they were way cheaper than when I looked on my home laptop!") but we haven't seen a widespread reaction, and the moral aspect seems to be relatively overlooked at this time.