中的注册字段我想从注册(/ customer/account/create /)中删除字段。我怎样才能做到这一点? 有没有进入商店的文件(例如隐藏这些字段)的某种方式?Magento 1.7 - 删除/ customer/account/create/
1
A
回答
2
您应该更新数据库中的一些字段。
例如。我需要从注册表中删除姓氏。这是一个需要考虑的领域。 因此,我创建自己的模块与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
UPDATE:
编辑文件/应用程序/设计/前端/默认/ YOURTHEME /模板/客户/ widge t/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>-->
而且你可以一些类添加到<div class="field name-middlename">
和<div class="field name-lastname">
。这个类应该有css属性"display:none;"
。
3
不知何故,我得到它的工作。这是我想要的,我要求你尝试一下并检查它是否解决了这个问题。
- 打开Magento DB并转到表core_config_data。
- 寻找路径 -
customer/address/middlename_show
。 - 编辑值字段为
customer/address/middlename_show
并将其更改为。通常情况下,默认情况下这将是0(零)。 - 保存表格。
- 清除缓存。最好删除var文件夹中存在的文件夹Cache和Session。
- 登录到Magento管理并转到以下位置: 系统 - >配置 - >客户 - >客户配置
- 在“名称和地址选项”标签,现在“展中的选项名称(初始)“将显示为”是“。
- 将其更改为“否”。
- 保存配置并清除缓存。
相关问题
- 1. Magento的1.7 - 从URL
- 2. URL重写Magento的1.7
- 3. 删除在Magento
- 4. Magento 1.7 - 调试isAvailable
- 5. Magento 1.7 - 覆盖system.xml
- 6. 删除magento订单
- 7. Magento 1.7产品重新导入问题
- 8. 如何删除电子邮件验证在Magento 1.7管理员区
- 9. Magento 1.7 /如何在开始输入时删除“这是必填字段”?
- 10. Magento从1.5升级到1.7
- 11. Magento模块开发1.7
- 12. 如果Magento的数据库被删除
- 13. magento删除我的账户
- 14. Magento Wishlist - 删除项目
- 15. 从magento中删除Index.php
- 16. Magento删除数据库
- 17. Magento删除积分备忘
- 18. Magento 1.7导入/导出挂载
- 19. Magento没有从1.3.2.4升级到1.7
- 20. 如何加快Magento的1.7收藏
- 21. Magento的1.7:致命错误getBackend()
- 22. Magento 1.7 page.xml多次使用块元素
- 23. Magento 1.7无法发送标题;在
- 24. Magento 1.7 CSV更新产品类别
- 25. 如何将Magento从1.7升级到1.9
- 26. Cron作业禁用产品Magento 1.7 CE
- 27. 应用补丁magento 1.7.x失败
- 28. Magento的CE 1.7定时任务援助
- 29. Magento 1.7:top.phtml文件位于何处?
- 30. Magento 1.7无法保存upsell产品
谢谢!以及它将如何成为html + css的一部分? – 2013-02-24 10:24:28
我更新了我的答案 – Anthony 2013-02-24 12:27:14
感谢您的帮助。 – 2013-02-24 15:54:35