A simple way to create some Shop or ItemSwitch with players, in VANILLA !
It use a CommandBlock with the command "/give @p IDitem Quantity". Replace the ID by the item you want to give (exemple: /give @p dirt 5). To change the "input-item", just put one item you want on the first hopper, first place. The ratio is : 1 item VS X items (Command number).
Sometimes, you will have to make the output-chest empty, but it works forever, no refund required, it's infinity! And the most important : it's totaly stackable (to the right and left) if you switch chest by TrappedChest for 1/2 times.
Good Luck & Have Redstone !