In Spain and France (and probably other countries too) they’ve been doing something that’s pretty neat in regards to the fruits and vegetables since long before self-checkout even became a thing, but which helps a lot now with self-checkout as well.
When you go to the fruits and vegetables section of the store, a lot of these stores have a scale there with a printer.
So when you pick the fruits and vegetables, you weigh and print a label for them there and then.
And then when you get to the checkout, you just scan the item.
You kind of have to experience this in person to see why that works well, but it does :)