Yes.
So one answer is comprehensive security cams, esp. of people as they enter the store, and face recognition technology.
All photos are posted on the web.
Those caught are prosecuted for their crimes PLUS permanently removed from any kind of public assistance (including those free cell phones we give “poor” people that then may be used against us in anti-social ways).
Maybe you could also have everyone who leaves the store get hit with a paintbomb as they do with stolen money from banks. Yes, this would hit some innocent people, but the tapes would show who was and was not involved in the mob. The paint would make it much harder for the perps to blend away out of sight.
Finally, security cams should be trained on the parking lot or other entrance area, at a distance giving some notice of a mob forming. Then software needs to be developed that constantly analyses the tape and can identify quickly that a mob or a mob-like crowd is approaching the store entrance. The clerk could be alarmed and possibly use a shut-down button to lock the door BEFORE people entered.
Oh, another tactic: when I was a kid, the first convenience stores in beachtowns were open-air. There was no door to enter, only a big grate that rolled up like a garage door and was brought down when the store closed. Well, as you might imagine, groups of kids could swarm in and out and shoplift, or kids could just shoplift pretty easily because there was such a large space from which to get in and out fo the door and the clerk could be occupied in another part of the store.
So what they finally did was set up basically rope lines and they would only allow, say, 5 people in the store at a time. We literally waited in a line to get in. This allowed the clerks to keep an eye on everyone and make sure they paid.
It may be that something like this will have to be reinstituted. Sad as that is.