2012-01-19 24 views
0

我正在使用Magento 1.6.1.0。如何將下載文件添加到Magento上每個客戶的「我的可下載產品」部分?每個現有的和新的客戶在訪問他/她的賬戶時都應該看到這個文件。如何將下載文件添加到Magento上每個客戶的「我的可下載產品」部分?

+1

你可以發佈一些你已經試過的代碼嗎? –

+0

我是個開始,目前沒有任何代碼。 – user1008832

+1

好的,那你的想法是什麼?你能描述一下你的想法嗎? StackOverflow鼓勵用戶嘗試自己解決它,然後讓社區幫助,而不是提供整個解決方案... –

回答

1

這方面,只是把可下載的內容放到整個註冊客戶儀表板部分。客戶應該登錄後才能看到內容。但是,正如你可能是客人,這不是受保護的內容,如果他們知道鏈接,每個人都可以下載!

打開dashboard.phtml

# file : dashboard.phtml 
# path : app/design/frontend/[your_namespace]/[your_theme]/template/customer/account 
// put the following line after 'address' section 
<div class="download-links"> 
    <h4><?php echo $this->__('Download Manuals') ?></h4> 
</div> 
<?php echo $this->getChildHtml('downloadlinks') ?> 

打開customer.xml

# file : customer.xml 
# path : app/design/frontend/[your_namespace]/[your_theme]/layout/customer.xml 
// add the following line 
<block type="core/template" name="customer_manual_links" as ="downloadlinks」 template="downloadlinks/downloads.phtml"/> 

創建文件夾downloadlinks,把downloads.phtml

# file : downloads.phtml 
# path : app/design/frontend/[your_namespace]/[your_theme]/template/downloadlinks/ 
<span>Your downloadable manuals</span> 
<a href="">Product Catalog PDF</a><br/> 
<a href="">Product Manual PDF</a><br/> 
+0

Oğuz非常感謝你這個有價值的代碼。有沒有辦法將這個實現到客戶帳戶頁面的現有「我的可下載產品」部分? – user1008832

+0

@ user1008832在app/design/frontend/[namespace]/[theme]/layout /中檢查'downloadable.xml',你會看到一個定義了「我的可下載產品」區域的部分。負責「我的可下載產品」區域的文件是'list.phtml' –

+0

,您應該將'customer.xml'內容放入'downloadable.xml'文件中,然後修改'list.phtml'。 –

相關問題