The thing should have an optical system to see if some products have fallen or where they are in the shelf. You Need to pull older products to the front (you don't want a product to stay there for ever)
Think this is way to complicated to make it an economical sollution.