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商店视图
- 3. Magento的商店 - 扩展
- 4. Magento的商店 - SQL错误
- 5. Magento:在商店代码Dash
- 6. 通过Api向其他Magento网站销售一个Magento商店的产品?
- 7. 用户无法通过光油登录Magento商店
- 8. Magento商店ID在cronjob
- 9. Magento;派遣多商店
- 10. 获取magento商店列表
- 11. Magento多商店SSL分享
- 12. magento多个商店视图
- 13. 更改Magento中商店的域名
- 14. 乳宁Mullti商店上的Magento
- 15. Magento:根据商店的程序搜索
- 16. Magento的每个商店的不同SKU
- 17. 如何获得Magento商店货币
- 18. 在多个Magento商店中使用BlueSnap
- 19. Magento只显示特定的商店
- 20. Magento - 如何获得商店的国家?
- 21. Magento的多商店网站问题
- 22. Magento商店中的Paypal IPN错误
- 23. Magento商店 - 扩展打破管理
- 24. 更新android APK未通过Play商店
- 25. 通过API部署到Google Play商店
- 26. 如何通过Windows商店发布DeskBand
- 27. Magento移动版商店切换逻辑
- 28. 将Magento客户限制在商店
- 29. 德国Magento网上商店设置
- 30. Magento商店卡在计费信息
死链接,以便关闭。 – Kev 2011-07-01 00:53:03