I want to show a custom_attribute of a simple product only.
I need this on the home page.
I want to foreach loop the 10 highest priced configurable products and show the lowest priced simple product custom_attribute
I can do it on the product page itself with its own simple products just fine with the following:
if($_product->getTypeId() == "configurable"): ?>
<?php
$childIds=Mage::getResourceSingleton('catalog/product_type_configurable')
->getChildrenIds($_product->getId());
$simple_collection=Mage::getResourceModel('catalog/product_collection')->
addAttributeToFilter('entity_id', array('in' => array_values($childIds[0])))
->addAttributeToSelect('*')->addAttributeToSort('price', 'asc');
// add in stock to collection
$cond = array(
'{{table}}.use_config_manage_stock = 0 AND {{table}}.manage_stock=1 AND {{table}}.is_in_stock=1',
'{{table}}.use_config_manage_stock = 0 AND {{table}}.manage_stock=0',
);
$cond[] = '{{table}}.use_config_manage_stock = 1 AND {{table}}.is_in_stock=1';
$simple_collection->joinField(
'inventory_in_stock',
'cataloginventory/stock_item',
'is_in_stock',
'product_id=entity_id',
'(' . join(') OR (', $cond) . ')'
);
foreach($simple_collection as $simple_product){
echo $sample_attribute
echo $sample_attribute_2
}