1
A
回答
1
(鏈接已經死了。似乎是現在的工作。)
我不是專家,但,但我相信你想一個過濾器添加到產品收集。
在行:
$products = Mage::getResourceModel('reports/product_collection')
->addOrderedQty()
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId);
您想添加一個過濾器類別。我假設你正在尋找一個靜態類別,而不是來自上下文或用戶輸入的動態內容。下面的代碼替換上面的代碼 - 從類別編號中加載類別對象,然後應用過濾器。我認爲它應該工作。
$catNum = 7; //The number of the category you want to load
$category = Mage::getModel('catalog/category')->load($catNum);
$products = Mage::getResourceModel('reports/product_collection')
->addOrderedQty()
->addAttributeToSelect('*')
->setStoreId($storeId)
->addStoreFilter($storeId)
->addCategoryFilter($category);
0
的主頁上最暢銷的產品,請訪問這個 http://inchoo.net/ecommerce/magento/bestseller-products-in-magento/
相關問題
- 1. 通過.htaccess運行Magento商店
- 2. Magento商店URL
- 3. 如何通過商店ID在PHP數組中獲取Magento商店詳情?
- 4. magento商店視圖
- 5. Magento的商店 - 擴展
- 6. 通過專賣店在Magento
- 7. Magento的商店 - SQL錯誤
- 8. Magento:在商店代碼Dash
- 9. 通過Api向其他Magento網站銷售一個Magento商店的產品?
- 10. 用戶無法通過光油登錄Magento商店
- 11. 如何通過Magento商店獲取CMS頁面標題?
- 12. Magento - 我如何通過GeoIP按國家/地區運行商店?
- 13. Magento刪除默認商店視圖的商店代碼
- 14. magento多個商店視圖
- 15. 如何獲得magento商店?
- 16. Magento商店ID在cronjob
- 17. Magento商店相關文本
- 18. Magento多商店SSL分享
- 19. 按部門在magento商店
- 20. Magento;派遣多商店
- 21. 獲取magento商店列表
- 22. Magento商店返回URL
- 23. 更改Magento中商店的域名
- 24. 乳寧Mullti商店上的Magento
- 25. Magento:同一商店下的不同商店視圖中的不同產品?
- 26. magento apis用於創建網站,商店和商店視圖
- 27. magento商店的多個網址?
- 28. Magento:根據商店的程序搜索
- 29. Magento的每個商店的不同SKU
- 30. 如何獲得Magento商店貨幣
死鏈接,以便關閉。 – Kev 2011-07-01 00:53:03