/** * Return image url for product * @param <type> $product * @return <type> */ protected function getImageUrl($product) { if ($product->getSmallImage()) { return Mage::getBaseUrl('media') . DS . 'catalog' . DS . 'product' . $product->getSmallImage(); } else { //try to find image from configurable product $configurableProduct = Mage::helper('SimpleBarcodeInventory/ConfigurableAttributes')->getConfigurableProduct($product); if ($configurableProduct) { if ($configurableProduct->getSmallImage()) { return Mage::getBaseUrl('media') . DS . 'catalog' . DS . 'product' . $configurableProduct->getSmallImage(); } } } return ''; }