Magento SEO - 子类别网址没有父类别

use*_*643 2 url seo root magento categories

我正在使用Magento 1.8,我想要没有父/根类别的子类别url,或者希望每个url都在root上,而不需要重定向.

例如

Appreal - >女性

  1. 上衣
  2. 下装

Appreal - > Men

  1. 甲缩醛
  2. 临时工

现在我想要网址: 女人

mysite.com/womens.html而不是mysite.com/appreals/womens.html

上衣

mysite.com/tops.html而不是mysite.com/appreals/womens/tops.html

甲缩醛

mysite.com/formals.html而不是mysite.com/appreals/mens/formals.html

默认Magento 1.8中是否有任何设置来实现此目的?

Mag*_*ary 6

打开课程Mage_Catalog_Model_Url并评论以下行

//if (null === $parentPath) {
//    $parentPath = $this->getResource()->getCategoryParentPath($category);
//}
//elseif ($parentPath == '/') {
    $parentPath = '';
//}
Run Code Online (Sandbox Code Playgroud)

在功能下 getCategoryRequestPath($category, $parentPath)

并重新索引目录URL重写索引管理.

您应该覆盖getCategoryRequestPath()本地codePool中的函数.