They are breaking the law, at least where I live they are. They can't search you, and asking to see your receipt is a search, until after you leave the store and only if they suspect you of stealing from them.
Is asking someone what time it is a search? Don't be dumb, asking anyone anything isn't a search.