如何在产品详细信息页面上显示最近查看的产品列表-magento [英] how to display recently viewed products list on product details page - magento

查看:125
本文介绍了如何在产品详细信息页面上显示最近查看的产品列表-magento的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将mobileshoppe主题用于magento,并尝试在产品详细信息"页面上显示最近查看的产品列表,但是有些方法不起作用...

I have used mobileshoppe theme for magento and trying to display recently viewed product list at product details page but some how its not working...

在下面的catalog.xml中添加了代码

Added code below at catalog.xml

<catalog_product_view translate="label">
<reference name="content">
<block type="reports/product_viewed" name="product.recently.viewed" as="product_recently_viewed" template="reports/product_viewed.phtml"/>
</reference>
</catalog_product_view>

及以下代码位于app \ design \ frontend \ default \ mobileshoppe \ template \ catalog \ product \ view.phtml

and below code at app\design\frontend\default\mobileshoppe\template\catalog\product\ view.phtml

<?php echo $this->getChildHtml('product_recently_viewed') ?>

我已经尝试过使用默认主题进行同样的操作,但是它也无法正常工作,有人可以帮助我弄清楚这个问题吗?

I have tried the same with default theme and its also not working, can any one help me to figure out this issue ?

谢谢...

推荐答案

在产品详细信息模板(view.phtml)上,您必须在要放置块的xml中更具体.请参阅下面的示例,在主题布局目录(app/design/frontend/您的程序包/您的theme/layout/local.xml)中使用local.xml插入该块.这是我正在研究的站点中的一个示例.具有讽刺意味的是,我们一直无法正常显示它,我现在正在尝试解决这个问题,但这在大多数情况下都是有效的!尝试在您的catalog.xml中更具体,它应该可以工作. xml在local.xml中,回显在catalog/product/view.phtml

On the the product detail template (view.phtml) you have to be more specific in the xml where you want to place the block. See the example below using local.xml in the theme layout directory (app/design/frontend/your package/your theme/layout/local.xml) to insert the block. Here's an example from a site I'm working on. Ironically we are having problems with it displaying consistently, which I'm trying to figure out right now, but this is working most of the time! Try getting more specific in your catalog.xml and it should work. The xml is in local.xml, the echo is in catalog/product/view.phtml

<?php echo $this->getChildHtml('recently_viewed') ?>

<catalog_product_view> 
<reference name="content"> 
    <reference name="product.info">
        <block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml" as="recently_viewed" />
    </reference>
</reference>

这篇关于如何在产品详细信息页面上显示最近查看的产品列表-magento的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