I would very much doubt that they have to browse the shelves looking for substitutes during opening hours, it's much more likely that the picking and packing is done after the shop shuts.
The different supermarket chains all have slightly different methods, and it can vary from location to location within one chain.
Tesco certainly have staff going round the store during normal opening hours picking orders from the shelves.
They use a different kind of trolley* to regular customers, and frankly can be a right pain because the trolley is so large - and could be used to pick more than one order at a time - so the staff might leave the trolley blocking an aisle for some time whilst they pick the different items in that location.
The shelf filling is usually done from cages (a tall metal cage on wheels) that are transported from the distribution depots to the stores. The boxes/outer packaging on those isn't opened until the cage gets to the display shelf in the store.
That's for the big Tesco stores.... your supermarket might do things differently.
(*Not to be confused with another set of staff with yet another different type of trolley who go round checking perishable stock for items close to the use by date and then take them to the discounted item shelf.)