Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should update some fields in the DB.</p> <p>For example. I need to remove last name from registration form. It's a requried field. So I created own module with sql update file to change field parameters:</p> <p><strong>upgrade-1.0.0.1-1.0.0.2.php</strong></p> <pre><code>/* @var $installer Mage_Customer_Model_Entity_Setup */ $installer = $this; $installer-&gt;startSetup(); // SELECT attribute_id, entity_type_id FROM eav_attribute where attribute_code = 'lastname' // SELECT * FROM customer_eav_attribute where attribute_id in (SELECT attribute_id FROM eav_attribute where attribute_code = 'lastname') $options = unserialize('a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}'); if (isset($options['min_text_length'])) unset($options['min_text_length']); $installer-&gt;addAttribute('customer', 'lastname', array( 'validate_rules' =&gt; serialize($options), 'required' =&gt; false )); $installer-&gt;addAttribute('customer_address', 'lastname', array( 'validate_rules' =&gt; serialize($options), 'required' =&gt; false )); $installer-&gt;endSetup(); </code></pre> <p>After that you should hide this field using html+css or js</p> <p><strong>UPDATE:</strong></p> <p>Edit file <em>/app/design/frontend/default/YOURTHEME/template/customer/widget/name.phtml</em> to change your registration form. In my case I commented out html block there:</p> <pre><code>&lt;?php /*if ($this-&gt;showMiddlename()): ?&gt; &lt;?php $isMiddlenameRequired = $this-&gt;isMiddlenameRequired(); ?&gt; &lt;div class="field name-middlename"&gt; &lt;label for="&lt;?php echo $this-&gt;getFieldId('middlename')?&gt;"&lt;?php echo $isMiddlenameRequired ? ' class="required"' : '' ?&gt;&gt;&lt;?php echo $isMiddlenameRequired ? '&lt;em&gt;*&lt;/em&gt;' : '' ?&gt;&lt;?php echo $this-&gt;getStoreLabel('middlename') ?&gt;&lt;/label&gt; &lt;div class="input-box"&gt; &lt;input type="text" id="&lt;?php echo $this-&gt;getFieldId('middlename')?&gt;" name="&lt;?php echo $this-&gt;getFieldName('middlename')?&gt;" value="&lt;?php echo $this-&gt;escapeHtml($this-&gt;getObject()-&gt;getMiddlename()) ?&gt;" title="&lt;?php echo $this-&gt;getStoreLabel('middlename') ?&gt;" class="input-text &lt;?php echo $this-&gt;helper('customer/address')-&gt;getAttributeValidationClass('middlename') ?&gt;" &lt;?php echo $this-&gt;getFieldParams() ?&gt; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php endif; */?&gt; &lt;!--&lt;div class="field name-lastname"&gt; &lt;label for="&lt;?php echo $this-&gt;getFieldId('lastname')?&gt;" class="required"&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo $this-&gt;getStoreLabel('lastname') ?&gt;&lt;/label&gt; &lt;div class="input-box"&gt; &lt;input type="text" id="&lt;?php echo $this-&gt;getFieldId('lastname')?&gt;" name="&lt;?php echo $this-&gt;getFieldName('lastname')?&gt;" value="&lt;?php echo $this-&gt;escapeHtml($this-&gt;getObject()-&gt;getLastname()) ?&gt;" title="&lt;?php echo $this-&gt;getStoreLabel('lastname') ?&gt;" maxlength="255" class="input-text &lt;?php echo $this-&gt;helper('customer/address')-&gt;getAttributeValidationClass('lastname') ?&gt;" &lt;?php echo $this-&gt;getFieldParams() ?&gt; /&gt; &lt;/div&gt; &lt;/div&gt;--&gt; </code></pre> <p>Also you could add some class to <code>&lt;div class="field name-middlename"&gt;</code> and <code>&lt;div class="field name-lastname"&gt;</code>. This class should has css property <code>"display:none;"</code>.</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.
 

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