2014-09-02 48 views
0

我試圖將最近查看的產品顯示在產品頁面下的銷售。最近查看過的產品沒有顯示

thisthis問題,我補充說:

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

app/design/frontend/base/default/layout/catalog.xml文件,我說:

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

略低於

<?php echo $this->getChildHtml('upsell_products') ?> 
app/design/frontend/base/default/template/catalog/product/view.phtml文件

,但沒有最近查看的產品w生病了。我最近看過的產品不會顯示什麼錯誤?

回答

0

您的佈局文件改成這樣:

<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> 

像你現在擁有它這個然後添加到您的view.phtml文件。

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

更改它在佈局文件中的位置 – Howli 2014-09-02 16:51:04

0

除了默認句柄,每個頁面都有一個句柄,用於所有頁面。

所以首先你需要添加你的區塊,該句柄(你這樣做是local.xml中)

如上評論指出:

相關的XML節點來阻止

這會導致您的塊作爲目錄產品視圖頁面的內容塊的子項。 現在getChildHtml('product_recently_viewed')?>會爲你做。

+0

我將什麼句柄塊添加到local.xml文件,其中local.xml文件在哪裏? – Howli 2014-09-10 15:48:16

+0

在.xml中搜索,您將瞭解要編寫什麼以及在哪裏編寫.standard將在local.xml或layout xml文件中編寫 – oscprofessionals 2014-09-11 17:01:24

相關問題