2

So I'm trying to build a 'Bestseller list' on our homepage. Currently the bestseller list is only showing the top selling simple products. All these simple products are child products of different configurable products.

So to visualise my problem, this is my current bestseller list

  • Simple product 59589 - Child product of configurable product 30

  • Simple product 234 - Child product of configurable product 56

  • Simple product 80085 - Child product of configurable product 30

  • Simple product 666 - Child product of configurable product 56

What I want is for this list to look like this:

  • Configurable product 30

  • Configurable product 56

I currently have the following code:

 $cat = Mage::getModel('catalog/category')->load(13);
 $_productCollection = Mage::getResourceModel('reports/product_collection');
 $_productCollection->addOrderedQty();
 $_productCollection->addAttributeToSelect('*');
 $_productCollection->addCategoryFilter($cat);
 $_productCollection->setOrder('ordered_qty', 'desc'); 
 $_productCollection->setPageSize(6)->setCurPage(1); 

I have no idea how to go from here. The only thing I can think of is loading all products and doing a while loop?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.