We use a custommenu.phtml to show recently view items via a popup block.
<div id="pt_menu_pt_item_menu_4" class="pt_menu"> <div class="parentMenu"> <span class="block-title">Recently Viewed</span> </div> <div id="popup_pt_item_menu_4" class="popup cmsblock" style="display: none;"> <div class="block3" id="block2_pt_item_menu_4"> <div> <?php echo $this->getLayout()->createBlock('reports/product_widget_viewed')->setTemplate('reports/widget/viewed/content/viewed_grid.phtml')->toHtml(); ?> </div> </div> </div> </div>
Everything works great except we do not need the whole
<div>to show when these is no recently viewed product.
I tried wrapping the whole
div with the following:
<?php if ($_products = $this->getRecentlyViewedProducts()): ?> <?php endif>
but the whole
div disappears whether we have viewed products or not.
How do I achieve this?