magento - How to get a correct result of a model getSize() after a getSelect()->limit() -


hello,

currently, try create custom advanced search in order show x specific products.

when model filtered , more number expected, limit them :

$collection->getselect()->limit(x); $collection->load(); 

if check count($collection), without surprise x. but, if check $collection->getsize(), exact previous number as if hadn't done limit(x).

is there way "force" getsize() consider limit, or way limit product collection in order correct size ?

thanks time,

ps:

  • tried $collection->setpage(0,x)

  • tried $collection->setpagesize(x)->setcurpage(1);

  • i use singleton of mage_catalogsearch_model_advanced rewrited

  • this singleton collection filtered addfilters() , work expected.

i think need use: $collection->count();


Comments