Jump to content

Marco Ro

Members
  • Posts

    347
  • Joined

  • Last visited

Everything posted by Marco Ro

  1. HiGuy, I have a problem: I have move my website form nome_site/test/... to nome_site/... But all link in the backend still point to nome_site/test/... and also all the image. What I can do? I mean all page like Setup, module, Access point to nome_site/test/. There are some command I can run in DB for fix this? Why when I move from remoto to live in nome_site/test/... this problem not show up. I can re link all the image, is a long work but i can do, but for the internal page? why they poin to other link? Thank you
  2. Thank you @flydev do you know why at me show up this error? I see the documentation and I try to rewrite but don't have find a solution. I can not understand if the problem is in the loop like the alert or is in the line 47. The loop like write well, in the option you take the field options and get all the shipping_countrycode value, I think this is correct, I try to use different format like in the documentation but didn't work. like this: $field = $fields->get('shipping_countrycode'); $options = $this->type->getOptions($field); This not give me this error but all the process not work... ?
  3. Awesome! work so well! Thank you @flydev I did this, that work well but not very well.. wire()->addHookAfter('LoginRegister::processRegisterForm', function($event) { $form = $event->arguments[0]; foreach($form->getAll() as $f) { $name = $f->attr('name'); if(strpos($name, 'register_') !== 0) continue; if($name == 'register_subscribe_newsletter' && wire('input')->post->register_subscribe_newsletter == 1) { $mc = wire('modules')->get("SubscribeToMailchimp"); $email = wire('input')->post->register_email; $subscriber = [ 'FNAME' => wire('input')->post->register_pad_firstname, // work well 'MMERGE4' => wire('input')->post->register_shipping_countrycode, // send me the ID number ]; $mc->subscribe($email, $subscriber); } } }); I just followed the example usage of the Mailchimp module I just have change from $input->post-> to wire('input')->post-> as @flydev did and this work well! But for the country code it send me the ID of the option filed that I have created in the backend. I tried different things as to use register_shipping_countrycode->title like I use in others pages where I have an option flied (eg for category) but here didn't work. I look in the documentation but still not find a way, What I can do?
  4. For the checkbox in the RegisterForm I have already add a checkbox (for the privacy, putting obligatory) in the user template and than in the setting of the module I have add the field. We can do the same and have back an ID to use for the newsletter registration. or not?
  5. I @flydev sure think you for listening to us! What I ask in the post about the new module of MailChimp, is it possible to integrate with loginRegister module. This could be very helpful. The best is if we could have the possibility to add a check box in the registration form, to ask if want to subscribe for (eg) newsletter and connect directly with the MailChimp list. I see in the new MailChimp module (made by @daniels ) you can connect the form in this way // ... validation of form data $mc = $modules->get("SubscribeToMailchimp"); $email = $input->post->email; $subscriber = [ 'FNAME' => $input->post->firstname, 'LNAME' => $input->post->lastname, ]; $mc->subscribe($email, $subscriber); I try to see if I can make a hook, but the only thing that I sensed and should be done to ___processRegisterForm, where is the validation. I'm not really know how do it... ? Anyway, if you want to integrate inside the module this function will not need to do hooks. in this case, for not doing each one's own hook will be good if we can set form the backend the field to pass to MailChimp, eg I use also ask the country. Need some place where connect the $country to the MailChimp field. I hope this can be useful as an idea and to have explained myself well! ? Thank you!
  6. Thank you for the modules. it's so great! I don't know if some one have already try but, Is it possible to integrate this in the loginRegister module? I try to looking in the validation process of the module but I think at moment need make an hook to ___processRegisterForm, is it correct? If yes How I can do the hook? thank you.
  7. thank you @bernhard Now work well ? This is the code if some one need <?PHP function getUserIP() { $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; if(filter_var($client, FILTER_VALIDATE_IP)) { $ip = $client; } elseif(filter_var($forward, FILTER_VALIDATE_IP)) { $ip = $forward; } else { $ip = $remote; } return $ip; } $user_ip = getUserIP(); echo "ip: " . $user_ip . "<br />"; $http = new WireHttp(); $url = "http://ipinfo.io/{$user_ip}/country"; $response = $http->get($url, ['country' => '']); $country = filter_var ( $response, FILTER_SANITIZE_ENCODED); // the country have a hiddend code echo = $country; // This is the correct code to use ?> In both case that return the correct Country Code.
  8. There are some API for the geolocation? To explain the situation better: I have to hidden some element for not Italian country. At moment I have do this: $.get("http://ipinfo.io", function (response) { var country = response.country; if(country != "IT"){ $('.my-class').hide(); } }, "jsonp"); But I know it's not a good way!! I try to insert this is a php if condition to not print nothing, but is not easy let js and php work together. $.get("http://ipinfo.io", function (response) { $("#country").val(response.country); }, "jsonp"); <input hidden id="country" type="text" name="country" value=""> This work well and show me the country code (eg. IT). I try to get this value and insert in a IF but of course the $_GET can't work... $country = $_GET['country']; $nation = "IT"; <?php if ($country != $nation): ?> Code to hidden here... <?php endif; ?> Does PW have any APIs that I can use? or do you have any idea. I know I'm not a php-hero ?
  9. yes @wbmnfktr is true, some time to make a completely schema can mean a lot of work! With pw is possible to create on the template an excellent base that is already enough! I agree with you about the Reviews, I will wait at the moment and test it later with some really reviews when we will have. The thing about the star ratings is that you can not have if you don't have any review. About the Google Business yes was the one for the local seo, this also can work like a reference page. But you're right, I checked better and is not in correlation with the Structured Data. It's better use for other way. Instead the Search Console could be connected. Thank you! also for the note it's very good to know!! I will test it.
  10. @wbmnfktr I do not have the same amount of sites as feedback but I think like you. Specially for the products or whatever if you sell something have a Rich snippets is so important. I think this is more the a Implementation: medium. Everything grow your CTR just a bit must definitely use it! I don't know if you never use but how use the Review and aggregateRating ? This could be important to increase product reliability and trust in the site, and for what I know (i never try) if link Google Business the review will be connected to the specific product and show up on the google page and in the snippets you can see the yellow star if it's using the aggregateRating tag. But I don't really feel to add the Review directly inside the Structured Data. What you think about?
  11. If I want to show both in the same page, how I can do? I tried to make an array like this $input->get->["register, login"] = 1 But yes I know it's wrong. UPDATE: Ok I have fund the solution in this way: <div> <!-- The Modal --> <?php $loginRegister = $modules->get('LoginRegister'); $out = ''; if(!$config->ajax) { // if not ajax, show markup $out .= ' <div> <!-- The Modal --> <div id="myModal" class="modal"> <!-- Modal content --> <div class="modal-content"> <span class="close">×</span> <div id="LoginRegisterDiv">'; } // call the module LoginRegister $out .= $loginRegister->execute(); // this render the login form if(!$config->ajax){ $out .= '<div>'; } $input->get->register = 1; $out .= $loginRegister->execute(); // this render the register from if(!$config->ajax){ $out .= '<div>'; } if(!$config->ajax) { // if not ajax, show markup $out .= ' </div> </div> </div> </div>'; } $content = $out; // delayed output // or echo $out; // direct output ?> </div> I load the form inside a modale box, for this there are more code. But the focus still is in creating two different separate renderings.
  12. Hi Guys, First thank you for sharing your knowledge! These post help me a lot! I have also created a separate php file, but I have a doubt because from manuals should be inserted in the <head> and I have just include the php file inside it. But if I think well it in the web inspector I have never seen any code referring to the Structured Data like <script type="application/ld+json">. Why this? OK, maybe I may not have seen enough sites, but I can not find even on well-known sites. Could be a great if I use a js file and adding this? or I see many site have only the google tag manager link. Do you think the google tool are better and is enough?
  13. yes I have add title and text, sorry. now I have delete it and let only ?url={url} but not change. I had added those tags to prove if they were needed. But even without works in the same way.
  14. I saw only these: Here there are 3, that works so well. I will like let it works like these. here on more.
  15. ok understand. so this is something new, I had seen on other sites this module work well. How did you solve for your sites now? I mean, you keep use this modules or add the facebook share button?
  16. Hi, When I share on (eg) Facebook, after the click on the icon it's open a windows like this one: And only if i click many times on the Share Button that load the image and description. why this happen? is there anything I can do to make the window with img and text load immediately after click on the icon?
  17. Thank you @benbyf lol now I understand why he did not work! I need to add EUR like a currency I will try to do! thank you.
  18. Hi, If I add to Default currency: EUR the form not show me the currency icon and during the payment give me beck an error of Invalid currency. I using Padloper, if I set the currency in Padloper setting and left empty PaymentStripe this work well. But I need not set the currency in Padloper. so, I can anyway set currency in the Stripe module? Thank you
  19. I have both but there aren't any errors or warnings. Because the problem was in how the css. Sorry. Anyway I have fix also the Server Locale problem adding xx_XX.UTF-8 to all language in LanguageSupport.module. Thank you!
  20. Thank you @dragan the waring it's disappeared. But the issue still present. I know it's strage what happen. Do you know why could a link not work in mobile and push me out form the backend?
  21. Hi, First this it's a bit strage: There are few links that not works, but only in mobile and only in English language. In desktop works well in all language. Other things strage it's this: When I try to go in these pages on the finish of the link it's add .../#undefined and the content it's not visible, but I can see still present on the inspector web. If, on the inspector web, I came back from mobile to desktop the page return visible and in the url it's write .../#null And (very strange) when I go to these pages (on the inspector web set to mobile) I'm push out from the backend. The only waring that I see it's this one. But I think it's not like the problem. Warning: your server locale is undefined and may cause issues. Please translate the “C” locale setting for each language to the proper locale in /wire/modules/LanguageSupport/LanguageSupport.module (shortcuts provided below): Some on know what happens? Thank you.
  22. ok, but I have move outside pw the engine.php, now is in the same folder of site and wire folders. If I use the normal $email = urldecode($_POST['email']); I can take data to send the e-mail. so, I need anyway to make a template inside the site/template and create a template e page in the backend? I found the problem and not was about pw. I don't need use parse_str because the date are already in array. So $POST = $_POST; it's enough.
  23. Sorry @Zeka there is the possibility the pw block or do something else to the data ? if I try to use parse_str to decode them not works? I mean I have this ajax: var data = $("#FormWksp").serialize(); //chiamata ajax $.ajax({ type: "POST", url: "form-wksp-engine.php", data: data, dataType: "html", success: function() { alert("success" + data ); }, error: function() { alert("no success " + data); } }); And then I try to take it in this way in the engine.php file $email = urldecode($_POST['email']); // this works $phone = urldecode($_POST['phone']); // this works $company = urldecode($_POST['company']); // this works $nation = urldecode($_POST['nation']); // this works $messaggio = urldecode($_POST['messaggio']); // this works $_POST_data = urldecode($_POST["data"]); // this no works $articles = []; parse_str($_POST_data, $articles); $nome = $articles['nome']; // this no works I will use the $articles for make a foreach($articles as $name => $value). But suppose the $_POST_data = urldecode($_POST["data"]) or $_POST_data = $_POST["data"] get the data, but is not so. Could be the pw in some way do something? Because now I move outside the root the engine.php for test it, and works, but this data not pass.
  24. There is a big world around PW! every time discover something new it leaves me speechless! But yes, don't have possibility to directly access php files in the "templates" directory and other locations in PW's file system it's really a great things! Good to know, I was going crazy o.o Thank you (again) @Zeka fro your support!
  25. Hi guys, I'm not sure if this is a pw issue, anyway I would like to check. I have ajax call for a contact form that give me back every time an 404 error. I tried differente solution but doesn't work. I tried: <?php echo $config->urls->templates?> <?= $pages->get('/')->url ?> In both cases the url isn't wrong, but in console keep show me the 404 error. This is my ajax code var datiform = $("#Form").serialize(); $.ajax({ type: "POST", url: "<?php echo $config->urls->templates?>form/engine.php", data: datiform, crossDomain: true, dataType: "html", success: function(){ alert("success" + datiform); }, error: function(){ alert("no success " + datiform); } }); I can't understand why <?php echo $config->urls->templates?> not works, if it works well example for the pictures.
×
×
  • Create New...