Product's SEO url generates 404 when menu item has same alias

12.11.2014 21:21
#1
mwill
Joomshopping forum user no avatar
Name: Manuel
13.08.2014
Posts: 5
Quote
Product's SEO url generates 404 when menu item has same alias

Let's say I have a product category called "Qualitätsbrände" (alias qualitaetsbraende) with one product called "Birnenbrand" (alias birnenbrand)

And I have a menu structure like this:
- "Produkte" (alias produkte)
- - "Qualitätsbrände" (alias qualitaetsbraende)

"Produkte" is a list of all product categories and the sub item "Qualitätsbrände" is a list of all products of the product category "Qualitätsbrände".

As the menu item "Qualitätsbrände" and the product category "Qualitätsbrände" have the same alias, the seo url
"/produkte/qualitaetsbraende/birnenbrand" does not lead to the product details of "Birnenbrand", but it leads to a 404 page, as the menu item "Qualitätsbrände" has no sub item.

After searching I found out, that the joomshopping router does not handle requests that use the products controller. So as a workaround I extended the code in file /components/com_jshopping/router.php line 267. I changed:
if ($menuItem->query['controller']=="category" && $menuItem->query['category_id'] && $segments[1]==""){

...to...
if (($menuItem->query['controller']=="category" || $menuItem->query['controller']=="products") && $menuItem->query['category_id'] && $segments[1]==""){

...and it works fine now.

Is this worth to be applied in one of the next updates, or is it just a dirty hack, that creates an error anywhere else?

Best regards,
-Manuel Will


Joomla: 3.3.6
JoomShopping: 4.7.0
PHP: 5.6.0
MySQL: 5.5.39
Website Url: http://brennerei.lagler.cc
 
13.11.2014 10:23
#2
webdesigner
(Support Team)
User webdesigner
Name: Admin
05.08.2010
Posts: 16507
Quote
Aw: Product's SEO url generates 404 when menu item has same alias

Create item menu
Qualitätsbrände" (alias qualitaetsbraende) as category (Not products)

 
22.01.2015 04:24
#3
mwill
Joomshopping forum user no avatar
Name: Manuel
13.08.2014
Posts: 5
Quote
Aw: Product's SEO url generates 404 when menu item has same alias

Hello there,
sorry for my late answer. "Qualitätsbrände" is a category.

Best regards,
-Manuel Will

 
Copyrights MAXXmarketing GmbH. All Rights Reserved