- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Product Url not generating perfectly
Hello All
I m facing one Issue as below
I have created 1 product and assign it to category id 4 and create one product without category when i call 2nd product model
in 1st product detail page then it gives url link http://yoururl/categoryid4/producturl.html. instead of http://yoururl/producturl.html.
I debug the code and found that it's a magento core functionaliy issue, it takes parent category id during fetching the url
If anyone has its solutions please help.
regards
Hitesh
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Product Url not generating perfectly
These links can help you with you:
1. http://magento.stackexchange.com/questions/4169/remove-unnesessary-url-rewrites
2. http://magento.stackexchange.com/questions/55368/remove-parent-categories-from-subcategory-urls
3. http://www.blueclawsearch.co.uk/blog/2011/12/22/remove-category-path-from-product-url-in-magento/
Let me know, if these don't help you.
Problem solved? Click Accept as Solution!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Product Url not generating perfectly
Hello
Thanks for your reply but it is not my solutions
Do below steps in your fresh magento so you will get exact idea what i means to say
1) Create 2 Different Category like 1 is computer and 2nd is Mobile
2) Create 2 product and assign 1 product to Computer and 2nd to mobile category
3) open view.phtml and after $_product variable add below code
$product=Mage::getModel('catalog/product')->load(enter2ndproductidhere);
echo $product->getProductUrl();
4) Save view.phtml file
5) Open 1st Product Full Url with Category path like http://yoururl/computer/1stproduct.html
6) See 2nd Product url in your product detail page you wil get url like http://yoururl/computer/2ndproduct.html instead of
http://yoururl/mobile/2ndproduct.html
please let me know if any query.