title: OpenCart load Model outside Controller
body: <p>I'm working on an OpenCart project, that requires a lot of customization.
  for my project I have to change something in the cart library (system/library/cart.php).</p>
  
  <p>I would have to call a custom function that's defined inside the product model (catalog/model/catalog/product.php).</p>
  
  <p>In a controller, loading a Model and using its functions is easy:</p>
  
  <pre><code>    $this-&gt;load-&gt;model("catalog/product");
      $this-&gt;model_catalog_product-&gt;customFunction();
  </code></pre>
  
  <p>But how do you load a model outside a controller?
  You can't create a new instance of the model, I already tried that:</p>
  
  <pre><code>    require_once("catalog/model/catalog/product.php");
      $a_model = new ModelCatalogProduct();
  </code></pre>
  
  <p>This obviously doesn't work cause models weren't intended to be used in such a way.</p>
  
  <p>I also tried to use the scope resolution operator ( ModelCatalogProduct::customFunction())
  It doesn't work either.</p>
  
  <p>I could pass all the required info as arguments, but I would rather use the model inside the cart library class, cause the changes would be global. </p>
  
  <p>Is it even possible to load a model outside a controller in OpenCart?</p>