Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>@<a href="https://stackoverflow.com/a/5962237/3765">Jonathan Day</a>'s answer is great and helped me tremendously. However - as long as you've set your <code>setup</code> class to <code>Mage_Customer_Model_Entity_Setup</code>, then Magento can do all of that work for you:</p> <pre><code>&lt;!-- config.xml Example --&gt; &lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;global&gt; &lt;resources&gt; &lt;acme_module_setup&gt; &lt;setup&gt; &lt;module&gt;Acme_Module&lt;/module&gt; &lt;class&gt;Mage_Customer_Model_Entity_Setup&lt;/class&gt; &lt;/setup&gt; &lt;connection&gt; &lt;use&gt;core_setup&lt;/use&gt; &lt;/connection&gt; &lt;/acme_module_setup&gt; &lt;/resources&gt; &lt;/global&gt; &lt;/config&gt; </code></pre> <p>And here is the <code>mysql4-install-X.X.X.php</code> file:</p> <pre><code>&lt;?php $installer = $this; /* @var $installer Mage_Customer_Model_Entity_Setup */ $installer-&gt;startSetup(); $installer-&gt;addAttribute( 'customer', 'acme_imported', array( 'group' =&gt; 'Default', 'type' =&gt; 'int', 'label' =&gt; 'Imported into Acme', 'input' =&gt; 'select', 'source' =&gt; 'eav/entity_attribute_source_boolean', 'global' =&gt; Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'required' =&gt; 0, 'default' =&gt; 0, 'visible_on_front' =&gt; 1, 'used_for_price_rules' =&gt; 0, 'adminhtml_only' =&gt; 1, ) ); $installer-&gt;endSetup(); </code></pre> <p>The <code>adminhtml_only</code> above will handle all of the <code>used_in_forms</code> logic for you. Also, defining <code>group</code> will take care of assigning it to the attribute group.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload