Answer:
D. From the market.
Step-by-step explanation:
If you were to continue with 'but' in this sentence, you would need a comma after 'bought'. This means that A and C are not the right answer.
If we were to use B, you would need to put 'that' after bought. This means B is not the right answer either.
D fits. There are no grammatical mistakes if you were to apply it. It also makes sense in a conversation, versus the other three answers.
The sentence would be "This is the shirt that I bought from the market."