سؤال

I want to how recently viewed products on home page in magento. Currently I am using below code but this is now working. so please help!!

getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
هل كانت مفيدة؟

المحلول

Did you forget to echo?

    <?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>

By the way if you're doing it from the CMS you need to use:

{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top