Okay
  Public Ticket #3638280
wp hook before/after_logout_user
Closed

Comments

  •  1
    Christian Probst started the conversation

    Hi there!
    I'm setting up new and I'm doing just fine so far. My concept is that customers login as wordpress members with Paid Memberships Pro and manage their accounts there. So, when the Amelia booking form is accessed first time the user data is filled in just fine, everything with the Amelia role model settings seems to work. I noticed, that even when the customer changes password in Amelia profile panel, this change takes place for the wp-user role as well (see your "Please note" at the end of https://tmsplugins.ticksy.com/ticket/3454019/, this description seems to be outdated? Thank you for your clarification.) 

    Now: when the customer logs out in the Amelia front-end customer panel, the Amelia login form appears straight away. If the customer logs in through there again, he is not logged in as wp-user and in my case not able to access his other protected content (as wp-user), but just the Amelia content. This is confusing for the customer.

    In order to avoid this I want to redirect page after Amelia logout. Better would be to hide the "Log out" - link/button at the bottom of your customer panel. Is this possible?

    As a workaround, I tried to work with the hooks amelia_after_logout_user / amelia_before_logout_user  (https://wpamelia.com/wp-hooks-users/) added in functions.php, but I can't figure it out, it doesn't seem to work. I tried with both hooks (just one at a time), with just the wp_redirect(), then with logout() before, but I just can't get to work, none of the hooks, none of the actions do work:

    function go_where_cp_says()
    {
      wp_logout();
      wp_redirect( 'https://chastro.me/logged-out/' ); exit;
    }
    add_action('amelia_before_logout_user', 'go_where_cp_says', 10, 0);

    In any tried configuration, after logout the Amelia customer panel page page with its login form stays visible.

    Hide the logout possiblity in the Amelia panel would be best. I guess that's not possible. But then, how to make the redirect work? What php-code does work here?

    Thanks you for your advice, I'm curious and looking forward to your answer,
    best regards, Christian

  •  1
    Christian Probst replied

    Hi there!

    Somehow I lost your function to fill in the already existing wordpress user data when the Amelia booking form is accessed first time. I can't understand why or how or what caused this loss. The role modell is still the same (wordpress user has Amelia cutomer role). I rolled back my changes, to investigate what caused this, but to no avail. 

    At this point, I decided not to invest any more work or time. I will apply for a refund. So my support request is no longer pending, thank you.

    I really like the style of your plugin, it is well designed and it offers all I want, every feature I wish for is in there. The reason I quit is that I can't get it to work with Paid Memberships Pro and other plugin that rely on synched data of the wordpress users. If customer have to maintain 2 different uswer profiles, that's awkward, difficult to explain.

    Just imagine you buy a membership and register with your name and e-mail address and log in. The first thing you want to do is book an appointment and what do you do? The same again, enter your name and email address once. 
    Then if you change your email. The chance that you only change your email in one place is close to certain. The confusion is predictable.

    I tried to work around all of this, but with the loss of the "auto-fill booking form" for existing wordpress users, I took stock. Damn it! You have such a good piece of software! But this lack of synchronisation with the Wordpress user, i.e. two profiles, is a killer factor for me. I know it is built on purpose this way, on customers wish. I understand this and to keep customers out of the wp backend and its user function is an excellent idea that I fully support. Amelia is the right choice as a stand-alone solution (I wish I was there, then everything would be fine)! But I need the functionality of other plugins too.

    So, if I could have one wish from the software fairy, that would be it: Boom!, and Amelia user would be in sync with the wordpress user. Changes on both sides would be reflected, in other words: synchronised. 

    So thanks and take care!
    Kind regards, Christian

  •   Marko replied privately
  •  1
    Christian Probst replied

    Hi Marko

    Thank you very much for your quick reply! Are you the one holding down the fort while the others enjoy their days off? I hope you will have your relax days too!

    And thanks for offering the 20% discount coupon too! I wish I could use it, but unfortunately that's not realistic for the site I'm working at. But I submitted the request of the function that I miss, as you suggested: https://features.wpamelia.com/3055 . And I wrote a short summary in the refund request too. I hope this helps you for future concepts.

    Hey, keep up the good work, apart from this missing (and for my needs indispensable) function, thumbs up for your plugin! In case I come across another project with a "stand-alone booking solution" you're the place I will come to for sure!

    Thank you and take care,
    kind regards,
    Christian

  •  1,564
    Marko replied

    Hello again Christian,

    You are most welcome and we try to help as best as we can especially these couple of days with the reduced capacity. Sorry that we could not help more but some features are just not available at this time. And thank you for your kind wishes and we we wish you all the best in your future endeavors. 

    All the best Amelia team.

    Kind Regards, 

    Marko Davidovic
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables