EcomDev_UrlRewrite icon indicating copy to clipboard operation
EcomDev_UrlRewrite copied to clipboard

Indexer does not respect catalog/seo/product_use_categories config flag

Open drewgillson opened this issue 10 years ago • 0 comments

Hi Ivan, just wanted to let you know I've found and fixed a small issue with this extension. The problem is that even if an administrator has their product_use_categories flag set to No, the indexer will create URL rewrites that look like /some/category/product.html anyways.

I made the following change in EcomDev_UrlRewrite_Model_Mysql4_Indexer::_generateProductRequestPathIndex to correct the problem:

        // Initialize rewrite request path data
        $step = array(false);
        if (Mage::getStoreConfig(Mage_Catalog_Helper_Product::XML_PATH_PRODUCT_URL_USE_CATEGORY, Mage::app()->getStore()->getStoreId())) {
            $step[] = true;
        }

        foreach ($step as $categoryRewriteFlag) {

...instead of

        foreach (array(false,true) as $categoryRewriteFlag) {

drewgillson avatar Nov 25 '14 05:11 drewgillson