网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > Magento
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 199.115.98.60
Old 2016-10-02, 06:57 PM
Saegertown Saegertown is offline
初级会员
 
Join Date: 2005-03-27
Posts: 2
Saegertown 现在声名狼藉
Default Remove parent categories from subcategory in URLs in 1.9.2.4

Magento version is 1.9.2.4.
I have tried following solution which doesn't work for me.
Step 1: Go to app/code/core/Mage/Catalog/Model/Url.php copy this file to app/code/local/Mage/Catalog/Model/Url.php because it is core Magento file so that we have to copy that file into the app/code/local.
Step 2: Now search for the getCategoryRequestPath($category, $parentPath) around line 698 in Magento ver. 1.9.2.4
Step 3: Search if (null === $parentPath) around line 717 and comment the line as below:
Code:
/* if (null === $parentPath) {
$parentPath = $this->getResource()->getCategoryParentPath($category);
}
elseif ($parentPath == '/'){*/
$parentPath = ''; //DO NOT Comment this line
//}
Step 4: Now Go to the Magento admin and Clear Cache System->Cache Management and Reindex System->Index Management the data.
Step 5: Refresh your browser cache and navigate again now you will see only the Sub Category in Url not the Parent Category just like as: http://www.cheapglasses.net/cheap-glasses.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to x-cart v5 remove parent category url from sub-category url? Oblong X-Cart 1 2016-05-06 12:20 PM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 09:11 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.