I have my upsells in a block on my product page as default but I would like to display a message or custom block in the same position as my upsells would go if a product has no upsells products ie "sorry this product has no upsell products".
This is my current upsell.phtml file
<div class="upsells">
<?php if(count($this->getItemCollection()->getItems())): ?>
<h2><?php echo $this->__('You might also like') ?></h2>
<?php // $this->setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
<?php $this->resetItemsIterator() ?>
<?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
<ul>
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
<?php if($_link=$this->getIterableItem()): ?>
<li>
<a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_link->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(225) ?>" alt="<?php echo $this->escapeHtml($_link->getName()) ?>" /></a>
<h3 class="upsell-name"><a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_link->getName()) ?>"><?php echo $this->escapeHtml($_link->getName()) ?></a></h3>
</li>
<?php else: ?>
<div class="empty">Sorry we couldn't find any products simular to this</div>
<?php endif; ?>
<?php endfor; ?>
<?php endfor; ?>
</ul>
<?php endif ?>
</div><!-- end upsells -->
Thankyou.