最近閲覧した製品を顧客ごとに把握して、顧客が次回 Web サイトにアクセスしてログインできる場合に、最後に閲覧した製品を見つけられるようにしたい
私を助けてください
前もって感謝します
最近閲覧した製品を顧客ごとに把握して、顧客が次回 Web サイトにアクセスしてログインできる場合に、最後に閲覧した製品を見つけられるようにしたい
私を助けてください
前もって感謝します
Mage_Reports_Block_Product_Viewed ブロックで Magento が既にこれを行っていると確信しています。
これはホームページに追加でき、テンプレート 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>