I have collection, so if I used $collection->getSelect() to view the query and run directly in mysql it give me right result but id I used to see total result using $collection->count() then it is not giving the right result.

So count used the load() function because of that my gird view do not have filter result which should be.

Can any one help me around it what is happening here?

Even I call the select query after the loading ($collection->load()) the collection, still query is right but collection result are wrong.


I got the answer for this, collection was already loaded before I added the filter. This was happening through an event. SO if someone facing same issue then check collection should not loaded before filter.

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.