title: How to create a separate custom register form within OpenCart 2?
body: <p>I am new to OpenCart 2. By default OpenCart provides the customer registration form uit of the box. I would like to create another registration form for company as user which has different input fields than the customer registration form.</p>
  
  <p>I copied the following files and renamed them properly.</p>
  
  <pre><code>- catalog/controller/account/register.php
  - catalog/model/account/customer.php
  - template/account/register.tpl
  </code></pre>
  
  <p>I have created a new database table for registering companies. When I looked in the <code>addCustomer($data)</code> function in the <code>ModelAccountCustomer</code> model I stuck with the following line of code.</p>
  
  <pre><code>$this-&gt;event-&gt;trigger('pre.customer.add', $data);
  </code></pre>
  
  <p>I want to change it into <code>$this-&gt;event-&gt;trigger('pre.company.add', $data);</code> in my <code>addCompany($data)</code> function of my <code>ModelAccountCompany</code> model. But it causes error. How can I solve it?</p>
  
  <p>Another issue is the following line of code inside of my <code>ControllerAccountRegisterCustomer</code> controller.</p>
  
  <pre><code>$this-&gt;customer-&gt;isLogged()
  and
  $this-&gt;customer-&gt;login();
  </code></pre>
  
  <p>I want to place the similarly code in my <code>ControllerAccountRegisterCompany</code> controller as follows.</p>
  
  <pre><code>$this-&gt;company-&gt;isLogged()
  and
  $this-&gt;company-&gt;login();
  </code></pre>
  
  <p>But the <code>$this-&gt;company</code> does not return a company object to call its' functions. How can I solve it?</p>