adverb
Describes doing something while traveling or moving along a route; often implies using the travel time productively.
道々、買い物を済ませた。
I did the shopping along the way.
彼は道々、次の会議のことを考えていた。
He was thinking about the next meeting on the way.
途中 is a noun meaning 'on the way' or 'midway', often used with で (途中で). 道々 is an adverb emphasizing the action done while moving along the route.
Reduplication of 道 (みち, 'road, way'), forming an adverb meaning 'along the way'. The iteration mark 々 is commonly used in the kanji spelling.