In trying to solve this issue Ive read a few different articles, and ended up trying to output the Recently Viewed Products file in a variety of ways, and none of them seem to be working.
Here is the relevant bits in local.xml
:
<catalog_product_view>
<reference name="content">
<reference name="product.info">
<block type="reports/product_viewed" name="reports.product.viewed" template="reports/product_viewed.phtml"/>
<block type="core/template" name="reports.product.viewed2" template="reports/product_viewed.phtml"/>
</reference>
</reference>
</catalog_product_view>
I have these lines at the very top of reports/product_viewed.phtml
:
<pre>hello</pre>
<?php if ($_products = $this->getRecentlyViewedProducts()): ?>
This is how I am trying to output the recently viewed products in catalog/product/view.phtml
<hr>
<?php echo $this->getChildHtml('reports.product.viewed'); ?>
<hr>
<?php echo $this->getChildHtml('reports.product.viewed2'); ?>
<hr>
<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
<hr>
All of this outputs the following:
hello
Basically, the product_viewed
file only outputs anything when it is inserted as a core/template
block, but obviously it wont work properly unless its inserted as a reports/product_viewed
block. However the product_viewed
file wont render at all if its inserted as a reports/product_viewed
block.
This is the same if I have logged into an account or if I am viewing the site as a guest.
Refreshing the statistics in the Admin Panel made no difference.
This is in Magento 1.9.2.2.
Does anyone have and ideas as to why my reports/product_viewed
block wont render at all?