如何在产品详细信息页面上显示最近查看的产品列表 - Magento



我已经为magento使用了mobileshoppe主题,并尝试在产品详细信息页面上显示最近查看的产品列表,但有些它不起作用...

在目录中添加了以下代码.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>

下面的代码在应用程序\设计\前端\默认\移动商店\模板\目录\产品\视图.phtml

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

我已经尝试了默认主题的相同方法,但它也不起作用,任何人都可以帮助我解决这个问题吗?

谢谢。。。

在产品详细信息模板 (view.phtml( 上,您必须在要放置块的 xml 中更具体。请参阅下面的示例,在主题布局目录(app/design/frontend/your package/your theme/layout/local.xml(中使用 local.xml 来插入块。这是我正在处理的一个网站的示例。具有讽刺意味的是,我们在一致显示它时遇到了问题,我现在正试图弄清楚这一点,但这大部分时间都在工作!尝试在您的目录中更具体.xml它应该可以工作。xml在local.xml中,echo在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>

您能否将xml参考内容替换为左侧。

取而代之的是这个

  <reference name="content">

在下面使用并检查

  <reference name="left">

由于它是侧边栏的一部分,因此它应该适用于您想要在页面中显示的左/右列。

干杯!

相关内容

最新更新