Some Smart Search Issues

  • Posts: 186
  • Thank you received: 71
  • Hikashop Business
5 months 3 weeks ago #309437

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.10

Hi,

we're trying out the awesome new smart search feature in 4.2.1, some problems/remarks so far:

1. When we try to delete an indexed product from the list in the back-end, we get the error "Call to undefined function hikashop_get()", though the product does get removed from the index.

2. On the front-end search results, all the url's point to the same product directory, and not to the correct menu/category which the product actually belongs to.

3. If a product is in multiple Hikashop categories/menus, it will show up multiple times on the results. For example, a product in 4 categories will display 4 times in the results, but all with identical url's (as mentioned in point 2) - not pointing to each specific category. Although it would be possible to unpublish the duplicates in the back-end smart search index, this is not really an option for thousands of products. Also regarding point 2, would it be possible to point to the canonical url?

4. The search results on the front-end are only plain text, which makes it less useful for users since they can't see what the product looks like. It would be a great improvement if product images can also be shown, or at least loaded with the smart search results, similar to the product images being loaded when using the "normal" joomla search.

Thanks for looking into it.

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

  • Posts: 67920
  • Thank you received: 10117
  • MODERATOR
5 months 3 weeks ago #309483

Hi,

Thank you for your feedbacks.

1. I don't get that error on my end. Could you activate the "debug mode" and "error reporting" on your Joomla configuration and try again ? You should get an error message with more information on the situation. That will help us understand where the problem comes from.

2. Again, I don't have that issue on my end. In that case, I'm afraid we'll need a backend and FTP access to debug the situation. Would that be possible ?

3. We should probably be able to improve on that and support the canonical URL. Regarding the multiple products, I'm not sure yet on what we can / want to do. I would have to study the situation more in depth. This version is a first version which is meant to test the waters.

4. I don't see how we could change that. I didn't see anywhere the mention of the possibility to have images support for smart search itself, let alone the possibility to add it to an integration plugin.
From what I understand, the default system doesn't support images unless you add some hacks to Joomla:
www.akashchakrawarti.com/images-in-search-results-joomla/

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

  • Posts: 186
  • Thank you received: 71
  • Hikashop Business
5 months 3 weeks ago #309492

Hi,

thanks for your reply, we fully understand the smart search is still in its infancy and we don't mind testing it out. Regarding the above points:

1. Error reporting indicates the error is on line 172 of plugins\finder\hikashop\hikashop.php, with following call stack:

1  ()  JROOT\plugins\finder\hikashop\hikashop.php:172
2  plgFinderHikashop->getUrl()  JROOT\administrator\components\com_finder\helpers\indexer\adapter.php:348
3  FinderIndexerAdapter->remove()  JROOT\plugins\finder\hikashop\hikashop.php:49
4  plgFinderHikashop->onFinderAfterDelete()  JROOT\libraries\joomla\event\event.php:70 
If we add
include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php');
right before line 172, the error is gone when deleting an indexed item and all is well.

2. We're just testing on localhost so unfortunately can't give you FTP access at the moment, but we'll continue to investigate. Inspecting the database we can see our indexed url's do contain the correct category_pathway corresponding with the correct hikashop category, however every single product has the same Itemid in the url (in our case &Itemid=123) corresponding to one of our menu items. This causes every search result on the front-end having this menu in the link, also for products which are in no way related to that menu at all.

Since there aren't really any settings for the smart search, we have no idea yet why this particular (and seemingly random) Itemid is added to every indexed url.

3. Ok great, thanks.

4. We don't necessarily mean indexing product images or anything as complicated as that, but we've found a solution due to the flexibility of view overrides. By largely copying the code from the normal hikashop search plugin to get the product images for search results and adding this in an override of the smart search default_results.php, plus creating a specific view for default_product.php to add the necessary html to display the image with the text, this works fine and issue solved.

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

  • Posts: 67920
  • Thank you received: 10117
  • MODERATOR
5 months 3 weeks ago #309579

Hi,

1. I've added a patch in that sense.

2. That's normal that the itemid is the same for all the products.
The index is done in the backend. There is no information for HikaShop to know which itemid to use.
a product can be displayed from different menu items and there is no way to link a menu item and a product.
So as you can see in the code of the getUrl fonction, we can the function getPublicMenuItemId of class.menu which gives back the first public products/category listing menu item it finds.
The alternative to that would be to use the canonical URL when available. I've actually noted that on our todo list as a high priority.

