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?

5
Mage::getModel('customer/customer')->getCollection()
    ->addFieldToFilter('entity_id',array('gteq'=>1))
    ->addFieldToFilter('entity_id',array('lteq'=>3000))
  • My example: $orders = Mage::getModel('sales/order')->getCollection() ->addAttributeToFilter('increment_id', array('gt'=>$lastOrderEx)) ->addAttributeToFilter('increment_id', array('lteq'=>$lastOrderMagento)); – jruzafa Feb 5 '16 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));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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