HikaShop Search plugin adding “wrong” category to search results url??

  • Posts: 12
  • Thank you received: 1
7 years 4 months ago #272779

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.0.20-2~ubuntu16.04.1+deb.sury.org+1
-- Browser(s) name and version -- : chrome


Upon clicking on a search result of a hikashop category or product the resulting url has the “wrong” category added to the url.

For example, searching for product “italy” the category and products are displayed with this url:

http://localhost/joomloom/component/search/?searchword=italy&searchphrase=all&Itemid=101

But on selecting an item this url is displayed:

http://localhost/joomloom/africa-maps/country/italy-trek-free-map-file

and italy is not in africa, yet. “africa-maps” is added to any HikaShop category/product search. This occurs when starting a search from any menu item. Note: “country” is correctly added as a category description.

When selecting a search term that is not a hikashop category/product the url does not have a category (or other information) added:

http://localhost/joomloom/about/about-maps/gps-settings

I believe that when searching for a category/product joomla uses the HikaShop search plugin and otherwise it uses the jommla search plugin, hence the difference. What is strange is that despite the url containing the “wrong” category the correct product is shown and can be selected.

This occurs with both joomla 3.7.2 and 3.6.4. Both sites are using HikaShop 3.1.1, Apache2.4, MariaDB and Simple not Smart Search. SEF is enabled.

While it works my concern is that this (if in fact a bug) can break things in the future.

Thoughts?

Thanks, pitney

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 4 months ago #272794

Hi,

As you can see the id of the current menu item on the search results page is 101.
However, that is not a HikaShop menu item. And for the Joomla SEF to be able to display a page with a SEFed URL, it needs that the Itemid parameter added in the URL correspond to the component which has to display the content.
So on the search results page, the links to the result products need to have an item id in their URL of HikaShop.
In the HikaShop products search plugin, there is actually an option where you can force that id (and usually, you use the main menu item of your shop in that case.
If you don't, the search plugin will pick automatically the first HikaShop products/categories listing menu item it finds and use this id in the URL (and the Joomla SEF system will use it to add the alias of the menu item at the beginning of the URL).
So based on the description of your situation, you must have left that field empty and the system found that "country" menu item and used it automatically.
The best though is to enter the "canonical URL" in your products. There, write the URL that you want to be referenced by search engines for each product.
Then, in the HikaShop configuration, turn on the "force canonical URL on listings" setting and the links to the product page of products in the search results will use that canonical URL so it will be consistant with your HikaShop products/categories listing menu items. That will also help you with your SEO.

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

  • Posts: 12
  • Thank you received: 1
7 years 4 months ago #273021

Nicolas -

Thank you for your reply, I had neither item id or canonical urls set up.
As a "quick fix" I set the item id in both product and category hikashop search to "101" which is my home page menu item.
This works for products (removes "africa-maps") but not for categories which still display "africa-maps" in the url which is my first hikashop category.
If I follow the search results from category to products the url will retain the "africa-maps".
Trying various combinations of item id (in both category and product) does not fix the issue.

Is there a restriction on categories that prevents the use of item id?

thanks, pitney

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 4 months ago #273031

Hi,

Yes. For the categories, the id you put is supposed to be a menu item of the type HikaShop categories listing. I suppose that it is not the case.

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

  • Posts: 12
  • Thank you received: 1
7 years 4 months ago #274018

For those following this,
my "quick fix" was to create a hidden hikashop menu as a category listing, add an appropriate title and add this itemid in the hikashop categories search plugin.

pitney

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

Time to create page: 0.058 seconds
Powered by Kunena Forum