Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is trying to make Search & Filter Pro work with a second language on their website. The filters should capture values from an ACF field, which are translated using WPML String Translation. However, the filters do not recognize the translated values.

Solution:
We have investigated the issue and our 2nd Tier Support has provided feedback. The problem arises because while labels can be translated using ACFML filters when calling ACF functions on the front end, the translated values, which are part of post meta, cannot be translated on the front end. Manually adding translated values in the code of the Search and Filter Pro plugin is not recommended, as these values may change upon post translation, leading to mismatches.

We recommend keeping the values common across all languages and translating only the labels. You can set up your ACF fields with a value:label pair and then translate the labels, keeping the values the same. For example:

all : 전체<br />domestic : 국내<br />intl : 국외

This approach ensures that the values remain consistent while the labels are displayed in the correct language to the user.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket with us.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 25 replies, has 2 voices.

Last updated by Kor 9 months ago.

Assisted by: Kor.

Author Posts
January 25, 2024 at 7:40 am #15224662

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I've activated Elementor Pro and installed Advanced Custom Fields Multilingual. I've also installed search and filter and I don't think we need a license key for it to work. Could you please replicate the issue now on the sandbox site so that I could check?

January 25, 2024 at 8:48 am #15224921

eun-kwangH

Hi Kor,

Thanks for such a prompt follow-up. I will work on recreating the issue and will let you know once it's done.

Regards,

EK

January 25, 2024 at 8:49 am #15224922

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Sure thing. Please let me know how it goes.

January 25, 2024 at 10:49 am #15225594

eun-kwangH

Hi Kor,

I replicated a couple of posts for the custom post type "insight". I imported the CPT, ACF and Elementor template, and replicated the "search & filter" for "insight". I replicated the translation configurations as well.

Search Filter works in both languages, but the translations for ACF select fields are not recognized for both the loop grid and the search filter. It seems like the issue is replicated in the sandbox. Please check out the link below:

hidden link

However, the translations for the ACF select fields are recognized in each individual post. Please check out the link below:

hidden link

So, I thought it may have something to do with compatibility between "search & filter" and "wpml". However, in another post of another post type, translations for ACF select fields are not recognized even within the post. Please check out the link below:

hidden link

I did not replicated this post in the sandbox, as it is not related to "search & filter", but I would like to bring your attention to inconsistency in recognizing translations of ACF select fields.

Let me know if you need additional work from my end.

Regards,

EK

January 26, 2024 at 10:59 am #15229680

eun-kwangH

Hi Kor,

I am tried a couple of things at my website regarding the issue, and would like to share the outcome with you so that there is no missing points for both of us:

1) Changed the translation option for ACF select fields from "copy once" to "translate";
2) Translated labels for choices at each post through WPML Translation Editor;

As a result:

1) Now, the translations for ACF select fields are recognized, both in the list and in the post (Please check hidden link);
2) However, "search & filter" does not recognize the translations (Please check hidden link);

In this case, the issue becomes the compatibility between "wpml" and "search & filter". I chose "search & filter pro" as its price was reasonable and it was presented compatible with wpml. Hope we can find a solution for this soon.

Regards,

EK

January 26, 2024 at 6:54 pm #15231554

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for reproducing this on our sandbox website.

Please grant me the opportunity to review this, and I will respond to you as swiftly as I can.

January 29, 2024 at 9:04 pm #15240816

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I will have to consult this with our 2nd Tier Support and I will come back to you once I've feedback.

January 30, 2024 at 6:48 am #15241596

eun-kwangH

Look forward to hearing from you. I will leave the temporary username active until this issue is resolved.

February 20, 2024 at 8:21 pm #15324707

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I have feedback and this is what our 2nd Tier Support mentioned.

The issue is now, that the translated value 국외1 > overseas1 saved to post but Search and Filter Pro is not pulling the translated values in the drop-down on the front-end. And it is expected, why?

Labels are part of the package and ACFML may have a filter to translate them when calling ACF functions on the front end.

Translated values are part of post meta, it is not possible to translate them on the front end.

If we manually put the translated value on the front-end (in the code of the Search and filter plugin) then it can work but this is not recommended as the value can be changed anytime when translating the post and the hardcoded values in the code will not match.

I would suggest keeping the values common in both languages and translating the labels. They can put values: label in ACF and then translate the labels only keep the value same. e.g.

all : 전체
domestic : 국내
intl : 국외

I think this is best we can do.

February 22, 2024 at 4:10 am #15330995

eun-kwangH

Hi Kor,

It works great! I completely understand how challenging it is to stay compatible with thousands of plugins in wordpress ecosystem. I think your solution got me what I needed.

Thanks again!

EK

February 22, 2024 at 6:19 am #15331103

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Glad that helped.

I'll be marking this ticket as resolved. Thanks and have a great day!