This is not meant as a coding forum. Users are responsible for writing and debugging their own custom themes. Do not expect significant help.
You also have not furnished much information, such as the transaction type you are displaying. It may be that some of your variables are not called by the form. For example, a receipt form never displays an address.