Jump to content

Marco Ro

Members
  • Posts

    347
  • Joined

  • Last visited

Everything posted by Marco Ro

  1. Hi @kongondo I like your modules. I don't understand if I can choose a product with a combination of 2 input? I mean, I make all the variation Blue, S = ID 1 Blue, L = ID 2 Red, S = ID 3 Red, L = ID 4 Then can I make only one input for Color and one Input for Size? and when I add the product to the cart, depending on the choices, I sent the id connected to the combination. Can I do this? or I need anyway to add a custom js to process this?
  2. @3fingers ciao! Thank you for the link. I had already read it before started to work, it helped me to better understand how pw works. With Padloper the variable system works similar but a little different from the categorization, I mean, you have to build the products variation like you add the category, but if you have two variation you have to create 1 products for each combination. like you have 2 sub_category. ( category) Shop (subcategory) Product (Variation) Red XL (variation) Red S (variation) Blue XL Now that i think this maybe I can Make a Sub_Sub_category ummm... ( category) Shop (subcategory) Product (Variation) Red (Sub_Variation) XL (Sub_Variation) S (variation) Blue I will try to this! Not sure it's possible but will see. Thank you!! @elabx hola! thank you for the link. yes this look nice system, easier and more beautiful but look like give me the same one value for every products. Anyway it's nice solution I will show to my boss . Thank you!
  3. Hi @3fingers Thank you for your reapply. Yes you are right about what I would like. But I have to make 1 product for every combination in the backend and the products are 9. The good things it's that I could select these 9 products using just the singole variation input, the 3 input radios an 1 select with 3 option. and that give me back the the value to which it corresponds and send it to the cart. Yes probably it's not about how write the foreach loop (I don't know), if there aren't a solution with the api. The foreach loop in all cases it will always give me a input for each value. Maybe it's about how make the products variation in the backend. but I don't really know how setup the fields in the backend. About the confusing, yeah could be, I'm not so advance! I need add style and js iteration and in this way works
  4. Hi, I try to make the choice of the products through the combination of two variations. But I have some problem doing this. Whit this code the two foreach give me back all the singular combination. Though, the value of the products are the same for both choices. I must be able to find the value from the combination of the two variants, color + angle = product. This is my code now: <?php if ($page->variations->count) { $addcart = "<form method='post' class='padloper-cart-add-product' action='" . $config->urls->root . "padloper/add/'>"; $addcart .= "<p>Colors</p>"; $addcart .= "<div class='append-buttons'>"; foreach ($page->variations as $p){ $addcart .= "<input class='{$p->color_choose->title}' type='radio' name='product_id' id='{$p->color_choose->title}' value='{$p->id}'>" . "<label class='{$p->color_choose->title}' for='{$p->color_choose->title}'></label>" . "</input>"; } $addcart .= "</div>"; $addcart .= "<div>"; $addcart .= "<span id='ask'></span>"; $addcart .= "</div>"; if ($p->angle_choose->title) {$addcart .= "<br /><select>"; foreach ($page->variations as $p) { $addcart .= "<option name='product_id' value='{$p->id}'>{$p->angle_choose->title}</option>"; } $addcart .= "</select>";} $addcart .= "<div class='value-button' id='decrease' onclick='decreaseValue()' value='Decrease Value'>-</div>"; $addcart .= "<input type='number' id='number' value='1' name='qty'/>"; $addcart .= "<div class='value-button' id='increase' onclick='increaseValue() 'value='Increase Value'>+</div>"; $addcart .= "<br /><input class='btn-cart' type='submit' name='pad_submit' value='" . __("Add to cart") . "' /></form>"; } else { $addcart = $modules->get("PadRender")->addToCart($page, $askQty = true); } ?> <?php echo $addcart ?> This give me this output: <form method="post" class="padloper-cart-add-product" action="/playwood/padloper/add/"> <p>Colors</p> <div class="append-buttons"> <input class="green" type="radio" name="product_id" id="green" value="1143"><label class="green" for="green"></label> <input class="green" type="radio" name="product_id" id="green" value="1141"><label class="green" for="green"></label> <input class="green" type="radio" name="product_id" id="green" value="1142"><label class="green" for="green"></label> <input class="blue" type="radio" name="product_id" id="blue" value="1139"><label class="blue" for="blue"></label> <input class="blue" type="radio" name="product_id" id="blue" value="1144"><label class="blue" for="blue"></label> <input class="blue" type="radio" name="product_id" id="blue" value="1145"><label class="blue" for="blue"></label> <input class="army" type="radio" name="product_id" id="army" value="1140"><label class="army" for="army"></label> <input class="army" type="radio" name="product_id" id="army" value="1146"><label class="army" for="army"></label> <input class="army" type="radio" name="product_id" id="army" value="1147"><label class="army" for="army"></label> </div> <div> <span id="ask"></span> </div><br> <select> <option name="product_id" value="1143">90°</option> <option name="product_id" value="1141">105°</option> <option name="product_id" value="1142">150°</option> <option name="product_id" value="1139">90°</option> <option name="product_id" value="1144">105°</option> <option name="product_id" value="1145">150°</option> <option name="product_id" value="1140">90°</option> <option name="product_id" value="1146">105°</option> <option name="product_id" value="1147">150°</option> </select> <div class="value-button" id="decrease" onclick="decreaseValue()" value="Decrease Value">-</div> <input type="number" id="number" value="1" name="qty"> <div class="value-button" id="increase" onclick="increaseValue() " value="Increase Value">+</div> <br><input class="btn-cart" type="submit" name="pad_submit" value="Add to cart"> </form> I need 1 input radio for each color and 1 option for the angle. I can do somethings like this? what I can do? Thank you.
  5. 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!
  6. 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(); }
  7. 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.
  8. 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!
  9. 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!
  10. 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.
  11. 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.
  12. Ok installed. thank you for the great help!!
  13. 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()
  14. 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; });
  15. 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!!
  16. @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!
  17. 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!
  18. 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!
  19. 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!
  20. I think to have fund a good way for the moment. Together with the two modules proposed by @theo and @Robin S I have used other one Site-wide File Manager. This model give you the possibility to have a recap about your upload file and see your are store, and also you can delete there directly form this model. Of cures, it's not like the filedtype where @theo working now here! this will be so great.
  21. @theo wow! I will like a lot give you my help, but I think that I'm not good enough, it's just few weeks that i work with PW and I have to understand a lot of things about it works. and honestly my php level isn't hight! But if you want you can write me I will try to help you anyway!
  22. Hi @Robin S, I try to echo an multiple options inside a class name. I can do using: $field = $fields->get('test_options'); or $fieldtype = $field->type; I use this: <div class="mix <?= $product->category_4->title ?>"> But I have multiple selection, and in this way the show me only the first option I check in the page in the backend. I have try to use : $options = $fieldtype->getOptions($field); But I not have understand how to make it work inside my code: <?php foreach($page->children() as $product): ?> <?php $image_sta = $product->img_statica->first; ?> <div class="mix <?= $product->category_4->title ?>"> <img src="<?= $image_sta->url; ?>"> <h3><a href="<?=$product->url;?>"><?= $product->title; ?></a></h3> </div> <?php endforeach; ?> Every time i try differente code he give me always the first option name. If I don't use the ->title this returns to me with all ID, but I can not use this ID I have to use the name of the options fields. I can do it? Thanks!
  23. First thank you to all for the help!! Great know there are many user active! @horst OK I think the this solution cloud work, so I have to make one hidden page like principal category and every page for each image to call it from the back-end page where I want show up the images, exact? Thank you @Robin S and @theo Media Library + fieldtype-assisted-url look interesting, I can use this and replace it with image fields, but if I do I will lost all the api image? this could be nice also because i can use it with external folder like make my image folder. no? @szabesz thank you I'll go see the page.
  24. Hello everyone! I'm Marco, It's my first website with Processwire and I like it a lot!! There is just a few things that i can not understand well. I try to looking in the forum but not have find an answer, so I write here my first question! When I create a new images field I can upload images only from outside website, I mean, I can not reuse the images I've already uploaded. Example if I have to load icons inside a repeater field I have to upload the images every time, and the system will create a folder for every images, with different url. There is an away for let me reuse the images I've already uploaded ? something similar at an option to choose from a madia library like for the CKEditor ? Thank a lot!
×
×
  • Create New...