title: Adding Item to cart not working codeigniter
body: <p>I am trying to add item to cart, but its not adding. I am always getting message that cart is empty. Below is my code:</p>
  
  <p><strong>controller:</strong></p>
  
  <pre><code>  $data = array(
              'id'    =&gt; $product_id,
              'qty'   =&gt; 1,
              'price' =&gt; $product_data-&gt;prod_price,
              'name'  =&gt; $product_data-&gt;prod_name,
          );
          print_r($data);
  
          $this-&gt;cart-&gt;insert($data);
          if (!$this-&gt;cart-&gt;contents()) {
              echo '&lt;br/&gt;&lt;br/&gt;No Item in Cart';
          }
  </code></pre>
  
  <p><strong>Output:</strong>
  Array ( [id] => 1 [qty] => 1 [price] => 150.00 [name] => CALPOT-1L(10GM%) [Free] )</p>
  
  <p>No Item in Cart</p>