title: Add another dimension into array cart
body: <p>I have a shopping cart, which works just fine, but I would like to store type of goods (for example color, size, etc.).</p>
  
  <p><strong>Here is a function that gets items from shopping cart</strong></p>
  
  <pre><code>public static function getCart() {
          if((isset($_SESSION['cart'])) &amp;&amp; count($_SESSION['cart'])&gt;0) {
              $ids = "";
              foreach($_SESSION['cart'] as $id =&gt; $quantity) {
                  $ids = $ids . $id . ",";
              } 
              $ids = rtrim($ids, ',');
  
              $dotaz = dibi::fetchAll("SELECT * FROM eshop_products WHERE idProduct IN ({$ids})");
              return $dotaz;
          } else {
              //do nothing
          }
      }
  </code></pre>
  
  <p><strong>And function that adds items to shopping cart</strong></p>
  
  <pre><code>public static function addToCart($data) {
  
          $id = $data['id']; 
          $quantity = $data['qty']; 
          $varianta = $data['varianty']; //THIS IS WHAT I NEED TO ADD TO SESSION ARRAY
  
  
          if(!isset($_SESSION['cart'])) {
              $_SESSION['cart'] = array();
          }
  
  
          if(isset($_SESSION['cart'][$id])) {
              $_SESSION['cart'][$id] += $quantity;
          } else {
              $_SESSION['cart'][$id] = $quantity;
          }   
      }
  </code></pre>
  
  <p>Is there some easy way to do that? I googled some tutorials, but still no success.</p>
  
  <p>Thank you.</p>