Magento 1.9 Community. Im trying to show a "From" next to price of configurable products in category/product view page. My template "Milano" has a file list.phtml for categories and i have changed the code to the following :
<?php if ($_product->isConfigurable()) { ?>
<div style="float:left;"><?php echo $this->__('From ') ?></div><?php echo $this->getPriceHtml($_product, true) ?>
<?php } else { ?>
<?php echo $this->getPriceHtml($_product, true) ?>
<?php } ?>
The problem is that the "from" is also visible to configurable products that they don't have different prices. I also used the next code that checks min and max
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$_product);
$childPriceLowest = "";
$childPriceHighest = "";
foreach($childProducts as $child){
$_child = Mage::getModel('catalog/product')->load($child->getId());
if($childPriceLowest == '' || $childPriceLowest > $_child->getPrice() )
$childPriceLowest = $_child->getPrice();
if($childPriceHighest == '' || $childPriceHighest < $_child->getPrice() )
$childPriceHighest = $_child->getPrice();
and added a the end the if childpricelowest = childpricehighest then show only price but the page goes white screen.
Perhaps someone can put the together correctly or give another solution?