1
我期待將所有客戶地址屬性加入到完整客戶集合中。將所有地址詳細信息加入到客戶集合中
$collection = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
$collection->joinField('is_active', 'customer/address', 'is_active','parent_id=entity_id');
給了我致命的錯誤:
Mage_Core_Exception: Can't retrieve entity config: customer/address in /app/Mage.php on line 563
由於我使用的是企業,我們必須添加客戶地址屬性的能力,所以採用加盟的具體地址屬性的方法是不一樣令人滿意在這段代碼片段中:
$collection->addNameToSelect()
->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left')
任何想法?謝謝。