Skip to content

Indexer does not respect catalog/seo/product_use_categories config flag #19

Description

@drewgillson

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) {

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions