开发者

Magento 1.4 - Get the quantity of most selling products

开发者 https://www.devze.com 2023-01-24 23:06 出处:网络
What is the php/magent开发者_开发技巧o code I can use to get the best selling products and display that name of the product.

What is the php/magent开发者_开发技巧o code I can use to get the best selling products and display that name of the product.

For example, say I've sold 10 Foos, 20 Bars and 50 Bazes. I want to know how to query the Magento system and have it say "Bazes" are the high selling products (with 50).

Thanks you


Reports are a little weird, as they're implemented using collections that don't have a parent model. Try the following

$c = Mage::getResourceModel('sales/report_bestsellers_collection');         
foreach($c as $item)
{
    var_dump($item->getData());
}


Magento admin already has this.

  • Go to the menu Reports > Products > Bestsellers.
  • Make the "From" date sometime in the past, like January 1st.
  • Make the "To" date today or sometime in the future.
  • Change "Show by" to "Year" and click Refresh.
0

精彩评论

暂无评论...
验证码 换一张
取 消