The solution for a situation like this is not terribly expensive compared to the lost inventory. First of all, the front windows of the store need to be replaced with very strong laminate instead of thin glass.
Next, create a “two buzzer airlock” of steel cage and laminate. To enter, a person or a small group push a doorbell to request entry. An employee pushes a buzzer that opens the outer door, allowing them into the airlock.
Then, only when the outer door is closed and again locked, can the inner door be opened, with a second buzzer. To leave the store the process is reversed.
This means that the store can limit how many people are inside at a given time, and how quickly they can enter or leave. The flow through is not so limited as to reduce the number of legitimate customers.
It also means that the store can make some common sense discrimination. If say, there is a large mixed crowd of shoppers entering and leaving, on a big shopping day, they can comfortably admit far more at once than say, a group of 50 or 100 black youths who all want in as a group.
Probably against fire code...
Somehow, you’d have to make a door that would let large numbers OUT very quickly that couldn’t be used to let large numbers IN quickly.
I think a cheaper, but less effective, solution is just to create a shatterproof revolving door that the clerk can stop from turning at the push of a button. That way, it limits how many can enter/exit the store quickly, and can still stop them from escaping once the trouble starts, but you don’t have to buzz every ordinary customer in.
The obvious drawback is that the criminal may be trapped, but he is trapped in the store with the employees and legitimate customers.