I try to compile a list of all product URLs for a given store. Given $productCollection
prepared with store, status and visibility filter, this is how it works in Magento CE:
$catalogUrl = Mage::getResourceModel('catalog/url');
$select = $catalogUrl->getReadConnection()->select();
$select->from($catalogUrl->getMainTable(), array('request_path'));
$select->where('store_id = ?', (int)$storeId);
$select->where('product_id IN (?)', $productCollection->getAllIds());
$select->where('options IS NULL');
if (!Mage::getStoreConfig('catalog/seo/product_use_categories', $storeId)) {
$select->where('category_id IS NULL');
}
foreach ($catalogUrl->getReadConnection()->fetchCol($select) as $requestPath) {
$url = Mage::getBaseUrl('web') . $requestPath;
// do something with $url
}
But how would you achieve the same in Magento EE, where the standard URL rewrite table is not used for products?
Is there a unified solution that works independent of the URL model in CE and EE?