join query with lowstock products with another table in magento
- by muralikalpana
I want to display some attributes in reports/products/lowstock grid. here how can i join another table with lowstock product id?
here is the query
/** @var $collection Mage_Reports_Model_Resource_Product_Lowstock_Collection */
$collection = Mage::getResourceModel('reports/product_lowstock_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
->filterByIsQtyProductTypes()
->joinInventoryItem('qty')
->joinInventoryItem('low_stock_date')
->useManageStockFilter($storeId)
->useNotifyStockQtyFilter($storeId)
->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);
here i have to join with this productid with another table. i am not getting results if i use this query.
$collection->getSelect()->join(array('t2' => 'lowstockorders'),'lowstock_inventory_item.product_id = t2.product_id','t2.product_id');
please anybody tell me how to join these tables
thanks,
murali