Php Magento 1.8-隐藏字段-我的方法可以接受吗?
我想在客户帐户仪表板中隐藏“公司”字段(不要问为什么) 我发现地址是在这里生成的:Php Magento 1.8-隐藏字段-我的方法可以接受吗?,php,magento,Php,Magento,我想在客户帐户仪表板中隐藏“公司”字段(不要问为什么) 我发现地址是在这里生成的: /app/code/core/Mage/Customer/Model/Customer.php 我创建了一个本地版本来覆盖核心文件,然后将公共函数getAddressCollection()更改为以下内容: public function getAddressesCollection() { if ($this->_addressesCollection === null) { $
/app/code/core/Mage/Customer/Model/Customer.php
我创建了一个本地版本来覆盖核心文件,然后将公共函数getAddressCollection()
更改为以下内容:
public function getAddressesCollection()
{
if ($this->_addressesCollection === null) {
$this->_addressesCollection = $this->getAddressCollection()
->setCustomerFilter($this)
//->addAttributeToSelect('*')
->addAttributeToSelect('prefix')
->addAttributeToSelect('firstname')
->addAttributeToSelect('middlename')
->addAttributeToSelect('lastname')
->addAttributeToSelect('suffix')
->addAttributeToSelect('street')
->addAttributeToSelect('city')
->addAttributeToSelect('country_id')
->addAttributeToSelect('region')
->addAttributeToSelect('region_id')
->addAttributeToSelect('postcode')
->addAttributeToSelect('telephone')
->addAttributeToSelect('fax')
->addAttributeToSelect('vat_id')
->addAttributeToSelect('vat_is_valid')
->addAttributeToSelect('vat_request_id')
->addAttributeToSelect('vat_request_date')
->addAttributeToSelect('vat_request_success');
foreach ($this->_addressesCollection as $address) {
$address->setCustomer($this);
}
}
return $this->_addressesCollection;
}
我注释掉了addAttributeToSelect('*')
,并将其替换为除公司之外的所有客户地址属性
这可以接受吗?它是有效的,但我想知道它是否会有任何明显的负面影响
谢谢为什么要隐藏该字段?;-)为什么要隐藏该字段?;-)