4. Yes, with view overrides of the Joomla finder that's indeed possible to do it.

The following user(s) said Thank You: GW

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

  • Posts: 1116
  • Thank you received: 113
2 months 2 weeks ago #313016

Hi,

@GW

Are you willing to share the code you are using to display images? I though i will ask before taking my time to add it by my self.


@Nicolas

Is there any progress regarding canonical url's?


Thanks

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

  • Posts: 67920
  • Thank you received: 10117
  • MODERATOR
2 months 2 weeks ago #313022

Hi,

No, we didn't more forward yet on the smart search plugin.

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

  • Posts: 1116
  • Thank you received: 113
2 months 2 weeks ago #313050

Hi,

It's a bit shame that no improvements have been done. Especially then they were reported here....

1. Probably having same url is not such a big deal but "If a product is in multiple Hikashop categories/menus, it will show up multiple times on the results. For example, a product in 4 categories will display 4 times in the results" is really an issue here.

2. It is really strange that after so many years and countless topics with 'hikashop search" there is still no good solution for search. As example we would like to give users possibility to use filters in search results so any ajax search, smart search is not for us. However using search as a " filter search" is connected with whole hikashop filters system which makes hard to customize. Having "search" as different view which would get all the products would be great!

Thanks

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

  • Posts: 186
  • Thank you received: 71
  • Hikashop Business
2 months 2 weeks ago #313064

@kyratn
After our initial findings we did not continue looking into the smart search any further since in our view it is not refined and user-friendly enough to use in a live webshop at the moment.

If you want to load product images with the smart search results, you can make an override of com_finder/search/display_results.php.
In this file you will have the product search results in the array $this->results, which also includes the product id's. With the product id's it's not difficult to also get the corresponding images, which can be done through a database query, something like this:

//load helper class
include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php');
$imageHelper = hikashop_get('helper.image');
//because the same product can occur many times in search results, create separate array with only unique product ids
$ids=array();
foreach ($this->results as $result) :
	if(!in_array($result->id,$ids))array_push($ids,$result->id);
endforeach;
//database query to retrieve image data
$db = JFactory::getDBO();
$queryImage = 'SELECT * FROM '.hikashop_table('file').' WHERE file_ref_id IN ('.implode(',',$ids).') AND file_type=\'product\' ORDER BY file_ref_id ASC, file_ordering DESC, file_id ASC';
$db->setQuery($queryImage);
$images = $db->loadObjectList('file_ref_id');

$config =& hikashop_config();
$imgurls = array();
$height = (int)$config->get('thumbnail_y','100');
$width = (int)$config->get('thumbnail_x','100');
$image_options = array('default' => true,'forcesize'=>$config->get('image_force_size',true),'scale'=>$config->get('image_scale_mode','inside'));
foreach($images as $row){
	$img = $imageHelper->getThumbnail($row->file_path, array('width' => $width, 'height' => $height), $image_options);
	if($img->success){
		//do whatever you want, for example store all image urls in new array
		array_push($imgurls,$img->url);
	}
}


You will have all the image information in the $images array and you can use for example $imageHelper->getThumbnail(), etc. and do with it whatever you would like.

Hope that helps.

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

  • Posts: 1116
  • Thank you received: 113
2 months 2 weeks ago #313067

Hi,

Thanks GW for share. Appreciated ;)

Regards

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

  • Posts: 65
  • Thank you received: 10
  • Hikaserial Standard Hikashop Business
3 weeks 1 day ago #314436

Hi
@kyratn
I am trying to integrate with images the results of smart search hikashop.
could you share the code of file override default_results.php?

Thanks
Javier


Javier Ballester
plus.google.com/+JavierBallester
Hikashop Joomla! Magazine in Spanish
Tu tienda Online Joomla! Hikashop
magazine.joomla.org/es/ediciones-anterio...enda-online-joomla-3

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

  • Posts: 1116
  • Thank you received: 113
3 weeks 22 hours ago #314439

Hi,

@Jabatec

Honestly we got tired to implement features to Hikashop witch all proper e-commerce have it by default. Like search, not outdated variant selection, proper wishilist and waitlist handling, some not finished new features, like proper dashboard ( it was created like 3 years ago for no reason and people still use legacy one....) or even simple. Tracking number field.... and many other things witch Hikashop doesn't have.... We found that it will take to much time and not worth it to keep it going on...

