• Content Count

  • Joined

  • Last visited

Community Reputation

46 Excellent

1 Follower

About MarcoPLY

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

Profile Information

  • Gender
  • Location
    Reggio Emilia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. MarcoPLY

    Yes. I'm not sure how I'll approach it though. It's just an idea at the moment. Can we have something like ready-api.php page, with all the variable for use just like a endpoint for connect with the API of any carriers ? Could be a backend page where for each of our Padloper fields there are editable fields to connect with the carriers API. Also will be great if there are the fields for add the link of the carriers page where send the data. Or maybe could be just a page where there are a recap of our API + documentation and that in a separate php page we will write our code.
  2. MarcoPLY

    Thanks a lot @flydev. Ok, so, I have to use wire() becasue the hook is ouside the class. and I need also call $pages = $event->object. But aren't the data store in the argument? why I have to call pages object? Unfortunately the hook does not work. I think now the problem is how access to the correct date to send to Mailchimp. The Dumps I see empty, but in the Logs page now I have the Login-Facebook and I can read: Created new user: name-surname then Updated user 'name-surname' fields: role:login-register, pad_firstname, pad_firstname, pad_lastname and then Used Facebook to login for user: name-surname There isn't the email, could this be the problem that does not generate the user in Mailchimp? But, on the user page the email has been added successfully, for this type of hook only need this, correct? I can't find anywhere bd($mc). I try also to use $email = $page->email; and $email = $this->wire('user')->email but but not work, also try $email = wire('input')->post->email I know the input post it's use only in the form but I just to try. Any Idea?
  3. MarcoPLY

    Sorry @flydev, I think to have read all the documentation and forum post. I have trie all the code that I thinked was correct, using the method Pages::saved, Users::saveReady, saveReady. Try trying to start the hook with $this->addHookAfter, $pages->addHookAfter, wire()->addHookAfter but no one worked. I also thought the problem was how I was trying to access the data so I try $email = wire('input')->post->email, $email = $page->email, $email = $this->wire('user')->email. Could you tell me pleace where I wrong? This should not work? $this->addHookAfter('Pages::saveReady', function($event) { $page = $event->arguments[0]; if ($page->template == "user") { $mc = wire('modules')->get("SubscribeToMailchimp"); $email = $this->wire('user')->email; $subscriber = [ 'FNAME' => $this->wire('user')->pad_firstname, ]; $mc->subscribe($email, $subscriber); } }); All the method that I used I think are correct. So, my error need is in how I call the hook and/or how I access the data. The file is in my ready.php so like the documentation I have to use $this-> but not work. In the documentation about hook I read to use wire() if the hook it's ouside the class like it's the module. I try to follow your exemple here and write the hook like you did and call teh module using wire(). So, sure there are something that I do not understand. :(
  4. MarcoPLY

    Thank you @bernhard, I see the post after post this topic. Before to write I was looking in the search bar for "Git" and other kayword but this post not show up. Before to write this post I find other posts but dosen't really resolve my doubt. I hoped there was a simpler solution those in the posts below that are very complex solution. But I can understend that maybe thare aren't a easy way. Probably you have say the faster way use import/export tools.
  5. Is it possible to sync two installations in this way? Site ----------> DB1 Site-dev ----> DB2 On site-dev I realize all my changes etc ... When I finish I would like to move all the changes made in site-dev + DB2 to Site without losing the information contained in the DB1 but only updating and modifying the DB1 in the parts that have been changed or are missing. In other words: I have to do a series of updates. But while I work the main site continues to exist and to regulate users and orders. This new data is not uploaded to the dev-site. So when I have finished making the changes I will miss the data that have been created in the meantime, and if I reload the db I lose this data. How can it be done? I would not like to export and import users and orders manually. Is there a way to synchronize the two installations, that they don't overlap but that they complete themselves?
  6. MarcoPLY

    Thank you @flydev. I try but there are some point that sure I do not understand. I'm reading the hook post. But probably I still make more then one error and this make hard debug the hook. wire()->addHookAfter('Pages::saved', function($event) { // Use wire() because the function is outside of a class. It's in my ready.php // Use addHookAfter becasue I need to have all the fields populated before I can use them. $page = $event->arguments(0); // here set to have the access to all the data in the page (rigth?) if($page->template == "user"){ // if the page saved it's a user page if ($user->hasRole('login-facebook')) { // (I'm not sure if I have to use $user or $page->fields) $mc = $modules->get("SubscribeToMailchimp"); // call the module take the fields and send it $email = $page->email; $subscriber = [ 'FNAME' => $page->pad_firstname, 'MMERGE4' => $page->$country_title, ]; $mc->subscribe($email, $subscriber); } } }); UPDATE I keep try to find a way to do the hook, but not with great result. I have also try to use Users::saveReady. wire()->addHookAfter('Users::saveReady', function(HookEvent $event) { $page = $event->arguments(0); if($user->hasRole('login-facebook')){ $mc = wire('modules')->get("SubscribeToMailchimp"); $email = $this->wire('user')->email; $subscriber = [ 'FNAME' => $this->wire('user')->pad_firstname, ]; $mc->subscribe($email, $subscriber); } }); I think to have a bit of confiution about the structure to how make a hook.
  7. I'm trying to add an action in the moment a new user registers and his page is created. Specifically, when a user is registered with the Facabook module, send the notification to Mailchimp and add it to the list, this with the mailchimp module. I think the problem could be in how I set the hook and in the page data. I hope I didn't make too many mistakes! sorry for this. wire()->addHook('Pages::saved', function($page) { if($page->template == "user"){ $user = $page; if ($user->hasRole('login-facebook')) { $mc = $modules->get("SubscribeToMailchimp"); $email = $user->email; $subscriber = [ 'FNAME' => $user->pad_firstname, 'MMERGE4' => $user->$country_title, ]; $mc->subscribe($email, $subscriber); } } }); I try also to use LoginFacebook::createNewUser but I'm not sure how use it. For this I move to do an hook directly when a user page is created. (that also coulde help me for others projects) .
  8. MarcoPLY

    Hi @daniels, thank you for your reapply! eheh, yes you have right. I explain better what I have to do In addition to the loginRegister module I also use the registration via Facebook. This registration bypasses the registration form and don't send the data to mailchimp. I thought about making a hook for all the users that are registered, regardless of the method. Then use Pages::saved (I'm not sure it's right) and pass data to mailchimp when the user's page is created. But the attempts I tried don't work, I'm probably wrong the way I access the data. Do you know how can I create this action, to send the data to mailchimp when the users page it's created? (Sorry, I have thought just now that maybe this was a question to put in general)
  9. MarcoPLY

    How can I use this moule for all users who are saved with a specific category? I'm not sure which Class and method need to use and also maybe I not get the correct fields. wire()->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); if($page->template == "user"){ if ($user->hasRole('login-facebook')) { $mc = $modules->get("SubscribeToMailchimp"); $email = $page->email; $subscriber = [ 'FNAME' => $page->pad_firstname, 'MMERGE4' => $page->$country_title, ]; $mc->subscribe($email, $subscriber); } } });
  10. MarcoPLY

    Hi, I try to make a hook for adding the new user in the Mailchimp list using the module "Subscribe To Mailchimp" by @daniels. This code doesn't work. I didn't understand what facebook fields I should use and if I made any other mistakes. Someone can help me please. Hook still to be hard to learn! wire()->addHookAfter('LoginFacebook::createNewUser', function($event) { $u = $event->arguments[0]; // get user object $mc = $modules->get("SubscribeToMailchimp"); $email = $u->email; $name = $u->$userName; $country_title = $u->$country_title; $subscriber = [ 'FNAME' => $name, 'MMERGE4' => $country_title; ]; $mc->subscribe($email, $subscriber); } }); Also, I would like to add this condition: if the user makes a new registration, the privacy checkbox should automatically be marked.
  11. MarcoPLY

    Thank you @kongondo all this is perfect! No worry for the padloper post, sure the new one will be great also for the other question! Compared to what others have said, I can only add that it might be useful have the e-commerce users in a separate page like a Padloper Customers, also for the abandoned carts, maybe with tag for better filter the useres beetween purchased, not purchased, registered and unregistered. About the problem for the anonymus customer, those who aren't registered but have made a abandoned cart without arrive to the confirmation of the data, I think we can use the data only for statistical purposes to know what was in the cart. So, maybe they can only register as IP addresses in this way we can know also where come from. I swear they are the last requests Will be good if the user isn't registered add a checkbox at the end of the checkout form to ask if he wants to register. Cloude be a backend question. For the Shipping Price coulde be useful if we can also trigger for the total cost of all items. Always for Shipping Price, could be an option, in the category shipping backend, calcolate the costo adding the singular shipping prices or only take the highest, as it is now.
  12. MarcoPLY

    Hi @kongondo First thank you for your work! In this moment we are using the unpublished order section, that is generated in the confirmation page, as if they were abandoned carts. Which is correct, but it would be useful for marketing to have all abandoned carts of the users. Would it be possible create the order page as soon as they insert a product into the cart? and insert them a specific page such as Unpublished Orders. In this way we can have track about what people add to the cart and if that useres are login we can also know who is.
  13. MarcoPLY

    Hi @adrian, I was working with geoip.nekudo (it was among the services you suggested in another post) and so, geoip.nekudo it's not more free service it was bought by
  14. I have this simple structure with two separate pw installation: Root |----Site-one ( |----All Pages |----Site-two ( |----All Pages There are few page that would be very nice if I could update them in site-one and show it on the site-two without changing the domain. Is it possible Share contents between two different installations? There are some IPA that I can call the contents from the site-one installation? I try to looking in the forum and I find a link to a module call service-pages but all link give me error 404, also I see the rss module but I'm not sure that can call all the contents from the site-one pages.
  15. MarcoPLY

    Thank you @BitPoet, the problem still unsolved. The images are loaded inside the folder, I checked via ftp. But after a few hours/day they are deleted. This only happens in a folders with lots of images inside, if I create a new one and reload the images this problem is solved. There are no notice about the memory issues, could it always be this?