2012-04-04 38 views

回答

1

要顯示暢銷書,你可以加載從資源模型報告的產品集合類似下面

$products = Mage::getResourceModel('reports/product_collection') 
      ->addOrderedQty() 
      ->addAttributeToSelect(array('name', 'price', 'small_image', 'short_description', 'description')) //edit to suit tastes 
      ->setStoreId($storeId) 
      ->addStoreFilter($storeId) 
      ->setOrder('ordered_qty', 'desc'); //best sellers on top 

,並加載它們種類明智的,你可以得到當前類別或傳遞harcoded。只需要過濾該類別中的產品。

+0

我是Magento Begnner.I想要在Magento 1.6.2.0的列表頁面中顯示特定類別的最佳賣家? Thnks Girish Anand – Teju 2012-04-05 05:11:49

+0

好的,您可以使用此擴展程序進行檢查(http://www.magentocommerce.com/magento-connect/bestseller-selected-on-category-id.html)...要顯示爲列表頁面,您需要創建模塊爲...你可以加我[email protected]我會幫你在那裏 – 2012-04-07 08:33:15

+0

謝謝Girish Anand – Teju 2012-04-09 05:09:56

相關問題