Filter not translated when "inside"

  • Posts: 24
  • Thank you received: 0
9 years 9 months ago #191646

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.12
-- Browser(s) name and version -- : Firefox 35.0.1

Hello,

The title of the filters are not translated when they are displayed "inside" a text box (they are when displayed left, right, top, bottom) !
Can you correct this problem ?

Best regards

Last edit: 9 years 9 months ago by dezajn. Reason: topic icon -> solved

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 9 months ago #191654

Hi,

Thank you for your feedback.
Change the line:
$name=$filter->filter_name;
to:
$name=$this->trans($filter->filter_name);

in the file administrator/components/com_hikashop/classes/field.php and that will fix the problem.

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

  • Posts: 24
  • Thank you received: 0
9 years 9 months ago #191684

I changed the code in filter.php

The text is now translated but the results are incorrect (please see the captures images)

Attachments:

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 9 months ago #191685

Hi,

Ok. Then, change that same line to :
$name=strip_tags($this->trans($filter->filter_name));

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

  • Posts: 24
  • Thank you received: 0
9 years 9 months ago #191710

Hello,

I didn't solve the problem.
Did I broke something when I changed filter.php ?

Attachments:

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 9 months ago #191740

Hi,

I don't see how that's possible with that modification.
Can you double check that you made it correctly ?

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

  • Posts: 24
  • Thank you received: 0
9 years 9 months ago #191855

Hello,

I upadated filter.php with this one .
I deleted and recreated my filters and the translated titles are correctly displayed inside the filters.

But now there is a new problem : the (translated) titles inside the filter are used as search terms when there are multiple filters !
If I don't remove the titles, they get searched. Please see the enclosed picture.

Best regards.

Attachments:

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 9 months ago #191878

Hi,

Ah, yes, I didn't think of that.
Change the code:
$name=strip_tags($this->trans($filter->filter_name));
$onClick=' onclick="this.value=\'\';"';

to:
$onClick=' placeholder="'.strip_tags($this->trans($filter->filter_name)).'"';

and that should work properly.

The following user(s) said Thank You: dezajn

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

  • Posts: 24
  • Thank you received: 0
9 years 9 months ago #191992

Hello,

Now it works perfectly.

Merci beaucoup.

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

  • Posts: 24
  • Thank you received: 0
8 years 10 months ago #226106

Hello,

Since i have updated hikashop to 2.6.0 the translated names of some filters, when the name are "inside", don't work anymore.


In the picture :
- in red : simple list -> not translated
- in blue : multiple list -> not translated
- in green : radio button -> translated

Can you update filter.php ?

Attachments:
Last edit: 8 years 10 months ago by dezajn.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 10 months ago #227666

Hi,

The patch that Nicolas gave in the post "191878" is included in HikaShop packages.
So the translations in text filters should work properly.
Now I can see that the "dropdown" filters do not handle properly the translations, so you need to replace

$html.='<OPTION VALUE="none">'.$filter->filter_name.'</OPTION>';
By
$html.='<OPTION VALUE="none">'.strip_tags($this->trans($filter->filter_name).'</OPTION>';

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.

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

  • Posts: 24
  • Thank you received: 0
8 years 9 months ago #227840

Hello,

1.

$html.='<OPTION VALUE="none">'.strip_tags($this->trans($filter->filter_name)).'</OPTION>';
-> Now the filter name in the dropdown is translated, but the title inside the filter is still not translated.

2.
Just a note if someone else as this problem : hikashop 2.6.1 already as this code included.

3.
The titles inside the filters are still not translated (please see the enclosed picture).


Can you update the code ?


Best regards.

Attachments:
Last edit: 8 years 9 months ago by dezajn.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #227943

Hi,

I'm sorry but I cannot.
I don't understand what your screenshot is.

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.

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

  • Posts: 24
  • Thank you received: 0
8 years 9 months ago #227999

Sorry, i'll try to explain it in a simpler way.
I have MultipleDropdown filters (with custom fields)


When I clic on the filter the title is translated :


(Here : "Couleur principale")


But when I don't clic on the filter, the title is not translated when positionned inside.

(Here : "LUMEPIX_FILTRE_COLORS")

Attachments:
Last edit: 8 years 9 months ago by dezajn.

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

  • Posts: 12953
  • Thank you received: 1778
8 years 9 months ago #228053

Hello,
I just tested it on my end and it worked fine, can you give me a temporary back-end / FTP access to your shop so that we can directly test and debug it ?
Note that you can send it through our contact form by specifying the link of that thread :
www.hikashop.com/support/contact-us.html
Thank you.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 9 months ago #228428

Hi,

We got the access.

So the issue comes from the data-placeholder that is added. I don't know how it's added as we don't have such code in HikaShop.
I'm thinking it must be added by something else on your website: take.ms/xJXZE
Also, if you turn off the "use chosen library" setting of the HikaShop configuration, it should hopefully avoid the problem, but I couldn't test as the user account you provided doesn't have access to the HikaShop configuration.

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

  • Posts: 24
  • Thank you received: 0
8 years 9 months ago #228577

Hello,

The account I made for you should give you full access to the joomla backend. Maybe you tried the login/pass for the ftp access instead of the joomla access ?
I forgot to tell you that the shop page can be accessed here : http://www.lumepix.com/boutique-film-fr

If I disable "chosen library" the titles are translated but the esthetic is bad and it also change all the dropdown from the website. So, we'd prefer another solution.

If I change the filter type from "Multiple Drop Down" to "Single Drop Down" the title is inside and translated !
Can you check your code for the Multiple Drop Down ?

Maybe I should re-install the last hikashop update ?

Best regards

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #228580

Hi,

The multiple dropdown !
That a very important and useful information.

So you can replace :

$multiple='multiple="multiple" size="5" data-placeholder="'.$filter->filter_name.'"';
By
$multiple='multiple="multiple" size="5" data-placeholder="'.strip_tags($this->trans($filter->filter_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: dezajn

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

  • Posts: 24
  • Thank you received: 0
8 years 9 months ago #228720

Thank you.
Everything is ok with your modification.

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

Time to create page: 0.115 seconds
Powered by Kunena Forum