You can do this in a number of ways based on your needs. Assuming that no other links are available from within the shop, you could use the previous() function or the <<return>> macro*:
[[Go back.|previous()]]
--OR--
<<return 'Go back.'>>
However, if other links are available, such as links that allow you to look at the items, or links in the StoryMenu, you can instead save the passage the player went to the shop from in a variable:
:: outside the shop
[[Go into the shop.|shop][$return to passage()]]
:: in the shop
[[Go back.|$return]]
You could also use tags to control this: http://twinery.org/forum/discussion/1821#msg4762. A system like this has the benefit of being a bit more automated.
* Note that the <<return>> macro is probably what you'll want to use here, not the <<back>> macro. The latter pushes the State history back one turn, which will undo story variable changes, and probably undo anything the player does in the shop, while the <<return>> macro goes back to the previous passage, but does so by creating a new moment in the history, preserving any changes to the State and other variables.