【问题标题】:Custom customer file attribute自定义客户文件属性
【发布时间】:2013-01-09 11:46:40
【问题描述】:
【问题讨论】:
标签:
php
magento
magento-1.7
【解决方案1】:
您可以加载客户集合,告诉它选择所有属性(或者如果您知道属性代码,请使用它),然后按客户 ID 过滤...
$customerId = 1;
$customer = Mage::getModel('customer/customer')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('entity_id', array('eq' => $customerId))
->getFirstItem();
// There may be a better way, but i've found that using the collection method returns all attributes easily.
var_dump($customer);
die();
从 var_dump 中,你应该能够看到你想看到的属性,然后它只是调用...
$myAttributeName = Mage::getModel('customer/customer')->load(185)->getMyAttributeCode()->getName();