0

I want to load customer collection by email and mobile but not general group

for email load

 $customer = Mage::getModel("customer/customer")->loadByEmail($customerEmail);

for mobile

 $customer = Mage::getModel("customer/customer");
 $customerCollection = $customer->getCollection()
                       ->addAttributeToFilter('mobile', $query)
                       ->getFirstItem();    
 $entityId =  $customerCollection->getEntityId();     
2
  • You don't want to load general group customers? Commented Jul 20, 2017 at 13:32
  • No , i want only other group Commented Jul 20, 2017 at 13:33

2 Answers 2

0

Try this for exclude Genereal group customer.

$collection = Mage::getModel('customer/customer')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addFieldToFilter('group_id', array('neq'=>1));
0

try This below Code for mobile and customer group not general

$collection = Mage::getModel('customer/customer')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('mobile', $query)
->addFieldToFilter('group_id', array('neq'=>1));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.