Hikashop search plugin / Fields

  • Posts: 15
  • Thank you received: 0
8 years 2 months ago #250443

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.5

Hello

I am using the classic search component. I have activated the Search - Hikashop products plugin.

But I want more fields than the title and the description. So I select many other fields (personnalized fields, or a field like product_code).

But none of them are displayed on the result page.

I've pu the ID of my menu inside the plugin configuration.

Thanks for your help !

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 2 months ago #250445

Hi,

The goal of selecting the fields in the settings of the plugin is that the plugin will search in those fields.
However, the display of the results is fixed. There is no option to change it.
To change it, you would have to modify the code:

$row->title=$row->product_name;
				$row->text=$row->product_description;
in the file plugins/search/hikashop_products/hikashop_products.php

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

  • Posts: 15
  • Thank you received: 0
8 years 2 months ago #250511

Thanks

But it's not working for the moment but maybe I forgot something.

In the Fields field of the Search - Hikashop plugin, I have put : product_name,product_description,cahier_annee,product_code

In the file plugins/search/hikashop_products/hikashop_products.php, I have this :

$row->title=$row->product_name;
$row->text=$row->product_description;
$row->code=$row->product_code;
$row->annee=$row->cahier_annee;

When I do a var_dump inside /components/com_search/views/search/tmpl/default_results.php, I get :

["code"]=> NULL ["annee"]=> NULL

What am I doing wrong ?

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 2 months ago #250552

Hi,

You can't do that. The Joomla search only supports title and text.
If you want another information, I would recommend to append it to the text or title variable.
So something like that for example:
$row->text=$row->product_description.'<br/>Code: '.$row->product_code;

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

  • Posts: 846
  • Thank you received: 92
8 years 2 months ago #250614

Hi
Does hikashop provide it own extension to be able to process index (which fields) and search ?
Regard's

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 2 months ago #250647

Hi,

Yes. You can use the filter system of HikaShop Business:
www.hikashop.com/support/documentation/1...-filter-listing.html
It can be configured to be used as a search module with an input field like the joomla search module, but instead, it would display the results as a standard HikaShop products listing, so you can easily add custom fields display there with the display settings of the custom fields.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum