I wouldn't buy a bike online, unless I knew the exact make, model and size I want. Even if online sites offer a fabulous deal, there is no substitute for trying it out before you buy it.
If you dislike the bike or have problems with it, returns will be more of a hassle, even if the company offers a great policy. Packing it up and shipping it is more difficult than tossing it on the back of a car and bringing it to a shop.
Get advice; get parts; get accessories; but buy the whole big in a shop.