URL including random "hikashop-menu-for-module..."

  • Posts: 55
  • Thank you received: 0
  • Hikashop Business
1 day 13 hours ago #372845

-- url of the page with the problem -- : dominicanamberfossils.com/en/store
-- HikaShop version -- : 6.5.2
-- Joomla version -- : 6.1.2
-- PHP version -- : 8.3.32
-- Browser(s) name and version -- : Firefox

Hi,
A page "store" displays a categories module (5)
3 of this categories display the url of the main menu item correctly
2 of this categories display the url with "hikashop-menu-for-module + number"

This 5 categories url display normally accessing them through the main menu

i'm wrapping my head around this for a while, you help much appreciate.
Thanks in advance

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

  • Posts: 85952
  • Thank you received: 14140
  • MODERATOR
1 day 10 hours ago #372847

Hello,

That "hikashop-menu-for-module-X" is not a bug, it's a hidden menu item that HikaShop creates automatically. When a category module has no menu item assigned to it, HikaShop still needs an Itemid to build the links to the categories, so it creates a hidden menu item with that alias and uses it as the fallback.

When the module builds the link for each category, it first looks for a real menu item that matches that category (a HikaShop "Category" menu item whose listed category is that category or one of its parents). The 3 categories that show the correct URL are covered by such a menu item (your main store menu), so their links use it. The 2 others are not under any category covered by a menu item, so their links fall back to the module's hidden menu, and you see "hikashop-menu-for-module-X" in the URL.

It's not harmful, those links work. To get clean and consistent URLs, you have two options:

1. Assign a menu item to the module. Edit the module, and in its options set the "Menu" setting to your Store menu item. The module then uses that Itemid as the fallback instead of the hidden menu, so the two categories route through the Store page URL.

2. Or make sure a HikaShop "Category" menu item covers those two categories. If your Store menu item lists a specific parent category, either point it to the common parent of all five categories, or create a Category menu item for the two that are currently left out.

Option 1 is usually the quickest.

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

  • Posts: 55
  • Thank you received: 0
  • Hikashop Business
19 hours 34 minutes ago #372861

Thank you, Nicolas, for your prompt answer.

I think I understand the general concept, but there is still something I have not fully understood.

The structure of the categories are created consistently, all Hikashop categories are linked to a main menu item, using the dropdown main menu "store", all categories display correctly with a consistent url and layout.

In the main menu, the 5 "store" sub-menu have the same menu item type "Hikashop Categories Listing" pointing to the corresponding Hikashop Category in the "Main Category" field of "Categories options".

The 5 Hikashop Categories have the same Parent Category

The "store" main menu item point to Hikashop "Store Categories" in the "Main Category" field of "Categories options".

Pointing the Main menu item "Store" to Hikashop "Store Categories" in the "Main Category" field of "Categories options" displays the 5 Hikashop categories on the "Store" page, no module is allocated to this function.

The 5 categories works fine through the main menu / sub-menu items
3 out of 5 categories display correctly with a consistent url and layout accessing through the clickable thumbnails (this is the point i can't find the way to change)

I'm quite confused about how you suggest to "Assign a menu item to the module"

Thanks in advance

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

  • Posts: 85952
  • Thank you received: 14140
  • MODERATOR
18 hours 13 minutes ago #372863

Hello,

My previous answer assumed a category module was doing the display. Since it's the "Store" menu item itself that lists the 5 categories, the "assign a menu item to the module" part doesn't apply to your case. The hidden "hikashop-menu-for-module-X" item is still present in your database because a HikaShop category module exists somewhere on the site, and that's what HikaShop ends up using as a last resort for those 2 links.

Here is how the link of each category thumbnail is built:

1. HikaShop looks among the menu items which are children of the current menu item ("Store"), and among the menu items at the same level as it, for a HikaShop listing menu item whose "Main category" is exactly that category. If it finds one, the link uses that menu item. That's what happens for the 3 categories which work.

2. If it finds none, it falls back to any category listing menu item it can find, and that's when it lands on the hidden module menu item.

So the 2 categories with the wrong URL are the ones whose sub-menu item isn't matched at step 1. On those 2 sub-menu items, please check:

- they are published, their access level is the same as the others (Public) and their language is the same as the page (or "All")
- they are direct children of the "Store" menu item, in the same menu. A menu item placed one level deeper, or in another menu, is not looked at
- their "Main category" points at that exact category, and not at the parent category

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

Time to create page: 0.062 seconds
Powered by Kunena Forum