0

最近閲覧した製品を顧客ごとに把握して、顧客が次回 Web サイトにアクセスしてログインできる場合に、最後に閲覧した製品を見つけられるようにしたい

私を助けてください

前もって感謝します

4

1 に答える 1

1

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>
于 2013-05-20T11:48:52.357 に答える