The problem with getLoadedProductCollection()
is it's already loaded - the products' data has already been retrieved from the database. Just using the current category's product collection isn't good enough either, that will ignore the "layers" (attribute filters). The trick is to remove the loaded products from the list first.
// First make a copy, otherwise the rest of the page might be affected!
$_productCollection = clone $this->getLoadedProductCollection();
// Unset the current products and filter before loading the next.
$_productCollection->clear()
->addAttributeToFilter('type_id', 'configurable')
->load();
print_r($_productCollection)
has it's issues too, you're not just outputting the products but also all details of the resource that is the database connection, and cached values, and the products' individual resources, and so on...
In this case I think you would be happier with:
print_r($_productCollection->toArray())
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…