title: Manually adding custom options to existing products
body: <p>I'm trying to add some custom options to already existing products in Magento. Seems to work fine, I added the needed rows in the following tables:</p>
  
  <pre><code>catalog_product_option
  catalog_product_option_title
  catalog_product_option_type_value
  catalog_product_option_type_price
  catalog_product_option_type_title
  </code></pre>
  
  <p>I also updated <code>has_options</code> and <code>required_options</code> for the right product, in the following tables:</p>
  
  <pre><code>catalog_product_entity
  catalog_product_flat_1
  catalog_product_flat_2
  catalog_product_flat_3
  </code></pre>
  
  <p>When I open the product, the options doesn't show, actually, it shows less. The button to order it disappears. When I open the <em>edit</em> page, it does show the options. After saving, it appears on the front-end too.</p>
  
  <p>What am I missing?</p>
  
  <p><strong>Update:</strong>
  After manually going through literally every query that was executed after a save action, I discovered what I was missing. When a product has options, it has to display them in a different <em>template</em> (or whatever it's called in Magento). To do this, you'll have to change the value for the attribute <code>options_container</code>.</p>
  
  <p>So, there's a really easy fix for that. Just look up the <code>attribute_id</code> in the table <code>eav_attribute</code>. Then just run the following query for each product:</p>
  
  <pre><code>UPDATE `catalog_product_entity_varchar` SET `value` = 'container1' WHERE `attribute_id` = 836 AND `entity_id` = $productId;
  </code></pre>
  
  <p>That'll do the trick! :)</p>