Monday, 22 October 2012

How to remove parent category path from sub category url in Magento



Go to app/code/core/Mage/Catalog/Model/

Open Url.php and find -> getCategoryRequestPath($category, $parentPath)

Then comment some lines:-

//if (null === $parentPath) {
//$parentPath = $this->getResource()->getCategoryParentPath($category);
//}
//elseif ($parentPath == '/') {
$parentPath = ''; //('Don't comment it')
//}

Now save.

Now login to admin panel of your site then go to System->Config->Index Management and click on select all then select Reindex Data from the Action Dropdown then click on submit.

No comments:

Post a Comment