Sorry I was so vague. The var $collection was just a representation of any product collection. For that phtml file, you will find it’s corresponding block class in Mage/Catalog/Block/Product/List.php
Around line 60-64 (depending on which production version you are using) you will see an assignment to the instance variable this->_productCollection. The default statement is $layer->getProductCollection;
You need to add the addAttributeToSelect(’foo’) method call to that statement.
So it should look like this:
$this->_productCollection = $layer->getProductCollection()->addAttributeToSelect(’foo’);
or you could add it on the next line like this:
But the latter can only be used after the call to $layer requesting the collection.
That should do the trick.