tag:blogger.com,1999:blog-6716966977665203128.post1835772260454373210..comments2024-03-19T14:33:09.456+05:30Comments on Important Magento: Magento: How to remove parent category path from sub category url in MagentoMohit Kumar Arorahttp://www.blogger.com/profile/06491364601817412253noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-6716966977665203128.post-16725052607303836662015-08-12T16:29:28.421+05:302015-08-12T16:29:28.421+05:30Kudos, thanks you so much for such a easy steps, i...Kudos, thanks you so much for such a easy steps, i made it,. thanks,, working very fine now.!Janki Davehttps://www.blogger.com/profile/05594046623938324400noreply@blogger.comtag:blogger.com,1999:blog-6716966977665203128.post-28552615834031191422014-07-17T23:30:42.394+05:302014-07-17T23:30:42.394+05:30To do this, go to same file. Find
function getPro...To do this, go to same file. Find<br /><br />function getProductRequestPath($product, $category)<br /><br />Here you will find code like this:<br /><br />if ($category->getLevel() > 1) {<br /> // To ensure, that category has path either from attribute or generated now<br /> $this->_addCategoryUrlPath($category);<br /> $categoryUrl = Mage::helper('catalog/category')->getCategoryUrlPath($category->getUrlPath(),false, $storeId);<br /> $requestPath = $categoryUrl . '/' . $urlKey;<br />} else {<br /> $requestPath = $urlKey;<br />}<br /><br /><br />Just replace this block of code with:<br /><br /><br />//if ($category->getLevel() > 1) {<br /> // To ensure, that category has path either from attribute or generated now<br /> // $this->_addCategoryUrlPath($category);<br /> //$categoryUrl = Mage::helper('catalog/category')->getCategoryUrlPath($category->getUrlPath(),<br /> // false, $storeId);<br /> //$requestPath = $categoryUrl . '/' . $urlKey;<br /> //} else {<br /> $requestPath = $urlKey;<br /> //}<br /><br />Now login to admin panel of your site, and go to:<br />System->Config->Index Management and click on "select all" then select Reindex Data from the Action Dropdown, then click on submit.<br /><br />That's all.. Enjoy.. :)Mohit Kumar Arorahttps://www.blogger.com/profile/06491364601817412253noreply@blogger.comtag:blogger.com,1999:blog-6716966977665203128.post-64690536904675448282014-07-17T16:27:02.647+05:302014-07-17T16:27:02.647+05:30thanks for this article ,it has been very helpful ...thanks for this article ,it has been very helpful but i suffer from another issue <br />the url in the form of :<br />http://www.website.com/category/sub-categry/product.html<br />i want it in the form of :<br />http://www.website.com/product.html<br /><br />i try the admin setting "use category name in url"<br />but it didn't work <br />so, please help me my mail is dev@bestbuyegypt.comAnonymoushttps://www.blogger.com/profile/01294148876865848044noreply@blogger.comtag:blogger.com,1999:blog-6716966977665203128.post-84373132777335776712014-06-28T20:13:47.531+05:302014-06-28T20:13:47.531+05:30Worked brilliantly thanks. Refreshing to see a blo...Worked brilliantly thanks. Refreshing to see a blog post that doesn't tell me to edit Core files directly as well!Matt Dazzhttp://www.megafancydress.co.uknoreply@blogger.comtag:blogger.com,1999:blog-6716966977665203128.post-15756760612659724292013-07-29T11:33:52.851+05:302013-07-29T11:33:52.851+05:30Hello, just wanted to say thank you very much for ...Hello, just wanted to say thank you very much for sharing this information. I have looked all over for instructions on how to remove parent category (they were affecting the paths when I entered a subcategory and tried to navigate out). Your instruction was the clearest, because the other instructions I found pointed out the line # but did no mention what text to find at those lines (and apparently different versions of Magento had different codes on different lines). SO THANK YOU. You helped me a lot! :Dchiiiiinghttps://www.blogger.com/profile/02784188770661246383noreply@blogger.com