0

How do i get the collection with entity_id which the range between 1-3000?

ob_start();
foreach ($customers as $customer){
    $temp = $customer->load($customer->getId())->getData();
    echo $temp['entity_id']."<BR>";
    flush();
        ob_flush();
}

anyone knows?

3 Answers 3

5
Mage::getModel('customer/customer')->getCollection()
    ->addFieldToFilter('entity_id',array('gteq'=>1))
    ->addFieldToFilter('entity_id',array('lteq'=>3000))
1
  • My example: $orders = Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('increment_id', array('gt'=>$lastOrderEx)) ->addAttributeToFilter('increment_id', array('lteq'=>$lastOrderMagento));
    – jruzafa
    Feb 5, 2016 at 11:18
3

Try this.

$collection = Mage::getModel('customer/customer')->getCollection();
    $collection->addFieldToFilter('entity_id',
            array(array('from'=>'1','to'=>'3000')               
    ));
0

My example:

$orders = Mage::getModel('sales/order')->getCollection()
                    ->addAttributeToFilter('increment_id',  array('gt'=>$lastOrderEx))
                    ->addAttributeToFilter('increment_id',  array('lteq'=>$lastOrderMagento));
0

Your Answer

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

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