title: ERROR: Call to a member function getProducts() on a non-object
body: <p>I am getting an error:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function getProducts() on a non-object
    in
    /var/www/vhosts/designsense.net.au/gypsy/public_html/catalog/controller/module/cart.php
    on line 23</p>
  </blockquote>
  
  <p>This is the code i am using.</p>
  
  <pre><code>    class ControllerModuleCart extends Controller { 
      protected function index() {
      $this-&gt;language-&gt;load('module/cart');
  
      $this-&gt;data['heading_title'] = $this-&gt;language-&gt;get('heading_title');
      $this-&gt;data['text_subtotal'] = $this-&gt;language-&gt;get('text_subtotal');
      $this-&gt;data['text_empty'] = $this-&gt;language-&gt;get('text_empty');
      $this-&gt;data['text_remove'] = $this-&gt;language-&gt;get('text_remove');
      $this-&gt;data['text_confirm'] = $this-&gt;language-&gt;get('text_confirm');
      $this-&gt;data['text_cart'] = $this-&gt;language-&gt;get('text_cart');
      $this-&gt;data['text_checkout'] = $this-&gt;language-&gt;get('text_checkout');
      $this-&gt;data['button_checkout'] = $this-&gt;language-&gt;get('button_checkout');
      $this-&gt;data['button_remove'] = $this-&gt;language-&gt;get('button_remove');
      $this-&gt;data['text_cart'] = $this-&gt;language-&gt;get('text_cart');
  
      $this-&gt;data['cart'] = $this-&gt;url-&gt;link('checkout/cart');
      $this-&gt;data['checkout'] = $this-&gt;url-&gt;link('checkout/checkout', '', 'SSL');
  
      // Get Cart Products
      $this-&gt;data['products'] = array();
  
      foreach ($this-&gt;cart-&gt;getProducts() as $result) {
  
          $option_data = array();
  
          foreach ($result['option'] as $option) {
              $option_data[] = array(
                  'name'  =&gt; $option['name'],
                  'value' =&gt; (strlen($option['option_value']) &gt; 20 ? substr($option['option_value'], 0, 20) . '..' : $option['option_value'])
              );
          }
  </code></pre>
  
  <p>Any suggestions on what could be causing this? </p>