我想明智地了解客户最近查看的产品,这样如果客户下次可以访问该网站并登录,他就可以找到最后看到的产品
请帮我
先感谢您
我确信 Magento 已经在 Mage_Reports_Block_Product_Viewed 块中执行此操作。
这可以添加到主页并使用模板 app\design\frontend\base\default\template\reports\home_product_viewed.phtml
主页“cms_index_index”和帐户主页“customer_account_index”的 xml 布局应类似于:
<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>