When viewing a Product Detail, I’d like to be able to display thumbnails of all the products from the viewed product’s “deepest” category. That is, if Product p is in Category l0 > l1 > l2, I’d like to get the collection of all products in category l2 and display their thumbnails on p‘s detail page.
I’ve successfully been able to get the basic collection of those products in the deepest assigned category:
$_categories = $_product->getCategoryIds();
$_greatestCat = count($_categories) - 1;
$_category = Mage::getModel('catalog/category')->load($_categories[$_greatestCat]);
Then I simply call the Product List block that gets used in Category View. I basically get the correct thumbnails. The problem is that it will only display the number of products set by the current session per-page limit. If I add set the limit to ‘all’ using the key/value pair in the URL—as in http://mysite.com/l0/l1/l2/the-product?limit=all, then the thumbnails for all the products show up, the way I want.
How can I get the block to display all the products in the collection without resetting the session’s limit used in the normal Category View—either explicitly or with a URL-passed parameter?