2013-10-18 37 views

回答

1

您需要創建小模塊。我不能在這裏分享完整的代碼,但分享你一個有用的鏈接,我以前使用過,工作正常。

鏈接:https://www.atwix.com/magento/products-list-cms/

希望這將幫助!

+0

是的,這對我的工作感謝 –

1

下創建yourtheme /目錄/產品模板(test.phtml)和下面的代碼添加到您的test.phtml

<?php 
    $arrParams = array_slice($this->getRequest()->getParams(),1); 
    $attribute = each($arrParams); 
    $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter($attribute[0],$attribute[1]); 
    echo '<pre>'; 
    print_r($collection->getData()); 
    exit; 
?> 

比稱這個模板到您的CMS頁面。在cms頁面的內容區域添加以下代碼。

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

一旦你有產品陣列,而不是按照你的要求顯示它。