Cocoa
early 18th century (denoting cacao seed): alteration of cacao.
wiktionary
From Spanish cacao, from Classical Nahuatl cacahuatl. The form cocoa by confusion with coco, popularized by Samuel Johnson's A Dictionary of the English Language. Doublet of cacao.
By confusion with cocoa, popularized by Samuel Johnson's A Dictionary of the English Language.
etymonline
cocoa (n.)
"brown powder produced by grinding roasted seeds of the cacao, an American evergreen tree," 1788, originally the seeds themselves (1707), corruption (by influence of coco) of cacao. The confusion with coco was already underway in English when the printers of Johnson's dictionary ran together the entries for coco and cocoa, after which it has never been undone. Cocoa has been the regular spelling from c. 1800.