MarcoPLY

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

9 Neutral

1 Follower

About MarcoPLY

  • Rank
    Jr. Member
  • Birthday 05/08/1987

Profile Information

  • Gender
    Male
  • Location
    Reggio Emilia
  1. yeah this work! yes sure I also think that the growth of the forum can do interesting to many other people! Btw I have discovery that I was so close! I have change my last code with add $mail= to($user->email) and now work well! I know is better not write the module, for this reason I will use your code in my _func.php file. /** * Hook called after user is created * * @param User $user * */ protected function ___createdUser(User $user) { $mail = new WireMail(); $mail->subject('Welcome to our website'); $mail->to($user->email); $body = "<p>" . "Welcome to our website" . $user->name . "</p>"; $mail->body(strip_tags($body)); $mail->bodyHTML($body . "<p><a href='$page->url?profile=1'>" . $this->_('Your Account') . "</a></p>"); return $mail->send(); } Thank you again!
  2. Wow, again, thank you @flydev! Thanks for the encouragement. I tried to put some of mine ( I feel sorry to ask only) for create a send Welcome email after the registration. the idea look easy, but I try to do with the module. I tried first hook ___createdUser, I tried make a new protected function like sendConfirmationEmail (could be the best solution) . But obviously it doesn't work Last attempt I did was add inside protected function ___createdUser. But not work. I think to not be so far... protected function ___createdUser(User $user) { $mail = new WireMail(); $mail->subject('Welcome to our website'); $mail->to($email); $body = "<p>" . "Welcome to our website" . $user->name . "</p>"; $mail->body(strip_tags($body); $mail->bodyHTML($body . "<p><a href='$page->url?profile=1'>" . $this->_('Your Account') . "</a></p>"); return $mail->send(); }
  3. Ok I don't think I can change the module. The only things that I can do it's make a ajax call in the way the confirmation form appears after registration without the window closing. But I notice that If I try to use the button id in the ajax code this not work. same for the other buttons. Es: if someone fails to enter the pw the box reload the page, this not works $('#Inputfield_login_submit').on('click', function (e) { // select the first link from the orignal div - If Button not work $.ajax({ url: './', // type: "get", // data: '', // url param - Maybe here go somehting? but in this case what? beforeSend: (function () { }), }) .done(function(data){ $('#LoginRegisterDiv').html($(data).find('#LoginRegister').html()); }); e.preventDefault(); }) The same with all the button link.
  4. umm ok, I try to make some change in the module. Hope I can do, because the alternative is to build a new login / registration system Thank you flydev!
  5. Thank you @flydev! Yes this it's other option and works. You put me again on the right way, thank you! Only I have to load just a part of the page, the form in #LoginRegister. So I have did this: $.ajax({ url: './', // target url (selff here) type: "get", // GET because LoginRegister use GET variables data: 'register=1', // url param success: function(data){ $('#LoginRegisterDiv').html($(data).find('#LoginRegister').html()); }, }) About the module, now it asks to be confirmed before activating the account. It's possible pass this function? and make active the account after the registration, and maybe just add a confirmed screen for let be more clear. Thank you flydev, you help me a lot!
  6. Thank you, sure add the code here below <?php $addcart = $modules->get("PadRender")->addToCart(); $file = $page->free_download; $logg = $user->isLoggedin(); if($page->pad_price <= 0){ if ($logg) { echo "<a class='btn-log' href='$file' download >download</a>"; } else { echo "<button class='btn-log' id='btn-log'>Log For download</button>"; } } else { echo $addcart; } ?> This show me the Free Download button if the user its logged - (btw, also show me the paid version or the free version). But if the user is not logged he must first register before downloading the file. <div id="myModal" class="modal"> <div class="modal-content"> <span class="close">&times;</span> <?php $loginRegister = $modules->get('LoginRegister'); $loginRegister->set('renderStyles', false); ?> <?php echo $loginRegister->execute(); ?> </div> </div> var modal = document.getElementById('myModal'); var btnlog = document.getElementById("btn-log"); var span = document.getElementsByClassName("close")[0]; btnlog.onclick = function() { modal.style.display = "block"; } span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } In this way I showing the login form inside a modal box ( it's just a modal box that I usually take form the 3wc website, work well ) . So, the box show the login form and the registration link. I would like show close to the login form the registration form, in this way the use can make both action in the same box. I tried with hook ___execute, or force rendering of ___buildRegisterForm , but without find a working solution.
  7. Hi, I use the login/registration modules, I tried to add the registration form on the same window as the login form. But I can't find the way for do it. I need because inside the page there is a link when you click the modal box opens with inside the login form, but if the user need make the registration, when click on the registration link the box closes and I have to click again on the link. So, one easy and good solution is render the registration form close to the login form, but how I can do this? I tried with hook ___execute, or force rendering of ___buildRegisterForm, but or I wrong to write the hook code or did not find a working solution. Thank you.
  8. Ok installed. thank you for the great help!!
  9. Yes this work! I learn now. I start to understand how use the hook! Thank you very much! I will try to do more complex hook. But I can use any php string functions ? like implode()
  10. Hi @flydev, ahah no problem I can hear the whole story !! joke. Thank you for your starting point! If I have understand well this hook will add a new link inside the login from. exact? probably there are something I do wrong on hooks, I tried to do in inside the buildLoggedInLinks but it not work. Anyway make this hook it's bit hard for me at moment. I did not understand how hooks work, so, following the instructions in the hook page I have try to do some more easier hook, but not work, where I wrong ? (try to move the logout link next to the name) wire()->addHookAfter('LoginRegister::renderMessage', function ($event){ // $value contains the full rendered markup of a $page $value = $event->return; $value = str_replace( "<p class='LoginRegisterMessage'>" . $this->wire('sanitizer')->entities($message) . "<a href='$page->url?logout=1'>" . $this->_('Logout') . "</a></p>", $value); // set the modified value back to the return value $event->return = $value; });
  11. Yes correct, thank you. I will make the hooks to changes the markup. I think with a little practice I will be able to do it! I was thinking of modifying the module because I want add in the log-in page also a link to other page: Purchased Products. But I will try to make also this with a hook. Thank you!!
  12. @flydev Thank you! It's easy! nice. Sorry I'm new in pw and I don't know a lot of commands, hook and api. Now I can add this also in the Registration Form, perfect! But if I want edit the page to change the html render, want I need to do? I can make a separate template or I have to to inside the module ? Thank you again!
  13. HI. I don't understand how I can customize the user-login profile. Some one can help me? I use the login/registration module. At moment user can only change password and email. I don't understand how add this other fields: I would like the user make the registration can edit their name, surname, city and other information. If possible, the best things would be to use the same classes of Padloper in the way that during the checkout process the fields is are already filled out. Thank you!
  14. Wow @theo I like very much!! This work perfectly with Media Library!! I think a lot of people will benefit from it, so, thanks you a lot!! About some possible changes, honestly I do not see. Yes multiple images could be good but not essential, it's possible use the Repeater Field. Maybe could better when click on in the image, instead of the link to the media, have the possible to delate the image or have the box for edit the image. But I think this will be more difficult because in this way needs also save the new image and not edit the original. But anyway this module is very very helpful! Thank you again!
  15. Hi @Robin S sorry for going out of topic, next time I'll do a new one topic. Thank you for your answer! It's a great help! I still have to learn a lot about how to use the api in pw (and also php!!) I read the documentation and it helped me, only that for the multiple options I was a bit confused, but now I understand how it works! So thank you a lot!