Depends on what I am buying.
For new clothing or shoes, I like to try them on before I buy, so will always choose a local bike shop for these - but I often only have a choice of one shop depending on the brand. I do not like to try something in a shop only to buy online later, seems rather underhand to me.
For direct replacement clothing or shoes - I will buy online from one of the larger online stores. This only applies to replacing like with like, not buying next years model of something I already own!
For components to be fitted to the bike, again I choose a local bike shop - but can usually choose from a greater range of shops. Choice is usually dependent on the cost/time of fitting the parts. I am not confident fitting expensive items, so rely on a bike shop for their guaranteed work.
For accessories or wear-and-tear items, I almost always buy online from one of the larger online stores. P&P and the method of delivery (Royal Mail or courier) are often the deciding factor when choosing an online retailer.
I hope this helps.