The correct option is B After buying the bag
An adverb clause is a group of words containing a subject and a verb, and it functions as an adverb, by modifying an adjective, verb or an adverb. Adverb clauses generally begin with a subordinate conjunction (since, because, while, etc.)
Generally, while reducing an adverb clause to a phrase, the subject is removed and the verb is changed to a present participle (verb + ing). (If there is an auxiliary/helping verb attached, the subject is removed.)
The underlined words form a clause, with the adverb of time "after", the subject "he", verb "bought" and object "the phone". Hence the sentence needs to be changed and option A is incorrect.
Option B is correct because the subject is removed, hence modifying the adverb clause into an adverb phrase (with the adverb of time intact).
Option C is incorrect because "he" should be removed, when "buying" is placed the subject is not required anymore.
Option D is incorrect because the adverb has been changed to 'while', hence changing the meaning of the sentence.