magento中目录url多层变成单层的方法

magento中目录url多层变成单成的方法,app/code/core/Mage/Catalog/Model/Url.php这个php文件,找到

if (null === $parentPath) {

$parentPath = $this->getResource()->getCategoryParentPath($category);

}

elseif ($parentPath == ‘/’) {

$parentPath = ”;

}

把上面的代码修改为:

//if (null === $parentPath) {
//$parentPath = $this->getResource()->getCategoryParentPath($category);
//}
//elseif ($parentPath == ’/') {
$parentPath = ”;
//}