title: Codeigniter cart can't insert data
body: <p>I'm trying to add some data to a codeigniter (HMVC codeigniter) chopping cart and display it, i'm using this method in the main cart controller: </p>
  
  <pre><code>function add_to_cart(){
      $this-&gt;load-&gt;library('cart');
  
      // Get data
      $userID = $this-&gt;input-&gt;post('userID');
      $eventID = $this-&gt;input-&gt;post('eventID');
      $tickedID = $this-&gt;input-&gt;post('tickedID');
  
      // Get ticket data
      $this-&gt;load-&gt;module('ticket');
      $ticket_query = $this-&gt;ticket-&gt;get_where($tickedID);
  
      //echo $this-&gt;session-&gt;all_userdata();
  
      foreach($ticket_query-&gt;result() as $ticket_data){
          $ticketPrice = $ticket_data-&gt;price;
          $ticketCategory = $ticket_data-&gt;category;
      }
  
      //echo 'tickedID: '.$tickedID.' price: '.$ticketPrice.' category: '.$ticketCategory;
  
      // Add item to cart
      $data_items = array(
             'id'      =&gt; $tickedID,
             'qty'     =&gt; 1,
             'price'   =&gt; $ticketPrice,
             'category'    =&gt; $ticketCategory,
             'options' =&gt; array()
          );
  
      $this-&gt;cart-&gt;insert($data_items);
  
      $cart = $this-&gt;cart-&gt;contents();
      echo '&lt;pre&gt;';
      echo print_r($cart);
      echo '&lt;/pre&gt;';
  
  
  
  
  }
  </code></pre>
  
  <p>Basically i'm getting the <code>userID</code>, <code>eventID</code> and <code>tickedID</code> variables from the session, then I run a query to get the ticked with the specific id. I run through the results of the query and get the <code>$thicketPrice</code> and <code>$ticketCategory</code> variables from it. Then I attempt to set the variables in <code>$data_items</code> to insert in the cart itself. FInally I attempt to <code>echo</code> the contents of the care and all I get is an empty array.</p>
  
  <p>The session, database and cart libraries are all autoloaded and the sessions are using the database, they have the <code>ci_sessions</code> table. THe sessions also have an ecrypted key, what is wrong?</p>