title: Opencart 2 Add custom customer data to admin customer profile page
body: <p>I have a new mysql table I call co_customer that stores additional unique content about a customer. This content I have all viewable and working on the customer registration form. However I am now trying to make these new custom fields editable on the admin panel customer profile page. 
  I am currently just testing this our to get one of the new fields to work. However the new field is blank and I am getting the below error at the top of the page</p>
  
  <pre><code>Notice: Undefined index: cofirstname in  
  /home/public_html/admin/controller/customer/customer.php on line 972
  </code></pre>
  
  <p>I edited the below file
  public_html/admin/model/customer/customer.php</p>
  
  <pre><code>public function getCustomer($customer_id) 
   {
       $query = $this-&gt;db-&gt;query("SELECT DISTINCT * FROM " . DB_PREFIX . "customer WHERE customer_id = '" . (int)$customer_id . "'");
       return $query-&gt;row;
  
               //get coapplicant data
               $cocustomersql = $this-&gt;db-&gt;query("SELECT * FROM " . DB_PREFIX . "co_customer WHERE customer_id = '" . (int)$customer_id . "'");
               if ($cocustomersql-&gt;num_rows &gt; 0) 
               {
                    return $cocustomersql-&gt;row;
               }
   }
  </code></pre>
  
  <p>I edited the below file
  public_html/backoffice/controller/customer/customer.php</p>
  
  <pre><code> if (isset($this-&gt;request-&gt;post['cofirstname'])) 
      {
          $data['cofirstname'] = $this-&gt;request-&gt;post['cofirstname'];
      } elseif (!empty($customer_info)) {
          $data['cofirstname'] = $customer_info['cofirstname'];
      } else {
          $data['cofirstname'] = '';
      }
  </code></pre>