更新时间:2023-12-01 19:39:46
是的magento具有其默认功能
转到app/design/frontend/default/(yourtheme)/tempalte/reports
文件夹
Yes magento has its default functionality
Goto app/design/frontend/default/(yourtheme)/tempalte/reports
folder
如果您在主题中看不到该文件夹,只需将其复制并保存到主题文件夹中
If you cant see that folder in your theme, just copy it and save it to your theme folder
您可以使用以下代码在布局文件中显示
you can use the below code to display in layout files
<block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml" />
要在CMS页面(主页)中呼叫
To call in CMS pages (homepage)
{{block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml"}}
要调用phtml文件
<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->tohtml(); ?>