2013-10-09 79 views
2

我已經使用mobileshoppe主題Magento的,並試圖顯示在產品詳細信息頁面最近查看的產品列表中,但一些如何它不工作...如何顯示產品的詳細信息頁面上最近瀏覽的產品列表 - Magento的

添加的代碼低於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> 

,並在下面的應用程序\設計\前臺\ DEFAULT \ mobileshoppe \模板\目錄\產品\ view.phtml

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

我的代碼已經嘗試過與默認主題相同,但它也不工作,任何人都可以幫助我找出這個問題嗎?

謝謝...

回答

0

您能否將xml參考內容替換爲左側。

反而低於這個

<reference name="content"> 

使用的時間並

<reference name="left"> 

由於它是側邊欄,所以應該用左/右列的工作,只要你想在頁面中顯示的一部分。

乾杯!

2

在產品詳情模板(view.phtml)上,您必須在希望放置塊的xml中更具體。在主題佈局目錄(app/design/frontend/package/your theme/layout/local.xml)中使用local.xml來查看下面的示例來插入塊。以下是我正在從事的一個網站的示例。具有諷刺意味的是,我們遇到的問題始終如一,我現在正試圖弄清楚,但大部分時間都是這樣的!嘗試在catalog.xml中獲得更具體的內容,它應該可以工作。所述XML是在那個local.xml,回聲是在目錄/產品/ 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> 

相關問題