Catalyzes the conversion of caffeic acid to ferulic acid and of 5-hydroxyferulic acid to sinapic acid. The resulting products may subsequently be converted to the corresponding alcohols that are incorporated into lignins. (E)-caffeate + S-adenosyl-L-methionine = (E)-ferulate + H(+) + S-adenosyl-L-homocysteine Aromatic compound metabolism; phenylpropanoid biosynthesis. Homodimer. Fruit. Not expressed in leaf. Expression increases during fruit development but decreases during ripening. Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-independent O-methyltransferase family. COMT subfamily.