2013-08-18 52 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"}} 
相关问题