title: How can I dynamically set/unset "is_require" flag on options in Magento?
body: <p>I am working on a Magento store that has a custom embroidery option for clothing products.  Adding embroidery is optional (not required.)  HOWEVER, if you do choose the embroidery option, there are a number of options which then become required, such as the name, font, etc.</p>
  
  <p>I thought I could accomplish this by using javascript to remove the embroidery option fields if the checkbox to "Add embroidery" was not checked, and then using this code in an the overloaded Checkout/CartController.php:</p>
  
  <pre><code>/* Options #23-40 are the embroidery details */
  
  foreach($product-&gt;getOptions() as $_option){
      if($_option-&gt;option_id &gt;= 23 &amp;&amp; $_option-&gt;option_id &lt;= 40){
          $_option-&gt;setIsRequire(false);
      }
  }
  </code></pre>
  
  <p>This ALMOST did the trick, however when I get to the view cart page, there is this error at the top:</p>
  
  <p>"Some of the products below do not have all the required options. Please edit them and configure all the required options."</p>
  
  <p>Can someone suggest a different approach, or at least let me know if I'm on the right track?  And I'm not interested in buying another module to accomplish this.</p>
  
  <p>Thanks!</p>