Usually buying online is cheaper. You then have the option of other car parts shops and local garages which have connections to such parts and get discounts.
In reality it really depends on how you are going to fit them. If you give the job to somebody else, it could turn out cheaper to let them source the parts as well. But in that case, make sure that they fit the same part you want and not something cheaper.
You should also consider doing the springs. If they told you that the shocks are gone, then the springs may not be in their first youth as well.