URL shows unwanted category name

  • Posts: 35
  • Thank you received: 3
8 years 6 months ago #255357

-- url of the page with the problem -- : shop.smartgart.com/de/rauchwarnmelder/pr...schalter-z-wave.html
-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.5.28
-- Browser(s) name and version -- : Chrome current
-- Error-message(debug-mod must be tuned on) -- : No error messae.

Hi all,

the URL of most products shows an unwanted former category name, e. g. for https://.../de/rauchwarnmelder/product/3892-....html, I want to get rid of the "rauchwarnmelder/" (smoke sensor) part. Alternatively, I want it replaced with a matching category (as it is not a smoke sensor).

I do have SEO Settings in Joomla enabled.
I now see that it might have to do with hidden menus.

best regards - Klaus

Last edit: 8 years 6 months ago by hactic.

Please Log in or Create an account to join the conversation.

  • Posts: 83799
  • Thank you received: 13571
  • MODERATOR
8 years 6 months ago #255368

Hi,


The part "rauchwarnmelder" here is the alias of your menu item. You can replace it with something else provided that you have another menu item of the type HikaShop products listing or HikaShop categories listing with what you want as alias of that menu item.

The following user(s) said Thank You: hactic

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 3
7 years 10 months ago #273213

Thanks, that helped. I have found and deleted the respective misbehaving menu.

For a larger problem with YYYY-MM-DD-HH-MM type URLs, I went into phpmyadmin and table joomla_menu, columns alias and link, and bulk edited all those entries. They get generated as a last resort for an otherwise empty alias when UTF-8 titles are used on menus and saved (and I was too lazy to explicitly set them at the time). As the web server supports UTF-8 (including Czech + Russian Cyrillic, Arabic, Chinese) in the URL paths, I more or less simply copied the title column through.

Waiting now for Google to rank the site a bit better ... :)

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 3
7 years 10 months ago #273676

A variation of the unwanted category name problem:

Starting on shop.smartgart.com/de (German version), I search for "mb_90014".
The result page then is .../de/taktik/product/124739-makeblock-mb_90014-makeblock-xy-plotter-robot-kit-v2-0, i. e. category "taktik".

Likewise, when starting on shop.smartgart.com/en (English version), I again search for "mb_90014".
The result page then is .../en/mechatronics/product/124739-makeblock-mb_90014-makeblock-xy-plotter-robot-kit-v2-0, i. e. category "mechatronics".

The real category however is "Technical_toys" > "STEM_Kits", "Maker_Kits".

That might be related to changes I made - namely i18n the category names and drilling up code.
But if someone sees an easy cure, then please advise.

Please Log in or Create an account to join the conversation.

  • Posts: 83799
  • Thank you received: 13571
  • MODERATOR
7 years 10 months ago #273680

Hi,

That's actually normal.
When you're on the search page and HikaShop has to generate the links to the products, the current menu item is a menu item of the search component of Joomla.
So the first part of the current URL is not usable by HikaShop. So it picks a menu item of the type HikaShop categories/products listing randomly and use its alias for all the search results.
Having it dynamically look for the menu items of the categories of each product would require quite a lot of heavy MySQL queries and it wouldn't be simple so we chose to not do that. Especially since it could still be not what you want as you can have several categories for the same product, several menu items allowing you to access a category, etc.

Instead, there is a simpler method to solve that issue, which will also help your SEO.
Enter the URL you want for each product in the "canonical URL" field of the product (and also enter the canonical URL for each translation of the product if your website is multilingual) and then activate the "force canonical URLs on listings" setting of the HikaShop configuration.
That way, all the listings and the search system will automatically use the canonical URL of the product instead of trying to generate the links for you.

The following user(s) said Thank You: hactic

Please Log in or Create an account to join the conversation.

  • Posts: 35
  • Thank you received: 3
7 years 10 months ago #273877

Thank you. - If possible, please point out where that random pick of the category name happens in the code;
I would then simply remove it for my installation.

For now, I want to stick with my own i18n but may try Falang/Joomfish later.

Last edit: 7 years 10 months ago by hactic.

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0
7 years 10 months ago #273879

I also like that there is such a problem. Tell me, can this be due to the fact that I used to use a proxy server? You know, logically this should not affect performance. But, because anything can happen.

Please Log in or Create an account to join the conversation.

  • Posts: 83799
  • Thank you received: 13571
  • MODERATOR
7 years 10 months ago #273902

Hi,

@hactic : there is no random category name pick. As I said there is a random pick of the alias of the menu item. That is done in the function hikashop_contentLink of the file administrator/components/com_hikashop/helpers/helper.php

@Mihoper : no, it's not linked to a proxy server.

The following user(s) said Thank You: hactic

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum