Smart search result url wrong

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
10 months 3 days ago #359178

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.2
-- PHP version -- : 8.2.15

Smart search configured. Menu item for search created. Hika smart search plugin activated. Canonical url created.
When you search for product, results url are like
domain.com/root-category/id-product-name/highlight-WyJkb2dvZGVrIl0=

No product has assigned to root-category.

So results url should be domain.com/product-category/id-product-name/highlight-WyJkb2dvZGVrIl0= (canonical url).

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
10 months 3 days ago #359180

Hi,

It's not the "root category" you see in the URL, it's the alias of a menu item on your website taken randomly by the smart search plugin during the indexing so that the URLs can be valid.
And unfortunately, we can't use the canonical URL because Joomla requires us to provide the non SEFed URL when indexing the elements.

But I agree with you that it would be nice if the smart search plugin could automatically search for the menu item linked to the main category of the product in order to provide a nicer URL to the smart search system. We'll look at improving this for the next version of HikaShop. Thanks for your feedback.

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

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
10 months 2 days ago #359199

Thank you.
It realy is useless that way. Im working on new site and this is real deal breaker.
It is not problem in "nicer" url. The problem is that url should not exsist at all.
I hope you manage to solve this for next release.

The following user(s) said Thank You: nicolas

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

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
7 months 15 hours ago #361155

I updated to 5.0.4 and the problem with url is still there.
All links to products are wrong. All products from search results have root category in url, but no products in root category.
It just dont make sense.

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
7 months 11 hours ago #361159

Hi,

We did work on this topic for the 5.0.4 and improved the system for this.
It's the point:

The Smart Search plugin will now auto select the menu item to use for the URL of the products being indexed based on the main category of the product. This will help in providing results with a nicer looking URL.

from our changelog:
www.hikashop.com/support/documentation/5...ashop-changelog.html
If you don't see any changes, it's either that:
- you didn't reindex your products
- your products' main category is not the category you want to be used
- your products' main category doesn't have a corresponding menu item for it
In these cases, it's normal you don't see any changes. We cannot infer the menu item from the category if there is no corresponding menu item, or if the main category of the product is not relevant.

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

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
6 months 4 weeks ago #361176

- you didn't reindex your products - reindexed several times
- your products' main category is not the category you want to be used - all products have selected main category
- your products' main category doesn't have a corresponding menu item for it - for all main categories I have menu item

But I have menu item for root category (category list). And all products in search get urls from that item.

So category structure is:
Root category
- sub 1
- sub 2

Menu items:
Root category (category list) | sub 1 | sub 2

All menu items are in first level.

If I disable Root category menu item, search urls are ok.
Is there a way to exlude menu items? Some other solution?

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
6 months 4 weeks ago #361177

Hi,

What do you mean by "all products have selected main category".
In a product, you have the "categories" setting.
In that setting, the first category selected in the main category of the product.
What you're saying in your message seems to indicate that you selected the main category of your shop as the first category (and thus the main category) of the product. Please make sure that this is not the case and that the main category of your products is the sub category for which you want the URLs to be generated.

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

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
6 months 4 weeks ago #361187

Misunderstanding. Each product have subcategory as his main category.
So as it should be.

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
6 months 4 weeks ago #361190

Hi,

Then, the modifications we made in the last release should cover this.
Please provide a backend access via our contact form so that we can check on the situation:
www.hikashop.com/support/contact-us.html

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

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
6 months 3 weeks ago #361273

Sent, thank you

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
6 months 3 weeks ago #361318

Hi,

Thank you for the access.
I've looked into it today and I've made a patch which seems to fix the issue after a reindex.
The issue is that for some reason the getURL function of the smart search plugin is not being called on the frontend results page on your website, while it is on my end. I think it might be because my website is multilingual and thus the smart search extension needs to get the URL for the current language, while your website only has one language, and thus it can fallback on the URL generated during the indexing.
And the patch I made in the 5.0.4 was only in for when the URL is requested on the frontend results page as I didn't see a need to do it during the indexing. With the new patch I've added to your website, this processing is now also done during the indexing.
I'll be including this patch for the next version of HikaShop.

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

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
6 months 3 weeks ago #361321

Can I get the patch now? I need it for my production site (that was dev).

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
6 months 3 weeks ago #361329

Hi,

You can copy the files from the plugins/finder/hikashop folder from the dev site you provided to your live site.

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

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
6 months 3 weeks ago #361344

Problem solved.

The following user(s) said Thank You: Philip

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

Time to create page: 0.076 seconds
Powered by Kunena Forum