Well, you are the one that's putting the items in the shop right?
The items can also be added during the game in a way you can't predict which shop contains a certain item, so, if that's the case, you need to store the shop in a variable when adding the item into the shop through a trigger. Understand?