Jump to content

Login/Register/Profile Module - Update $this->message


alexm
 Share

Recommended Posts

Hi all,

I'm using Ryan's new Login/Register/Profile module for accounts and PadLoper.

I've made a hook in site/init.php that adds a product to the cart after someone creates an account and activates it and would like to also update the message "Thank you, your account is confirmed and you are now logged in" and append "The product has been added to your cart etc" but can't figure how to access $this->message.

Any help would be greatly appreciated.

Many Thanks,

Alex

Link to comment
Share on other sites

Ok, so I have used a str_replace like the example in the hook docs for now like so:

$wire->addHookAfter('LoginRegister::renderMessage', function($event) {
  $value = $event->return;
  $value = str_replace('Thank you, your account is confirmed and you are now logged in', 'Thank you, your account is confirmed and you are now logged in.<br>We have added the membership to your cart. To activate your membership please complete the checkout process.', $value);
  $event->return = $value;
});

I'm still curious if this is the best way to change the module messages so any feedback would be awesome.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...