so you propose to have plastic security boxes per item.
well:
1: the deli counter will have lots of boxes with meat oozing into the boxes, meaning they have to be washed
2: same for the veg section many boxes. meaning that would have to have a box per banana, potato, tomato
3: the freezer section. plastic, electronics dont work well on ice
now lets get into more detail
1: a raspberry Pi per box costs more in maintenance and purchase to fill a store of boxes. then 3 peoples salaries
2: refilling each box and locking it takes more time then just dumping stock on a shelf, costing more salary in labour of shelf fillers then th couple of cashiers they would save
3: if there is no one at the cash desk/exit as it is presumed all stock is paid for then great. ill have this 50c banana oh and i get a free raspberry PI and a secure box to take home with me as there is no one to stop me
4: instead of just picking up a can of baked beans. i have to scan a qr code, open the box, take the tin of beans out and then put it into the trolley. 1 second food choice turns into a 20 second chore.. wait... also the 10minute confirm time before it unlocks
5: i then have to dump the emty box somewhere (unless point 3. i take it with me
)
6: i am now at the exit and have to start bagging up my stuff in view of a security guard to make sure i dont do point 3.
7: staff then dont only have to take stacks of baskets away from the cashier desk, but a whole stack of security boxes too.
honestly id rather take my items that were never security boxed to a cashiers desk and pay in one go. an idea such as the OP proposes would work for parking meters, newspaper vending machines but individual payments in a multi-product scenario is not time efficient nor is it cheaper. (imagine the 20 items in your trolley. that's 20 TX fee's if your hoping to get to your car on time)
seems the OP has not worked in retail or hasnt put his idea into a 'working scenario' (feasibility study)
what would work is a food vending machine. where instead of typing in E7 for a bottle of pepsi. you scan the QR code that represents E7 and the vending machine monitors the 30 qr codes (1 per product type) and spins the coil to make the product fall into the collection bin at the bottom, when it receives a payment