Magento 1.7-从/customer/account/create中的注册中删除字段/

Magento 1.7-从/customer/account/create中的注册中删除字段/,magento,magento-1.7,Magento,Magento 1.7,我想从注册中删除字段(/customer/account/create/)。我该怎么做? 有没有办法不进入存储区的文件(例如隐藏这些字段)?您应该更新数据库中的一些字段 比如说。我需要从登记表上删除姓氏。这是一个要求的领域。 因此,我使用sql更新文件创建了自己的模块来更改字段参数: 升级-1.0.0.1-1.0.0.2.php /* @var $installer Mage_Customer_Model_Entity_Setup */ $installer = $this; $instal

我想从注册中删除字段(/customer/account/create/)。我该怎么做?
有没有办法不进入存储区的文件(例如隐藏这些字段)?

您应该更新数据库中的一些字段

比如说。我需要从登记表上删除姓氏。这是一个要求的领域。 因此,我使用sql更新文件创建了自己的模块来更改字段参数:

升级-1.0.0.1-1.0.0.2.php

/* @var $installer Mage_Customer_Model_Entity_Setup */

$installer = $this;

$installer->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->addAttribute('customer', 'lastname', array(
    'validate_rules' => serialize($options),
    'required'       => false
));

$installer->addAttribute('customer_address', 'lastname', array(
    'validate_rules' => serialize($options),
    'required'       => false
));

$installer->endSetup();
之后,应该使用html+css或js隐藏此字段

更新:

编辑文件/app/design/frontend/default/YOURTHEME/template/customer/widget/name.phtml以更改注册表。在我的例子中,我注释掉了html块:

<?php /*if ($this->showMiddlename()): ?>
        <?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?>
        <div class="field name-middlename">
            <label for="<?php echo $this->getFieldId('middlename')?>"<?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?><?php echo $this->getStoreLabel('middlename') ?></label>
            <div class="input-box">
                <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('middlename') ?>" <?php echo $this->getFieldParams() ?> />
            </div>
        </div>
    <?php endif; */?>

    <!--<div class="field name-lastname">
        <label for="<?php echo $this->getFieldId('lastname')?>" class="required"><em>*</em><?php echo $this->getStoreLabel('lastname') ?></label>
        <div class="input-box">
            <input type="text" id="<?php echo $this->getFieldId('lastname')?>" name="<?php echo $this->getFieldName('lastname')?>" value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>" title="<?php echo $this->getStoreLabel('lastname') ?>" maxlength="255" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('lastname') ?>" <?php echo $this->getFieldParams() ?> />
        </div>
    </div>-->

>

不知怎的,我成功了。这是我想要做的,我请求您尝试一下,并检查它是否解决了问题

  • 打开Magento DB并转到表core_config_data
  • 搜索路径-
    customer/address/middlename\u show
  • 编辑
    customer/address/middlename\u show
    的值字段,并将其更改为1。通常,默认情况下该值为0(零)
  • 保存表格
  • 清除缓存。最好删除var文件夹中的文件夹缓存和会话
  • 登录到Magento管理员并转到以下位置: 系统-->配置-->客户-->客户配置
  • 在“姓名和地址选项”选项卡下,现在“显示中间姓名(首字母)”选项将显示为“是”
  • 将其更改为“否”
  • 保存配置并清除缓存

  • 谢谢它将如何成为html+css的一部分?