Mind I am not as expert as the 2 persons before me...
However the way I see it, is the に gives me an idea of purpose, while the て form gives more an idea of one action following the other.
I am not English native, but I think it can be equal to "go in order to buy" and "go and buy".
Basically...use them as if they have the same meaning