views:

260

answers:

0

How can i create my own productCollection from the scratch. So i have a list of products and from those products to creaete collection. Or i need the second variant, if i take the collection with all the products $products = Mage::getModel('catalog/product'); how can i filter them by the ID.

What i am trying to do is override the search in magento, and i want for the result to be my collection. 2nd. Hmm, how can i get a collection of all, i mean all products in magento.

P:S

I managed to do this,

$allowProductTypes=array();
         $collection = Mage::getResourceModel('catalog/product_collection');
         foreach (Mage::getConfig()->getNode('global/catalog/product/type/grouped/allow_product_types')->children() as $type) {
            $allowProductTypes[] = $type->getName();
        }

    $collection = Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToSelect('*')
        ;

and wit it i get all the products. now i want to select only couple of them with the wanted ID. for example the list of ids 16,17,18.... and only those.

P.P.S i have found solution for the IDs ->addIdFilter() option on collection.