开发者

how can i remove main-category from the URL of sub-category in magento

开发者 https://www.devze.com 2023-01-14 14:50 出处:网络
hi i have a website in magento which contain url like myd开发者_开发问答omain/Parent-category/sub-categorybut i wnat to this URL for sub-category Likemydomain/Subcategory..please help me how can i rem

hi i have a website in magento which contain url like myd开发者_开发问答omain/Parent-category/sub-category but i wnat to this URL for sub-category Like mydomain/Subcategory..please help me how can i remove main-category from the URL of sub-category in magento...i will be greatfull... thanks lot... i want URL like http://www.Sofasshopping.com


Does this work? Not taking credit for it at all. I am looking for a solution as well and found it (possibly) at www.n2ndevelopers.com

http://www.n2ndevelopers.com/magento/how-to-remove-parent-category-path-from-sub-category-url-in-magento/

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

Open Url.php and go to line no 632 and comment(//) the below line

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

Now save and upload it.

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.

Now refresh your cache to see the effect.

0

精彩评论

暂无评论...
验证码 换一张
取 消