2010-06-15 127 views
2

我是magento新手。我想要顯示magento前端的商品列表,其中包含顏色,尺寸,數量等屬性並添加到購物車選項,但首頁會顯示以下消息...如何在magento主頁上顯示產品

沒有與選擇匹配的產品。

我在網頁編輯器使用的波紋管代碼:

{{block type="catalog/product_list" category_id="3" template="catalog/product/list.phtml"}} 

回答

0

如果您收到此消息,這意味着有與ID類別沒有產品= 3 ...

刪除在部分CATEGORY_ID你的代碼和magento應該顯示所有產品。

0

進入目錄 - >管理類,從左側選擇類別和當您選擇類別,你會看到該類別的Magento的ID,並在主頁編輯器裏

{{block type="catalog/product_list" category_id="IdYOURCategory" template="catalog/product/list.phtml"}}

還要確保該類別不是空的。

+1

這個答案不是很清楚。請重寫它以完成並清除。 – 2012-10-20 14:45:04

0

如果你在這個magento中的新功能,這可能會幫助你。

在PHTML文件test.phtml

$collection = Mage::getModel('catalog/product')->getCollection();  
$collection->addAttributeToSelect('orig_price'); 

由所需的屬性獲取集合。然後,

{{block type="core/template" template="catalog/product/test.phtml"}} 

使用此代碼,它肯定會工作, :)

1

即使是正確的類別ID也你會得到同樣的消息。然後執行以下操作:

  1. 轉到系統>>索引管理並重新索引所有索引。
  2. 系統>>緩存管理點擊刷新magento緩存,然後你會得到產品。
0

轉到您的CMS->頁面,選擇您的主頁,並在內容粘貼此塊:

{{block type="catalog/product_list" category_id="category_id_to_show" column_count="number_of_columns" template="catalog/product/list.phtml"}} 

category_id_to_show:轉到目錄 - >管理類別,選擇您想要在您的主頁上顯示的那個,並將您的ID放在該塊上。

number_of_columns:多少列要顯示

希望這有助於;)

0

轉到您的CMS->頁面,選擇您的主頁,並在內容粘貼此塊:

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