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
Сообщения: 6
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
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Сообщения: 25854
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
Сообщения: 6
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. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.