/scoreboard objectives add shop dummy
/scoreboard objectives add money dummy
For the command block that is behind the button:
1. scoreboard players add list shop 1
2. scoreboard players remove list shop 1
From now you have to watch the video to know the order:
3. scoreboard players test list shop 0 0
4. scoreboard players set list shop 3
5. scoreboard test list shop 4 4
6. scoreboard players set list shop 1
7. scoreboard players test list shop 1 1
8. clone ~-1 ~ ~ ~-1 ~ ~ x y z (coordination of the item frame)
9. testforblocks ~-1 ~ ~ ~-1 ~ ~ x y z (same coordination)
10. give @p[scores={money=(amount you want)..}] (item) (amount of item)
ex) give @p[scores={money=100..}] planks 64
11. scoreboard players remove @p[scores={money=(same amount as #10)..}] money (same amount as #10)
ex) scoreboard players remove @p[scores={money=100..}] money 100
If you want to add more items to the shop you can repeat the steps from 7~11