In magento, how does one remove the URL key with the parent category from the URL address of the subcategory?

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.