So first you'll want to put one hopper connecting to a mother hopper below it after that put a dropper under the bottom hopper and fill it with the item the shop is selling next in the bottom hopper put 18 of your item in the first slot and the rest of the slots in that hopper fill with one after that put a comparator next to the bottom hopper and put 2 pieces of redstone out in front of the comparator then after those red stone pieces put one repeater and set it to whatever tick next connect a command block with the compartor line of red stone sot hat it's close to the top hopper and put in this command
And for the hopper and dropper filled up that's support to be the currency on those two and after that hide the redstone in a floor and you're done
/give @p (item I'd) (amount)
And for the hopper and dropper filled up that's support to be the currency on those two and after that hide the redstone in a floor and you're done
/give @p (item I'd) (amount)