Shopkeepers are losing buyers in droves to e-tailers for everything from fashion to smartphones, and are struggling to find solutions.