The general etymology is the French cap à pied, but the French phrase is de pied en cap.
“Armed at all points exactly cap-a-pie.”
Shakespeare: Hamlet, i. 2.
“I am courtier, cap-a-pe.”
Shakespeare: Winter's Tale, iv. 3.
We are told that cap à pie is Old French, but it would be desirable to give a quotation from some old French author to verify this assertion. I have hunted in vain for the purpose. Again, is pie Old French for pied? This is not a usual change. The usual change would be pied into pie. The Latin might be De capi te ad pedem.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894