The correct option is D The earrings were so beautiful that I had to buy them.
'So that' is used to talk about a purpose. In the given sentence, the purpose is buying the earrings. 'So' is followed by an adjective. Options B, C and D are grammatically wrong. Thus, option A is the correct answer.