Search shows full description of products

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172007

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- Error-message(debug-mod must be tuned on) -- : no error

The joomla search lists the products showing the full description instead of products name,
how to set this ?
In the plugin setup I've set fields=product_name

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #172070

Hi,

The results should display the product name and the description.
What you have set up is the parameter on which the search must be, in your case it search only in the product names.

This doesn't affect the results. To change the way the results are displayed it will require to edit the hikashop product search plugin or the Joomla search view.

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

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172089

The problem is that the search results seems to display another field instead of name.
Specific, this field is a custom field we added in the #__hikashop_product table via the ui, it is called `product_characteristics` ...

I've seen now in the db that there is a table called #__hikashop_characteristic and that the plugin call this query:

$db->setQuery('SELECT * FROM '.hikashop_table('variant').' AS a 
LEFT JOIN '.hikashop_table('characteristic') .' AS b 
ON a.variant_characteristic_id=b.characteristic_id 
WHERE a.variant_product_id='.(int)$row->id.' ORDER BY a.ordering');

Could it be the cause of the problem ?

Last edit: 10 years 11 months ago by gulp.

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
10 years 11 months ago #172154

No I don't see why that would be a problem.
It looks like a search results page customization issue.
Check the templates/YOUR_TEMPLATE/html/com_search folder on your website. If you have it try to rename it and see if that helps.
If not, could you provide a link to the results page so that we can see the problem ?

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

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172176

Hello,
thank you again for the suggestion, I've found and override for com_search and removed it but it doesn't fix it ...
I'm writing a pvt message to let you take a look at the page on my server ...

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

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172179

P.S.: I've seen now that it happens just for some products, that products that seems to works right it is because the custom field "characteristics" is empty ...

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

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172180

P.S.: and it happens only for the italian language !! :-(

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

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172230

Could it be the Falang component that is working wrong with custom fields ?

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #172237

Hi,

Are you using the same template for the different languages ?
The characteristics products don't have description, etc by default so it takes the parent product content. You potentially have to do the changes for the parent product data in the view.

It can maybe be FaLang as the issue you had here:
www.hikashop.com/forum/2-general-talk-ab...html?start=20#156891

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

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172465

Hello,
I also think about FaLang but don't know what to investigate to find the solution (no free support is given by FaLang team ...).
I don't have parent products, the catalog has a tree of categories but no relations are created on products.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 11 months ago #172540

Hi,

Looking at the code of the HikaShop product search plugin, I see something which can be the cause of your trouble.

if($multi && !empty($lg)){
	$query = ' SELECT * FROM '.hikashop_table($trans_table,false) . ' WHERE reference_table=\'hikashop_product\' AND language_id=\''.$lg.'\' AND published=1 AND reference_id IN ('.implode(',',array_keys($rows)).')';
	$db->setQuery($query);
	$trans = $db->loadObjectList();
	foreach($trans as $item){
		foreach($rows as $key => $row){
			if($row->id==$item->reference_id){
				if($item->reference_field=='product_name'){
					$row->product_name=$item->value;
				}elseif($item->reference_field=='product_description'){
					$row->product_description=$item->value;
				}else{
					$row->product_name=$item->value;
				}
				break;
			}
		}
	}
}
The last "else" in the check put the value in the product_name but it is not the reference field for the product name.
So it could be a good solution to :
- if the trouble comes from this last "else"
- know what could be the "reference_field" value
- comment the line which set the product_name

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: gulp

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

  • Posts: 99
  • Thank you received: 2
10 years 11 months ago #172623

Yes it works great !!
I would have to create an override of this plugin to avoid overwrite on update,
could you please suggest how, I'm not use on overriding plugins ...

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #172630

Hi,

What can be done is to duplicate the plugin, change it's name, and change it too in the php and xml files.
Then install it via the Joomla extensions installer, this way you will have you own plugin and it will not be overrided.

You can disable ours after having enabled the one you duplicate.

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

Time to create page: 0.092 seconds
Powered by Kunena Forum