VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: welrachid on July 13, 2018, 13:41:09 PM

Title: category alias and product alias are same, but it only displays product
Post by: welrachid on July 13, 2018, 13:41:09 PM
Hi guys
VM 3.2.14
J!3.8.10

I have a category alias: klistermaerker and a product alias: klistermaerker
I want them both to work so that when i have this url:
example.com/klistermaerker it shows category
example.com/klistermaerker/klistermaerker it shows products

currently it always shows the product, so this mean that there is no category view.
Thanks
Wel
Title: Re: category alias and product alias are same, but it only displays product
Post by: Jörgen on July 13, 2018, 13:46:05 PM
Maybe there is no category view. Without a link impossible to say. Would you know based on that information ?

Jörgen @ Kreativ Fotografi
Title: Re: category alias and product alias are same, but it only displays product
Post by: welrachid on July 13, 2018, 13:53:51 PM
Hi thanks for response...

Here are the actual links:
https://example.dk/klistermaerker/klistermaerker

https://example.dk/klistermaerker

I want the category to perform just like

https://example.dk/storformat category

Title: Re: category alias and product alias are same, but it only displays product
Post by: Jörgen on July 13, 2018, 14:19:01 PM
I would check the menu structure, do You have any hidden menu ? This could explain the strange setting. If that does not give any clues, turn off sef and see what You get.

Jörgen @ Kreativ Fotografi
Title: Re: category alias and product alias are same, but it only displays product
Post by: Studio 42 on July 13, 2018, 14:50:22 PM
If you want have same alias, then use the product suffix in SEO settings.
Title: Re: category alias and product alias are same, but it only displays product
Post by: welrachid on July 15, 2018, 12:13:06 PM
@Jörgen
Without SEO active i get this on category:
https://example.dk/view/category/virtuemart_category_id/29

and this on product
https://example.dk/view/productdetails/virtuemart_product_id/163/virtuemart_category_id/29


@Studio 42
Currently i dont have any suffix on the products. This is due to that i does look weird in a link to have something not part of the product.
But maybe the solution (if this is a bug in the VM) is to rename the product entirely. This is an issue only in THIS single category.

Thanks for your time.
Title: Re: category alias and product alias are same, but it only displays product
Post by: Studio 42 on July 15, 2018, 14:13:08 PM
It's not a bug, it's how the router work.
First it check last part "klistermaerker", if this is found as product, he know it's a product and not a cateogry.
If this is not found as product alias, then it check if this is found as a category.
If you change the alias of the product klistermaerker to klister-maerker then it should work, because you dont have any name conflit with klistermaerker category
If you want safe alias and no onflit use suffix in the config.
In my test shop i use .html and disabled suffix in Joomla config.
So only product details link have .html and it prevent alias conflict with categories
In my shop i use .htm, this is the old standard and work safe too.
Title: Re: category alias and product alias are same, but it only displays product
Post by: welrachid on July 16, 2018, 15:22:14 PM
@studio42
Thanks for response

I've decided to only change this single products alias to be entire name.
Now it works as expected.

Thanks for you time.