Search with translated custom field values

  • Posts: 50
  • Thank you received: 1
11 years 1 week ago #132760

Hi.

My subject is maybe similar to http://www.hikashop.com/forum/2-general-talk-about-hikashop/72520-custom-field-translation-with-falang.html#124731

but my problem is that I can not get hits from translated values custom fields in search. It works great in english (default) but not in my second language. I have set the Product search plugin correctly and getting hits from the english values. No hits in my second language. I have translated the values of the custom fields in Falang. Am I doing something wrong? Or is it not possible to do this?

I guess one solution is to make two custom fields. One for English and one for Swedish... Hmm

Regards
Mathias

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 6 days ago #132833

Hi,

The search plugins handle the translations search. However, it will only search in the translations of the current language of the website. So if your website is displayed in english while you search a word in french, it won't look at the french translations and won't return any match.
Also, if the search plugin already finds at least a match in a product's main data, it won't look into the translations.

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

  • Posts: 50
  • Thank you received: 1
11 years 6 days ago #132836

Thanks for replying.

1. When doing a search in english display I get hits in english from product name, product description and product level (my custom field value). Doing a search in swedish display I get hits in swedish from product name, product description but NOT product level (my custom field value).

All translations made within Hikashop (product name, product description) works fine. It is the translation of my custom field values done in Falang that do not work.

When I do a search in swedish display with "english values" of the custom field I get hits. That would indicate that the translation does not work right? Maybe it is a Falang problem?


2. One other strange thing I noticed. When doing searches with values in custom fields the numbers do no not get searched. I will explain:

My custom field values (as stored in db):
Level 1:Very Easy
Level 2:Easy
Level 3:Intermediate
and so on...

When eg doing:
Search on "Level 2" -Hits from all products :(
Search on "Level" -Hits from all products.
Search on "Easy" -Hits from correct products.
Search on "Level Easy" -Hits from correct products.

How come?

/Mathias

Last edit: 11 years 6 days ago by matback. Reason: First search result corrected.

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

  • Posts: 50
  • Thank you received: 1
11 years 6 days ago #132873

I have found the solution for number 2 in prev post. (Numbers not get searched.) :)

It is a Joomla thing. The search component is restricting seaches to words only to be 3 letter words. I had to make changes to allow the search component to process searching for words with one letter.

Solution:

Copy file /language/en-GB/en-GB.localise.php to /language/overrides/

Make changes to the copied file from

public static function getLowerLimitSearchWord()
	{
		return 3;
	}

to
public static function getLowerLimitSearchWord()
	{
		return 1;
	}

Then do the same thing with file /administrator/language/en-GB.localise.php (copy and make changes)

There you have it. :cheer:

My main problem stated in the subject of this thread is however no solved. (No 1 in prev post)

/Mathias

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 5 days ago #132977

Hi,

You can't translate the product values of custom product fields via Falang. You can only translate the value of the fields.
So if you use a custom product of the type "text" and that for each product you translate the value of that field via Falang, you will be able to search in the translations of the field.
But if you translate the values of the field via Falang, it's always the english value which is stored in the product and the translation is Falang is not linked to the product but to the field which is why the search system doesn't find it. Unfortunately, it would be quite complex to support that.

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

  • Posts: 50
  • Thank you received: 1
11 years 3 days ago #133317

Thanks. I got most part of what you said. One thing though:

You say:

So if you use a custom product of the type "text" and that for each product you translate the value of that field via Falang, you will be able to search in the translations of the field.

How is that possible? Custom fields does not show in individual product translations. In Falang it is the same as picking the flag in product edit in Hika. Only hika default fields are there.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 3 days ago #133411

That's indeed the case by default. But you can easily translate these custom fields via Falang by editing the file administrator/components/com_falang/contentelements/hikashop_product.xml and add a line for the custom field with the column name of the custom field in the name attribute.
Something like that:
<field type="text" name="COLUMN_NAME" length="255" maxlength="255" translate="1">My field</field>

The following user(s) said Thank You: matback, krir

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

  • Posts: 50
  • Thank you received: 1
11 years 2 days ago #133589

Thanks Nicolas. This works very well :) I did as you suggested and made changes to the hikashop_product.xml in Falang. The searches are now getting hits in the translations. Great.

One final thing:
Is it possible to get the translation custom fields to be shown in Hika when you click on the flag? Or maybe that is the complex part?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 2 days ago #133594

It's a bit complex yes.

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

  • Posts: 50
  • Thank you received: 1
11 years 2 days ago #133601

I understand. Maybe you could add this as a feature request?

Once again thanks for all your help.

Regards
Mathias

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 2 days ago #133609

We'll add that to our todo list.

The following user(s) said Thank You: matback

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

  • Posts: 3
  • Thank you received: 0
10 years 8 months ago #146161

Hello,
I've installed in Falang the updated xml with added custom fields.
It is well recognized by falang that also shows the sample data with all the fields.
But the added fields doesn't show up in the translation form for the product, what else to do ?

Thank you for your help

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

  • Posts: 99
  • Thank you received: 2
10 years 8 months ago #146162

Hello,
I've installed in Falang the updated xml with added custom fields.
It is well recognized by falang that also shows the sample data with all the fields.
But the added fields doesn't show up in the translation form for the product, what else to do ?

Thank you for your help
(I'm sorry for duplicate posting)

Last edit: 10 years 8 months ago by gulp.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 8 months ago #147421

Could you provide some screenshots of what you did ?

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

  • Posts: 99
  • Thank you received: 2
10 years 8 months ago #147634

Hello,
I attach here some screenshot about configuration and views where custom fields are missing ...

Thank you for any suggestion

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 8 months ago #148557

Hi,

Adding the fields as being translatable in Falang/JoomFish won't make them appear in the translation edition popup of Hikashop.
What that allows you to do, is to translate them via the translation interface of Falang/JoomFish.
So it's actually normal.

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

  • Posts: 99
  • Thank you received: 2
10 years 6 months ago #156318

Hello,
after upgrading to latest hikashop my backend in Falang for translations of hikashop products hangs (see attachment).
Maybe some field update in the db or something to re-update in Falang for custom fields ?

Attachments:

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

  • Posts: 50
  • Thank you received: 1
10 years 6 months ago #156390

Do you have the latest version of Falang? There was an issue with Joomla 3.2 and 3.3.0 that broke everything. Latest update fixed that problem.

Mathias

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 6 months ago #156454

Otherwise, turn on the "debug mode" and "error reporting" options of the Joomla configuration and try again.
That should then display an error message on that blank page with more information on what's going on.

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

  • Posts: 99
  • Thank you received: 2
10 years 6 months ago #156503

I've the latest 1.40 falang, this problem comes after the update of hikashop, previously with J3.3 and Falang 1.40 it works fine.
This should be connected to custom fields previously added, but in hikashop backend they still works fine.

Here is a screenshot with the debug/error_reporting enabled if I try to access the "Content Elements - Hikashop Products" section.
Also if I try to access the Translations sections the hikashop products are listed, clicking on a product it reports a white screen with this error:

Fatal error: Call to a member function getTable() on a non-object in C:\web\olab2014\web\administrator\components\com_falang\models\ContentObject.php on line 738

I've also tried to uninstall an reinstall Falang but nothing changes ...

Attachments:

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

Time to create page: 0.117 seconds
Powered by Kunena Forum