Magento customer get by other attribute such as telephone

来源:互联网 发布:军事机构的因特网域名 编辑:程序博客网 时间:2024/06/10 20:07
$result = Mage::getModel('customer/customer')
              ->getCollection()
              ->addAttributeToSelect('rms_‌​id')
              ->addAttributeToFilter('rms_id',{Val})->load();


if (is_object($result)) {
    /* Logic */

}


Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('rms_id', 'youremailhere')->load();


You can get collection of customer through :

$collection = Mage::getModel('customer/customer')->getCollection();

Filter you collection according to attribute :

$collection->addAttributeToFilter('refcode', array('eq' => 1));

Mage::getModel('catalog/product')->loadByAttribute('sku', 'My Sku Value');

0 0