title: $quote->setHasError(true) Not Working
body: <p>I am using code from <a href="https://magento.stackexchange.com/a/33890/32082">here</a> to add an observer, get qty available from external source, and then set error true/false.</p>
  
  <p>I have the observer set up correctly. I know this as it is doing everything I need it to, except show the fact that there are errors in the cart.</p>
  
  <p>My code inside the observer (using <code>sales_quote_item_qty_set_after</code>) is:</p>
  
  <pre><code>public function cartQtyUpdated(Varien_Event_Observer $observer) {
          if ($action = Mage::app()-&gt;getFrontController()-&gt;getAction()) {
  
              /** @var Mage_Sales_Model_Quote_Item $item */
              $item = $observer-&gt;getEvent()-&gt;getItem();
  
              if ($item-&gt;dataHasChangedFor('qty')) {
  
                  $qty        = (int)$item-&gt;getQty();
                  $product_id = (int)$item-&gt;getProduct()-&gt;getId();
  
                  /** @var Mage_Catalog_Model_Product $product */
                  $product = Mage::getModel('catalog/product')-&gt;load($product_id);
  
                  $product_id = (int)$product-&gt;getEntityId();
  
                  if ($product-&gt;getTypeId() == "configurable") {
                      $simple_id = (int)$item-&gt;getOptionByCode('simple_product')-&gt;getProduct()-&gt;getId();
                  } else {
                      $simple_id = $product_id;
                  }
  
                  if (
                      $simple_id != '' &amp;&amp;
                      $qty != ''
                  ) {
  
                      // Logic to get stock levels
  
                      if ($available['status'] == 'success') {
  
                          foreach ($options as $option) {
                              if ($option-&gt;getCode() == 'additional_options') {
                                  $additional_options = unserialize($option-&gt;getvalue());
                                  foreach ($additional_options as $key =&gt; $additional_option) {
                                      if ($additional_option['label'] == "Delivery Estimate") {
                                          $additional_options[$key]['value'] = $available['time'];
                                      }
                                  }
                                  $option-&gt;setValue(serialize($additional_options));
                              }
                          }
                          $item-&gt;setOptions($options)-&gt;save();
                          Mage::getSingleton('checkout/cart')-&gt;save();
                      } else {
  
                          $item-&gt;getQuote()-&gt;setHasError(true);
                          $item-&gt;addErrorInfo(
                              'checkout',
                              1,
                              Mage::helper('cataloginventory')-&gt;__('The requested Qty is not available.')
                          );
                          foreach ($options as $option) {
                              if ($option-&gt;getCode() == 'additional_options') {
                                  $additional_options = unserialize($option-&gt;getvalue());
                                  foreach ($additional_options as $key =&gt; $additional_option) {
                                      if ($additional_option['label'] == "Delivery Estimate") {
                                          $additional_options[$key]['value'] = "N/A";
                                      }
                                  }
                                  $option-&gt;setValue(serialize($additional_options));
                              }
                          }
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>The part that doesn't seem to be working is </p>
  
  <pre><code>$item-&gt;getQuote()-&gt;setHasError(true);
  $item-&gt;addErrorInfo(
      'checkout',
      1,
      Mage::helper('cataloginventory')-&gt;__('The requested Qty is not available.')
  );
  </code></pre>
  
  <p>I am sure that I have had this working in the last couple of days but for some reason it just won't save the error.</p>
  
  <p>When I put through a qty that I know is not available, and I know returns an the correct error, the cart buttons are still visible and there are no errors on the cart item.</p>
  
  <p>I have added logs at the end of the above script and can safely say that the <code>setHasError()</code> method is doing it's job. Also, I added <code>Mage::log($item-&gt;getErrorInfos(), 7, 'cart.log', true);</code> which returns an array containing the exact error I am trying to set.</p>
  
  <p>As everything seems to be setting properly, I am unsure as to why the cart is not showing the errors and why it seems to let me checkout.</p>
  
  <p>Is there anything I can do to find where the errors are being lost between the observer and the cart reloading?</p>
  
  <p>I feel like I'm talking to myself a bit here but here's an update:</p>
  
  <p><strong>Update</strong></p>
  
  <p>I have used <code>$item-&gt;getQuoteId()</code> to get the quote ID in the observer method and used</p>
  
  <pre><code>$session        = Mage::getSingleton('checkout/session');
  $quote_id       = $session-&gt;getQuoteId();
  </code></pre>
  
  <p>To get the quote ID in the <code>cart.phtml</code> file. Both ID's are the same.</p>
  
  <p>Could really do with some input on this guys and girls...</p>