First, in this passage-like sentence, there is nothing incorrect, unnatural or illogical; It is just plain good.
I'm having trouble with the order of "途中の商店"
But it is 「途中の商店街」, and not 「途中の商店」.
The 商店街 ("shopping street or area") is located somewhere between where the speaker was and his/her destination, which is a supermarket.
And the computer school is located in that 商店街. 「にある」 just describes the location of the school. Are you following so far?
「ふと」 modifies 「目にとまりました」 and nothing else. ←← This is the only part that was not translated literally in the translation you provided. In the original, the subject of the verb phrase 「目にとまりました」 is 「パソコンスクール」 ("the school caught my attention"). In the translation, however, "I came across ~~" was used instead and that is good translation. That happens all the time in translation between two linguistically unrelated languages like Japanese and English.
「途中の商店街にあるパソコンスクール」 is a relative clause. Perfectly natural, grammatical, etc. 「途中の商店街にある」 modifies 「パソコンスクール」. You must get used to this word order in Japanese. In English, "the computer school" would come first as in "the computer school (that is) located in the shopping area on my way to ~~"
Thus, the translation you provided is of high quality though it is not 100% literal TL. You can trust it fully in learning the meaning of the sentence, if not the exact structure of the original.