we would like to check if products exists with the following code:
$foundProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
We only get positive results if "Use Flat Catalog Product" is disabled in the configuration.
we would like to check if products exists with the following code:
$foundProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
We only get positive results if "Use Flat Catalog Product" is disabled in the configuration.
Try using $_product = Mage::getModel('catalog/product')->load($productSku, 'sku');
instead of Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
the only working solution for both disabled and enabled products I found here: http://magentoexplorer.com/how-load-product-by-sku-or-id-in-magento
$_sku = 'leathershoes';
$_catalog = Mage::getModel('catalog/product');
$_productId = $_catalog->getIdBySku($_sku);
$_product = Mage::getModel('catalog/product')->load($_productId);
Just tested this on a category page, and it does work. On which page are u trying to do this, and in what code are you using $foundProduct?
Have you reindexed all indexes after enabling flat catalog? cleared all caches? Perhaps try to run the code with all caches disabled.