I am using this code below:
<div class="feat-product">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('feat_products')->toHtml() ; ?>
</div>
<div id="products-recently-viewed" style="border-bottom:1px dashed #ccc; padding-bottom:10px;">
<?php echo $this->getChildHtml('upsell_products') ?>
</div>
At the moment you can see both blocks are being shown, I want to make it so only the feat_products always shows UNLESS there are products in the Upsell of the product which in that case I need it to not show the feat_products and ONLY show the upsell section.
Hope someone has stumbled across this before and can help out.
In PHP, you can embed conditionals and put html in the middle. For instance:
I am presuming that your getChildHtml function returns an empty string if there are no products. Tweak as needed…