WPML + Membership > 'Protected Content' Page not translating

Hi, I have a site in Dutch/Spanish. The default language is Spanish and we're using WPML to manage translations.

The 'protected content' page works for Spanish, but not Dutch. By this I mean: when a Dutch user tries to access protected Dutch content, they are redirected to the 'protected content' page in Spanish.

Please advise.

We've opened a ticket on this weeks ago, but got no resolution.

Thanks!

  • PC
    • WPMU DEV Initiate

    Hiya,

    Greetings and thanks for posting on the forums and bringing the issue to our attention.

    I found that you created the thread here : https://premium.wpmudev.org/forums/topic/membership-protected-content-page-wpml-compabibility

    Apologies for not being able to be on top of this as the support staff dealing with that issue is no longer working with us.

    I will chime in on that thread right now and get back to you as soon as possible.

    If required I will also call our lead developer on the issue :slight_smile:

    Is that okay to mark this thread as resolved and continue there so that we can finish where we started ?

    Please advise.

    Cheers, PC

  • PC
    • WPMU DEV Initiate

    Hiya,

    I saw that thread and did not find much helpful info on that one so I decided to continue here.

    I have marked that other post closed.

    I have requested by colleague @Tom Eagles to chime in on this thread with his advice on the issue. He has good experience with WPML.

    Cheers, PC

  • PC
    • WPMU DEV Initiate

    Hello @RAD MKT

    Thanks for standing by on this one. I had a discussion with Tom but could not find anything concrete on this issue. I think its related to WPML configuration problems. I have called our lead developer @Barry on this issue. By the time is comes by, did you also check it with WPML support ?

    Please advise.

    Cheers, PC

  • RAD MKT
    • Flash Drive

    Hi PC,

    Thanks for picking this issue up again. I'm currently in the process of updating all of our WPML plugins to see if this has any effect. As well, I will follow up with WPML's people to see if they've any insights.

    Many thanks!

    Best,

    Ryan

  • RAD MKT
    • Flash Drive

    Hi PC,

    After updating everything the 'protected content' page still continues to default to the default language. I've opened a support ticket with WPML and will keep you posted as I get responses. In the meantime, kindly let me know if there's anything that I can do from my end to help out as we'd really, really like to get this resolved ASAP.

    Best,

    Ryan

  • RAD MKT
    • Flash Drive

    Hi PC,

    I think that perhaps our issue is a bit different because the 'Protected Content' page does translate via WPML ok. The issue seems to be that regardless of the user's current language, the 'Protected Content' page that gets triggered is the default language.

    For instance, if we have a page like 'domain.com/some-protected-page/' and 'domain.com/nl/some-protected-page/,' where the is in a protected URL group and is translated via WPML, a user that tries to access domain.com/nl/some-protected-page/ gets redirected to domain.com/protected, not domain.com/nl/protected/

    Best,

    Ryan

  • Barry
    • DEV MAN’s Mascot

    For instance, if we have a page like 'domain.com/some-protected-page/' and 'domain.com/nl/some-protected-page/,' where the is in a protected URL group and is translated via WPML, a user that tries to access domain.com/nl/some-protected-page/ gets redirected to domain.com/protected, not domain.com/nl/protected/

    The membership plugin has a single protected content page - so it will always redirect to that page when the content a user is trying to access is not available to them. You will need to allow access in your levels to the translated versions of that page as well if you want a user to not be directed back to the main one when they visit them.

  • RAD MKT
    • Flash Drive

    Hi Barry,

    Thank you for your response.

    Regarding:

    You will need to allow access in your levels to the translated versions of that page as well if you want a user to not be directed back to the main one when they visit them.

    Given a situation where we have a protected page with URLs site.com/protected, and site.com/nl/protected...

    I can access the page site.com/nl/protected/ and it shows correctly when I type in the URL or use the language switcher. When you say 'that page' in the above quote, do you mean the 'protected content' page itself, or a translated page that is protected in a URL group?

    Best,

    Ryan

  • Barry
    • DEV MAN’s Mascot

    I've never used WPML so I'm only going based on conjecture.

    I'm assuming that the plugin creates new pages in your system for each language. If, as you mention in your previous post:

    if we have a page like 'domain.com/some-protected-page/' and 'domain.com/nl/some-protected-page/,' where the is in a protected URL group and is translated via WPML, a user that tries to access domain.com/nl/some-protected-page/ gets redirected to domain.com/protected, not domain.com/nl/protected/

    That will be because the user doesn't have access to the /nl/protected page so will attempt to redirect you to the protected page set in the options. So you will need to set your URL group up so that it either has all the translated pages in it so the user can see all of them, or use a regular expression so that all possible translated versions are visible.

  • RAD MKT
    • Flash Drive

    Hi Barry,

    We're managing Membership access via regex and 'negative rules' for our 'guest users.' Basically, 'guest' users have access to every page (including all instances of the 'protected content' page).

    I'm more than happy to provide links via PM/email.

    Best,

    Ryan

  • Barry
    • DEV MAN’s Mascot

    Membership stores all of it's options in a single record in the options table called:
    membership_options

    It's a serialised array which has all the membership pages and their id's in there.
    The protected content page is 'nocontent_page'

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.