-
- Jellej

-
Total Posts: 7
Joined: 2011-06-19
|
So I found the solution to this problem by debugging.
Edit the file (or better yet, copy it to local folder) /app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php
Look for the following function public function getProductStatus($productIds, $websiteId, $stockId = 1)
You will see this
public function getProductStatus($productIds, $websiteId, $stockId = 1) { if (!is_array($productIds)) { $productIds = array($productIds); }
$select = $this->_getReadAdapter()->select() ->from($this->getMainTable(), array('product_id', 'stock_status')) ->where('product_id IN(?)', $productIds) ->where('stock_id=?', (int)$stockId) ->where('website_id=?', (int)$websiteId); return $this->_getReadAdapter()->fetchPairs($select); }
Change it to:
public function getProductStatus($productIds, $websiteId, $stockId = 1) { if (!is_array($productIds)) { $productIds = array($productIds); }
$select = $this->_getReadAdapter()->select() ->from('cataloginventory_stock_status', array('product_id', 'stock_status')) ->where('product_id IN(?)', $productIds) ->where('stock_id=?', (int)$stockId) ->where('website_id=?', (int)$websiteId); return $this->_getReadAdapter()->fetchPairs($select); }
|