我希望最近看到的产品客户明智,以便如果客户下次可以访问该网站并登录,他可以找到最近看过的产品
请帮帮我
先谢谢你
答案 0 :(得分:1)
我确信Magento已在块Mage_Reports_Block_Product_Viewed中执行此操作。
这可以添加到主页并使用模板app \ design \ frontend \ base \ default \ template \ reports \ home_product_viewed.phtml
主页“cms_index_index”的xml布局和帐户主页“customer_account_index”应如下所示:
<cms_index_index>
<reference name="content">
<block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new">
<action method="addPriceBlockType">
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</block>
</reference>
</cms_index_index>
<customer_account_index>
<reference name="my.account.wrapper">
<block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new">
<action method="addPriceBlockType">
<type>bundle</type>
<block>bundle/catalog_product_price</block>
<template>bundle/catalog/product/price.phtml</template>
</action>
</block>
</reference>
</customer_account_index>