alexm Posted October 30, 2017 Share Posted October 30, 2017 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 More sharing options...
alexm Posted October 31, 2017 Author Share Posted October 31, 2017 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 More sharing options...
Robin S Posted October 31, 2017 Share Posted October 31, 2017 You can install the core LanguageSupport module and then "translate" the string for the Default language: 1 Link to comment Share on other sites More sharing options...
alexm Posted November 1, 2017 Author Share Posted November 1, 2017 @Robin S that's a good shout! Thank you for that. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now