I want to get count after the collection filter by attributes.Actually i want filter order collections by non canceled ,non fraud
' and use getSize()
function to get count but it is given count result
as when any filters not applied
.
Please suggest what i do in this case
to get proper result of count.I have order 630 and when i use count()
function on collection filter it give proper result.
$orderCollection = Mage::getModel('sales/order')->getCollection();
echo $orderCollection->getSize().'---'; // Result 630
//$orderCollection->addFieldToFilter('customer_id',$customer->getId());
$orderCollection->addFieldToFilter('state', array('nin' => array('pending_payment', 'canceled', 'fraud', 'payment_review', 'pending', 'pending_paypal', 'closed')));
echo $orderCollection->size(); // result give 630
echo $orderCollection->count(); // given 305 proper result.
I guess that may load() function is working for getCount()
that why it is ok.
I have check the link Difference between getSize() and count() on collection
My question, is my concept is right?