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.

This topic contains 10 replies, has 2 voices.

Last updated by Alejandro 2 months, 3 weeks ago.

Assigned support staff: Alejandro.

Author Posts
July 11, 2019 at 8:13 am #4187237

Paul

Hi Bigul,

I talked on WCEU to Amit Kvint and he forwarded this issue to your developers.

I am still waiting for feedback can you check with them.

Thanks,

Paul

July 11, 2019 at 8:23 am #4187319

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

I opened another ticket because we couldn't update you on the old one.

We got word from our developers and they told us that what you're requesting could be a nice feature request so it would be good if you could request it here: https://wpml.org/suggest-a-new-feature-for-wpml/

In the meantime we found this ticket link with a nice snippet that seems to do exactly what you are asking for: https://wpml.org/forums/topic/set-users-default-language-using-php/#post-3215418

Regards.

July 15, 2019 at 11:24 am #4210377

Paul

It does not work for our need. I will request for this feature on the link you sent.

July 15, 2019 at 2:58 pm #4212623

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Thank you very much!

If you need help with any other WPML related issue, let me know or open a new ticket and we'll gladly help you.

Regards.

July 16, 2019 at 1:24 pm #4220419

Paul

I sent the feature request. Can't you make a workaround this or can you suggest other solutions while we are waiting for the request?

July 16, 2019 at 3:01 pm #4221467

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Unfortunately the only workaround i had was that snippet i sent you, but could you tell me why doesn't work for you?

does the snippet not work at all or it does but it doesn't do what you were looking for?

Let me know

July 17, 2019 at 11:24 am #4229417

Paul

We have tested to script and it does not do what we require.

Here is the situation. When a visitor orders(woocommerce), and on checkout makes an account, we want the selected language(WPML) on the frontend to be the user's language on the backend. But upon checking the account on users, it is still site default hidden link and not the selected language on the frontend.

July 17, 2019 at 3:02 pm #4231509

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Let me see if i can find more information about how to achieve that because right now that's a bit beyond our support (that's custom coding which is not supported by us) bt maybe i can find information that could point you to the right direction.

July 18, 2019 at 6:22 pm #4241799

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

As i mentioned before, that's custom coding and sadly we can't support that. however i think i can point you in the right direction.

Here's what you need to know:

1) you'd need to use the Following WordPress actions:
- https://codex.wordpress.org/Plugin_API/Action_Reference/user_register
- https://codex.wordpress.org/Plugin_API/Action_Reference/personal_options_update
- https://codex.wordpress.org/Plugin_API/Action_Reference/edit_user_profile_update
They are needed (in this case) to update the "locale" and "icl_admin_language" metas which are the ones handling the user language in the back-end.

2) You'd make use of the following functions from wordpress and/or WPML:
- https://codex.wordpress.org/Function_Reference/update_user_meta
- https://wpml.org/wpml-hook/wpml_current_language/

I think with that is more than enough. you could create a function where you update the metadata (in your case, user "default" language) to the one used while registering an account on the front-end.

You could contact one of WPML's contractors and show them this ticket. they will problably help you build it easily (they're independent developers who understand and develop all things WPML): https://wpml.org/contractors/

July 25, 2019 at 8:38 am #4280875

Paul

Thanks for the suggestions we are trying some out.

Paul

July 25, 2019 at 9:29 am #4281311

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Perfect!

I'll leave this ticket set as resolved but open. please feel free to let us know how it goes or if everything went alright, you can close this ticket or leave it inactive so it closes itself automatically in a week.

In the meantime i wish you a great day!