title: Updating the options of configurable product that is already in the cart of Magento 1.6.2
body: <p>Can anyone tell me how to update the options (using a dropdown select) of a configurable product that is already in the cart in Magento.</p>
  
  <p>I put the code to show the super attributes options (using a dropdown list) of a configurable product in the following file: <code>magento\app\design\frontend\default\theme-name\template\checkout\cart\item\default.phtml</code>.</p>
  
  <p>I found a line with this code:</p>
  
  <pre><code>&lt;?php if ($_options = $this-&gt;getOptionList()):?&gt;
  </code></pre>
  
  <p>After that, I put my code to show the attribute dropdown list for configurable products, and its working fine, but I need to update the super attribute option values for that product when I select another option from the super attribute dropdown list. Below is my code to show the dropdown:</p>
  
  <pre><code>&lt;?php
  if($this-&gt;getProduct()-&gt;isConfigurable()){
      $_product = Mage::getModel('catalog/product')-&gt;load($this-&gt;getProduct()-&gt;getId());
      Mage::getBlockSingleton('catalog/product_view_type_configurable')-&gt;unsetData();
      $_configurable = Mage::getBlockSingleton('catalog/product_view_type_configurable')-&gt;setData('product', $_product);
      $_cdata = json_decode($_configurable-&gt;getJsonConfig());
      $_current = array();
      foreach((array)$this-&gt;getOptionList() as $_option) {
          $_current[$_option['label']]=$_option['value'];
      }
      foreach($_cdata-&gt;attributes as $attribute) {
          ?&gt;
          &lt;strong&gt;&lt;?php echo $attribute-&gt;label;
          $catchlabel = $attribute-&gt;label;
          if($catchlabel == 'Clipboard Color'):
              $SelectOptions = "selectAtt";
          else:
              $SelectOptions = "selectFont";
          endif;
          ?&gt;
          &lt;/strong&gt;
          &lt;select style="width: 150px;"
  name="cart[&lt;?php echo $_item-&gt;getId() ?&gt;][option][&lt;?php echo $attribute-&gt;id ?&gt;]"
  id="&lt;?php  echo $_item-&gt;getId(); ?&gt;_&lt;?php echo $attribute-&gt;id;  ?&gt;"
  class="&lt;?php echo $SelectOptions; ?&gt;"&gt;
              &lt;?php
              foreach($attribute-&gt;options as $option) {
                  ?&gt;
                  &lt;option
                  &lt;?php echo ($_current[$attribute-&gt;label]==$option-&gt;label) ? ' selected' : '' ?&gt;
                      value="&lt;?php echo $option-&gt;id ?&gt;"&gt;
                      &lt;?php echo $option-&gt;label ?&gt;
  
                  &lt;/option&gt;
                  &lt;?php
              }
              ?&gt;
          &lt;/select&gt; 
          &lt;script type="text/javascript"&gt;
              jQuery('#&lt;?php  echo $_item-&gt;getId(); ?&gt;_&lt;?php echo $attribute-&gt;id;  ?&gt;').change(function() {
                  var getOption = jQuery('#&lt;?php  echo $_item-&gt;getId(); ?&gt;_&lt;?php echo $attribute-&gt;id;  ?&gt;').val();
                  // something to do here for update attibute options for current product
                  alert(getOption);
              });
          &lt;/script&gt; &lt;?php
      }
  }
  ?&gt;
  </code></pre>
  
  <p>please tell me how to update the super attribute options of the selected configurable product.</p>