From the Old English heorte. The spelling changed to the current ~ea~ form around the middle of the second century as analogy with words like heat and stream, but pronunciation was unaffected.
Old Engish "heorte" Old High German "herza" (German "Herz"), Greek "ker", "kardia", Latin "cor". This seems to be a common but changed word in a lot of languages. Remember, for many centuries, people's appreciation and learning of language was entirely aural. The sound of the word was transferred. The Greek and Latin words sound similar, and when taken further afield the corruption took place on the consonants before the vowel sounds.