title: Add custom options while adding grouped product to cart
body: <p>I've got a problem when adding a grouped product to cart.</p>
  
  <p>I need to set a custom option for all products that are added to cart while adding a grouped product to cart.</p>
  
  <p>What I have tried last (with a little bit of success):</p>
  
  <pre><code>&lt;checkout_cart_product_add_after&gt;
      &lt;observers&gt;
          &lt;customoptions&gt;
              &lt;type&gt;singleton&lt;/type&gt;
              &lt;class&gt;Company_CustomOptions_Model_Observer&lt;/class&gt;
              &lt;method&gt;addCustomOptionGroupSku&lt;/method&gt;
          &lt;/customoptions&gt;
      &lt;/observers&gt;
  &lt;/checkout_cart_product_add_after&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public function addCustomOptionGroupSku(Varien_Event_Observer $observer) {
      $product = $observer-&gt;getProduct ();
      if ($product-&gt;isGrouped ()) { 
          $quoteItem = $observer-&gt;getQuoteItem ();
          $additionalOptions = array (
                  'options' =&gt; array (
                          'label' =&gt; 'GROUPSKU',
                          'value' =&gt; $product-&gt;getSku () 
                  ) 
          );
          $quoteItem-&gt;addOption ( new Varien_Object ( array (
                  'product' =&gt; $quoteItem-&gt;getProduct (),
                  'code' =&gt; 'additional_options',
                  'value' =&gt; serialize ( $additionalOptions ) 
          ) ) );
      }
  }
  </code></pre>
  
  <p>I have created one grouped product, containing two products.
  But that code only adds the custom option "GROUPSKU" to one of the items in the cart. The other one is untouched.</p>
  
  <p>How do I get all the QuoteItems that are about to be added to the cart?</p>
  
  <p>PS: I have also added this question to the Magento part of StackExchange: <a href="https://magento.stackexchange.com/questions/51883/add-custom-options-while-adding-grouped-product-to-cart">https://magento.stackexchange.com/questions/51883/add-custom-options-while-adding-grouped-product-to-cart</a></p>