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.
|August 22, 2019 at 6:54 pm #4442289|
I am trying to:
I have created a relationship field on the "product" CPT of my English-Canada site. I want to put a relationship field that only allows me to choose from En-US (English USA) products. When a US customer goes to a Canadian product, I want to show a list of Products available in the US. I will be using MaxMind GeoIP detection to determine the request's country of origin.
I have created an ACF Field Group and added a "Relationship" field but it obviously only shows the current language posts. So, Canada-English only shows Canada-English Products. Ideally I'd like to lock this down to ONLY show English-USA products/post/content... even though I'm on the Canada site.
Is there a filter that I can tie into that I can send a hardcoded ICL_LANGUGE id to or something? Thanks for your time!
Link to a page where the issue can be seen:
I expected to see:
Instead, I got:
|August 23, 2019 at 6:38 am #4444323|
Languages: English (English )
Timezone: Europe/Zagreb (GMT+01:00)
Thank you for contacting WPML support!
Ideally I'd like to lock this down to ONLY show English-USA products/post/content... even though I'm on the Canada site.
If I got this request right, you would like to show for example English content on German language (example for an illustration only)?
I do not think it is possible, because that will counteract how WPML works - by showing content from language on which the visitor is currently on, while having ACF relationship field complicates things up.
I wondering whether it is related to this perhaps:
You can also check our API, perhaps finding what you need there:
You could also consider the following: