我有以下代码,我需要检查相关属性是客户属性还是客户地址属性。我如何检查?检查属性是客户属性还是客户地址属性
private $custom_columns = array();
public function __construct()
{
parent::__construct();
$this->setId('customerGrid');
$this->setUseAjax(true);
$this->setDefaultSort('email');
$this->setDefaultLimit('200');
$this->setSaveParametersInSession(true);
$attributeIds = Mage::getStoreConfig('sectionname/group/field');
$this->custom_columns = array($attributeIds);
}
$attributeIds
回属性代码像街道如果我选择街道地址,性别如果我选择性别等等。现在应该提出什么条件才能知道给定的属性是客户还是地址属性。
// Prepare Collection addition to store custom fields
foreach ($this->custom_columns as $col)
{
//Some Condition if its a Customer attribute
collection->addAttributeToSelect($col);
//else some condition if its a Customer address attribute
$collection->joinAttribute($col, "customer_address/$col", 'default_billing', null, 'left');
}
$this->setCollection($collection);
return parent::_prepareCollection();
}
我只是想知道那些条件会是什么。希望这个更清楚一点
很难理解你在问什么。请尝试清楚您的问题,并发布您已经尝试过的代码以及您收到的任何错误消息。 – rdlowrey 2011-12-16 15:33:09