1

I created 2 new product in backend that are not visible individually because I only want to use them for a particular order. But when I go in backend at Sale->Order->new order those products do not appear. Do I need to reindex the related catalog index or what am I doing wrong? Product is in stock and was an qty on invetory bigger than 0. I hope it's a faster solution because the reindex takes me ages - I have more than 150k products on my application. Any help is welcomed :)

0

You should not need to reindex everything since the admin does not use the flat tables. Maybe just reindex the stock to be sure.

protected function _prepareCollection()
{
    $attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
    /* @var $collection Mage_Catalog_Model_Resource_Product_Collection */
    $collection = Mage::getModel('catalog/product')->getCollection();
    $collection
        ->setStore($this->getStore())
        ->addAttributeToSelect($attributes)
        ->addAttributeToSelect('sku')
        ->addStoreFilter()
        ->addAttributeToFilter('type_id', array_keys(
            Mage::getConfig()->getNode('adminhtml/sales/order/create/available_product_types')->asArray()
        ))
        ->addAttributeToSelect('gift_message_available');

    Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($collection);

    $this->setCollection($collection);
    return parent::_prepareCollection();
}

If you don't see your products, it means that the product is not linked to the website for which you want to create the order, or the product is not in the allowed types. But by default all types are allowed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.