2013-08-18 53 views
0

我設法按類別一起展示新產品和產品的這些如何顯示在我的主頁的所有產品在Magento 1.7

{{塊型=「目錄/ product_new」 COLUMN_COUNT =「6」 products_count =」 3" 名稱= 「home.catalog.product.new」 別名= 「PRODUCT_HOMEPAGE」 模板= 「目錄/產品/ new.phtml」}}

{{塊類型= 「目錄/所屬類別」 CATEGORY_ID =」 10「 template =」catalog/product/list.phtml「}}

但我真的希望在我的商店中顯示整個產品,而不管它們的類別是否可能?

我的根類別ID是3,所以我試圖與這條線,但沒有運氣可言,

{{塊類型= 「目錄/所屬類別」 CATEGORY_ID = 「3」 模板=「目錄/ product/list.phtml「}}

任何想法?

我使用的樣本數據來測試Magento的,所以我必須低於這個數據,

Root Catalog (0) 
    Furniture (7) 
    Electronics (42) 
    Apparel (66) 

編輯:

home.phtml

<?php 
/** 
* Magento 
* 
* NOTICE OF LICENSE 
* 
* This source file is subject to the Academic Free License (AFL 3.0) 
* that is bundled with this package in the file LICENSE_AFL.txt. 
* It is also available through the world-wide-web at this URL: 
* http://opensource.org/licenses/afl-3.0.php 
* If you did not receive a copy of the license and are unable to 
* obtain it through the world-wide-web, please send an email 
* to [email protected] so we can send you a copy immediately. 
* 
* DISCLAIMER 
* 
* Do not edit or add to this file if you wish to upgrade Magento to newer 
* versions in the future. If you wish to customize Magento for your 
* needs please refer to http://www.magentocommerce.com for more information. 
* 
* @category design 
* @package  base_default 
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) 
* @license  http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 
*/ 
?> 
There was no Home CMS page configured or found. 
+1

閱讀這篇文章可能對您有幫助http://www.magentocommerce.com/boards/viewthread/19173/ –

回答

1

你可以編輯您的home.phtml文件並手動獲取產品

$products = Mage::getModel('catalog/category')->load($your_category_id) 
->getProductCollection() 
->addAttributeToSelect('*') 
->addAttributeToFilter(
    'status', 
    array('eq' =>'1') 
); 

而對於所有的產品,你可以做到這一點

$products = Mage::getModel('catalog/category') 
->getProductCollection() 
->addAttributeToSelect('*') 
->addAttributeToFilter(
    'status', 
    array('eq' =>'1') 
); 
+0

感謝您的回答! – laukok

+0

對不起,我在哪裏可以找到'home.phtml'?似乎magento默認不會加載'home.phtml' ... – laukok

+0

我找到了家。但沒有任何內容,並且magento不能加載回家。phtml默認 - 看起來! – laukok

1
+0

一個潛在的解決方案的鏈接總是受歡迎的,但請[添加鏈接上下文](http://meta.stackoverflow.com/a/8259/169503),以便您的同行用戶將有一些想法是什麼以及爲什麼在那。如果目標網站無法訪問或永久離線,請始終引用重要鏈接中最相關的部分。考慮到_barely不僅僅是一個鏈接到外部網站_是一個可能的原因[爲什麼和如何刪除一些答案?](http://stackoverflow.com/help/deleted-answers)。 –

1
  1. 步驟1最佳視頻教程:登錄到您的Magento管理儀表板;
    1. 第2步:轉到:CMS - > Pages - >然後選擇Home Page;
    2. 第3步:現在您必須看到將應用於主頁的一些編輯選項。
    3. 步驟4:轉到:Contet Tab from left;
    4. 第5步:添加下面的代碼片段在WYSIWYG(之爲知之爲「你看到的就是你得到」)

;

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}} 
相關問題