So we have looked to other solution like Magento or Prestashop which are created as real e-commerce platforms and not as addon to CMS... Which probably is the main issue here. Same as for woocommerce....

Right now we are creating theme for Prestashop and will migrate later this summer.

I am not saying that Hikashop is bad. If you have site on Joomla and want to extend it, then i would definitely go with Hikashop. However if you try to create ecommerce from scratch then i would skip it and go with Prestashop, Magento and some other platforms which were created only for that.

Thanks

Last edit: 3 weeks 22 hours ago by kyratn.

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

  • Posts: 186
  • Thank you received: 71
  • Hikashop Business
3 weeks 21 hours ago #314440

@kyratn
Sad to see you leave, thanks for all your input in the forum over the years.
We very much like the customisablity of Hikashop and will stick with it for a few more years, but I can understand your points.
Good luck in the future!


@Jabatec
As kyratn implied, adding images to the smart search results is not that straightforward and does require some advanced coding knowledge. We actually gave most of the necessary code in our previous post above, but you would also need to create your own default_product.php file to display the images with the html of the search results and style them. So it's kind of a large-ish project to do that.

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

  • Posts: 65
  • Thank you received: 10
  • Hikaserial Standard Hikashop Business
3 weeks 7 hours ago #314461

Hi
@kyratn,
I think tha Hikashop has very powerful technology, custom fields, mass actions, templates comunications backend front end, flexibility in checkout design, etc etc,. but code and integration, it is hard, developing technology and integrating it into the market is hard and often unpleasant. with hika and in any other ecommerce, web, app.

@GW
I am working as a freelance for 12 years and developing (integrator) Joomla since 2005 (always Joomla!). Adding images to the smart search results is not that straightforward and does require some advanced coding knowledge, but @GW, whenever we browse an ecommerce website the first line of the header contains a search field. Search field is vital (filter hikashop, its good, but it is not a search field)

For two years I am struggling with search extensions for Hika, very hard and with very dubious architecture design. Last summer, 6 months ago, when I read in the Hikashop newsletter that Hikashop published a plugin for smart search joomla, I shouted to the sky, but when I saw that it did not include images I could not understand it. I have tried unsuccessfully to make an integration, I have tried to hire a programmer (to post the code later) but the budget was not accepted by my customer. I have also tried with algolia, without success.

Hikashop team works to adapt smart search to Joomla! 4. @kyratn works with more than 1100 free post contributions in the forum (thks), @GW write code, search field is vital. Something does not work. We have solutions but no alignment

I will continue working with Hikashop, but today my client asks me why our store does not have a search field like all of its competency. Now at least, I can answer that we are in it, trying to align the intentions of each of those who form the chain. If ask me how long, I will not be able to answer.

Regards
Javier


Javier Ballester
plus.google.com/+JavierBallester
Hikashop Joomla! Magazine in Spanish
Tu tienda Online Joomla! Hikashop
magazine.joomla.org/es/ediciones-anterio...enda-online-joomla-3

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

  • Posts: 1116
  • Thank you received: 113
2 weeks 6 days ago #314478

Jabatec wrote:
For two years I am struggling with search extensions for Hika, very hard and with very dubious architecture design. Last summer, 6 months ago, when I read in the Hikashop newsletter that Hikashop published a plugin for smart search joomla, I shouted to the sky, but when I saw that it did not include images I could not understand it. I have tried unsuccessfully to make an integration, I have tried to hire a programmer (to post the code later) but the budget was not accepted by my customer. I have also tried with algolia, without success.


Hi,

I don't want to argue much about it, as people are different and probably Hikashop has they own view about they component.

However, i had same feelings when i saw changelog... and got disappointed. Why would someone take time to create such plugin which is useless/unfinished trash? It's like build for some blog/text search, not e-commerce where image is the heart of it here. Sometimes it feels like someone lack of knowledge how the e-commerce should be...

Now take a look at Prestashop. The search has autosuggest, own view, you can apply some filters after searching is done to filter it more deeply based on your search query. It is integrated with google, it automatically tracks all search data and shows it in your google analytics dashboard like: search term, how many times it was searched. Then you can create email campaigns, give a discount code to user in hes profile based on the search terms.... Everything there by default, you don't need any customization and the best thing you can see all of this on prestashop dashboard module. As for Hikashop dashboard it's just meh...

Thanks

The following user(s) said Thank You: lousyfool

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

Time to create page: 0.084 seconds
Powered by Kunena Forum