I have added a basic contact form into the footer of an Opencart theme. E.g I have:
if (($this->request->server['REQUEST_METHOD'] == 'POST') &&
(isset($this->request->post['enquiry_submit'])) && $this->validate()) {
This works correctly as expected. The problem now is that if you are on a different page such as Customer Register and try to send the Footer contact form I get a load of Undefined notices.
Putting the code in the controller for the footer may seem like a good idea, however it does mean that you’re then going to end up trying to post to the footer itself to guarantee its available every page, which is a bit overkill and bad practice. The way to resolve this would be to either: