I don't know how they tell the difference between all the generic powders that look the same, like white flour and rice flour, but they do. And if they don't, I suppose they just ask the customer.
Not in the 1970s and early 80s. Do you know what computers costed back then? 1 KB of memory was as expensive as the whole cash register used by Aldi/Lidl. And there was no computer networking whatsoever, not even between multi-million super computers. When the German railways introduced computers at the ticket windows in the 80s all ticketing data was stored on 8 inch diskettes. And if you bought a not so common ticket the agent had to swap the diskette first.
I don't think Aldi/Lidl used diskettes at their cash registers. Maybe when scanning started in the mid/late eighties, but they certainly didn't have to swap during the day.
Maybe floppies was the more common term. Obviously that part of my memory hasn't been refreshed for a couple of years...
On a historical note (I am old enough to have shopped before bar codes existed):
Generally stores had little price tags attached to every single item. Which was labour intensive twice: First someone has to attach the tag to each item and at the checkout it needs to be found somewhere on the product, read and the price to be entered into the cash register.
With only 1000 products (back then, IIRC) and no weekly offers at all it took only 2-3 days for a new cashier to learn all prices by heart and easy for the store to skip the stickers altogether and just mark the price at the shelf. Typing prices without having to search for a tiny little sticker somewhere on the product was super fast and efficient compared to the competitors. Cashiers just dropped the product into the cart with one hand and typed with the other.
Aldi introduced bar code scanners several years after the "full assortment" competition. At some point probably the better inventory book-keeping started to outweigh the costs.
(Edit: clarified that Aldi had no price stickers at all)