Jump to content

kongondo

PW-Moderators
  • Posts

    7,379
  • Joined

  • Last visited

  • Days Won

    139

Everything posted by kongondo

  1. Hi @Jan Fromm. Glad it worked! Yes, you will need a custom field. Customers do not have their own template You would need to add the field to the order template itself (padloper-order). Please see Demo 2. It explains how you can do this. Good idea. But there are alternatives with respect to the Notes feature. Also see the caveats below. Apologies. Documentation is still lacking. Notes are stored in the field padloper_notes. This field is used in the template padloper-order. Padloper notes are a type of WireArray. You have access to all the methods of WireArray. Back to notes... Caveats Dedicated Text or Custom Field OR Notes Given that padloper_notes can take multiple notes and given that some of these are generated programmatically, using it to save a very specific note as described in your case might not be the better approach. For instance, you would need to search the WireArray of Notes for your 'reverse charges hint note' before you can display it on their invoice. Searching is not a big deal as you would be searching the WireArray in-memory, however, you will need some key words to match the note you are looking for amongst the order's other notes. An alternative is to add and use a dedicated text field in the order's template similar to the customer's VAT number above. A third alternative is to create your own custom field to store both notes and VAT numbers. Just a few thoughts. If you want to add a note using the API, it is quite simple as shown below. This example assumes you are doing this via a Hook. <?php namespace ProcessWire; # CONTENT OF A HOOK METHOD # /* if hooking $this->addHookAfter('PadloperProcessOrder::orderSaved', null, 'nameOfYourHookFunction'); */ // Retrieve argument by name /** @var Page $orderPage */ $orderPage = $event->arguments('orderPage'); $orderNoteText = "The text of my note. This customer has a VAT..."; # @note: this method will add tje created and modified times for you # you can add your user ID if you want, as the 3rd argument to this method /** @var WireData $note */ $note = $padloper->buildNote($orderNoteText,'admin'); $orderPage->of(false); // add the $note to the order page $orderPage->padloper_notes->add($note); // save the page $orderPage->save('padloper_notes'); # --------- OR ------------- // $notes = $orderPage->padloper_notes; // $notes->add($note); // $orderPage->setAndSave('padloper_notes', $notes); Method to Hook Usually hooking into __orderSaved would be fine. However, this method will be called every time the order is amended during the payment process. For instance, a customer can go to checkout and enter their details. This will cause an order to be created. Whilst in the order confirmation/payment page, the customer could decide to amend their shopping cart and subsequently head to the checkout. Since we already have an order created, it won't be recreated, however, it will be amended if needed, hence orderSaved() will be called again. This might mean your note would be created multiple times. You might not want this. You could always check if such a note exists for the given order and amend it if necessary. To avoid this, it could be better to hook into the PadloperProcessOrder::sendConfirmation() method instead as shown below. This method will be called only once, when the order checkout processing is complete. <?php namespace ProcessWire; # CONTENT OF A HOOK METHOD # /* if hooking $this->addHookAfter('PadloperProcessOrder::sendConfirmation', null, 'nameOfYourHookFunction'); */ $padloper = wire('padloper'); // @NOTE: Retrieve argument by name <- won't work since argument value is Null // instead, we get the orderPage from the session /** @var Page $orderPage */ $orderPage = $padloper->getOrderPage(); // ------------- $orderNoteText = "The text of my note if sendConfirmation() Hook. This customer has a VAT..."; # @note: this method will add the created and modified times for you # you can add your user ID if you want, as the 3rd argument to this method /** @var WireData $note */ $note = $padloper->buildNote($orderNoteText, 'admin'); $orderPage->of(false); // add the $note to the order page $orderPage->padloper_notes->add($note); // save the page $orderPage->save('padloper_notes'); Hope this helps!
  2. Hi @gebeer. I have now added this feature to MM 013. I have also added fixes for the issues you've raised above (MM missing required value; PagePaths vs settings issue and finfo_open(FILEINFO_MIME_TYPE) for JqueryFileUpload). Are you able to please test this new version for me before I release it? I have sent you a PM with details. Please note this version needs version 009 of JFU. Thanks.
  3. Great catch! Some users have reported this in the past but never managed to nail it down to PagePaths! I'll have a play and get back to you. Thanks!
  4. Thanks for reporting. Looks like a rookie mistake on my part. Good solution. I'll probably use wireClassName() or wireInstanceOf().
  5. @alexm I have not seen this setId() on null error since Padloper 1! 😒 Not sure what's going on here. Sorry about this. Are you able to recall the steps to reproduce the error? Looks like a payment gateway page is not reachable for some reason.
  6. @csaggo.com Thanks for the detailed instructions. I'll create this setup on a fresh install and hopefully be able to replicate. I'll then report back here. Thanks.
  7. Hey @alexm Happy Sunday! Sounds like a good idea! Will need to think about the product title of the clone or maybe let ProcessWire handle it if possible. In addition, would need to take care of variants. I'll have a think. How do you check if page clone is enabled? Thanks.
  8. @csaggo.com. Great find! Thanks for looking into this. I'll try to reproduce. Please clarify this: Do I? Install ProcessWire and select a non-language profile. Activate language support (not sure how to do this - never done it before; are there instructions somewhere? thanks) Default-language in place: is this English? Import translation files: Never done this before. A hint or guide would be helpful, thanks...
  9. No, unless security related. With respect to MM, I am moving to use an in-house htmx-alpine-js-tailwind-css solution. Most welcome. I'd certainly look at PRs. Thanks!
  10. Hi @gebeer, Thanks for using MM. Thanks for reporting this. I went through a lot of back and forth with this module in this respect. There were a number of conflicting experiences and/or recommendations out there. For instance: The above is considered by some to be insecure. I had this as an option for a time until I found out it was deprecated. But I have now found it was 'un-deprecated'! I'll have a think as I am in the process of writing the next version of MM. JFU will no longer be a dependency. In fact, we won't even need jQuery for it.
  11. Based on this comment: Plus activity and familiarity, I am also thinking summernote 😁, or Trumbowyg. Although there is a million other possibilities here.
  12. Hi @bubu2110, Welcome to the forums. Please see the following documentation for Media Manager: Media Manager Objects - link. Accessing Media Manager Objects Properties - link. Other topics listed under Frontend Output of Media Manager Fields would also be of interest. Please let me know if you require further assistance.
  13. daisyUI - A Tailwind CSS component library. Anyone tried it?
  14. @ID Studio Web Agency. Simply breathtaking! Wow!
  15. Hi @Sonia Margollé, Apologies for this. The issue is what is described here and here in SO. In short, I develop on a Windows machine where filenames are case insensitive. Until now, I have been changing the filenames manually but didn't realise Git wasn't picking up the change. Hence, the offending file remained as PadloperPaymentPaypal.php instead of PadloperPaymentPayPal.php. On your remote server, you are probably running Linux, in which case filenames are case sensitive. Hence, PHP cannot find the file. Solution Please rename the file... /site/modules/Padloper/includes/payment/PadloperPaymentPayPal/PadloperPaymentPaypal.php To... /site/modules/Padloper/includes/payment/PadloperPaymentPayPal/PadloperPaymentPayPal.php I have also re-uploaded Padloper 007 with this file now renamed. Please let me know if this solves the issue. Thanks.
  16. Yep. That's exactly it. My bad, docs are still lagging. This should be one of the following: <?php namespace ProcessWire; $p->productID; // aliases $p->lineItemProductID; $p->orderItemProductID; Let me know if it works.
  17. Hi @alexm, Strange. It works here. Both $order->payment and $order->paymentMethod should work (see TracyDebugger grab below). Screenshot Just confirming that you have a custom order-complete.php at /site/templates/padloper/order-complete.php ?
  18. @Greg Lumley, Just to be clear, did menuRender() used to work in an older site but isn't working in a newer site? If yes, what is the difference between those sites in relation to: ProcessWire versions? <-- I suspect the issue is here perhpaps. PHP versions? Thanks.
  19. @xportde. Thanks for catching this. I'll work on it, hopefully soon. I am (very) slowly moving all my modules to require at least PHP 8.x. Thanks!
  20. Thanks for this example @Tyssen. Out of curiosity, how do you use $currentID subsequently?
  21. Hi all, Sorry, I have been away from this parts of the forums for a while. @Clarity I am not sure I follow. Please clarify, e.g. with an illustration. Does this post perhaps offer a solution?
  22. Hi @Spinbox, Thanks again for catching and reporting this as well as providing a test environment. The issue has now been fixed in today's release (007). As stated in our communication, it was caused by Padloper uninstaller not checking for Padloper items in the trash. This would cause a fatal error when attempting to delete the Padloper templates still in use by the Padloper items in the trash. Version 007 is ready for download. Thanks!
  23. I have tested with Padloper 0.0.5 and it still works OK. I think it's time I had a look at your site, if that's OK. I'll PM you with more details, thanks.
  24. Hmm. This is very strange. That error message is not one that is related to Padloper uninstall/removal actions. It is related to edit actions (bulk, single page, etc). I have tested with Padloper 004 and it works. Could you please confirm which Padloper, ProcessWire and PHP versions you are testing on? Thanks.
  25. Hi @alexm, This is now possible in version 006 released today. You can hook into PadloperProcessOrder::getOrderCustomer. Demo code is here including comments in the code and a README. Give us a shout if you need further help with it.
×
×
  • Create New...