You may find thatMagento System DevelopmentIn the mall, the URL address of the subdirectory contains the URL key of the upper-level directory by default. If the URL of a parent directory named fathercategory is http://ttmei8.taobao.com/fathercategory/subcategory /. To remove the URL key of the parent directory in the subdirectory, modify the following code.
Open the PHP file APP/code/CORE/MAGE/CATALOG/model/url. php, go to line 3, and modify the code.
If (null ===$ parentpath ){
$ Parentpath = $ this-> getresource ()-> getcategoryparentpath ($ category );
}
Elseif ($ parentpath = '/'){
$ Parentpath = '';
}
Is
// If (null ===$ parentpath ){
// $ Parentpath = $ this-> getresource ()-> getcategoryparentpath ($ category );
//}
// Elseif ($ parentpath = '/'){
$ Parentpath = ''; // ('This sentence does not need to be commented ')
//}
Save and upload the file.