The correct answer is: D. I am going to do it this afternoon.
The other options are incorrect because they do not accurately reflect the speaker's current state. The speaker has not done the shopping yet, but they plan to do it this afternoon. Option A, "I have gone to do it this afternoon," is incorrect because the speaker has not yet gone to do the shopping. Option B, "I went to do it this afternoon," is incorrect because the speaker did not go to do the shopping this afternoon. Option C, "I would go to do it this afternoon," is incorrect because the speaker is not planning to go to do the shopping this afternoon, they are planning to do it.
The speaker's use of the present progressive tense ("I am going to do it") indicates that they are planning to do the shopping in the near future. The speaker's use of the adverb "this afternoon" further specifies that they plan to do the shopping in the afternoon of the same day.