I would like to "intercept" a transaction's customer details, in order to write it to a text file.

I know that this is possible (because customer information is in the database, accessible by Zen Cart's PHP scripts, and displayable accordingly), but I don't know what is the correct approach to implement it?

Should I hack an existing PHP file to pipe this information to the text file?

Or is there already a "hook" somewhere in Zen Cart that allows me to do that more cleanly and/or elegantly?

Thanks,
Daniel