Jump to content

kongondo

PW-Moderators
  • Posts

    7,379
  • Joined

  • Last visited

  • Days Won

    139

Everything posted by kongondo

  1. @alexm. Customer details live in the field 'padloper_order_customer'. Example: <?php namespace ProcessWire; /** @var Page $orderPage */ $orderPage = $padloper->get("id=3207");// order page ID /** @var WireData $orderCustomer */ $orderCustomer = $orderPage->padloper_order_customer; $out = ""; $out .= $orderCustomer->firstName; $out .= $orderCustomer->middleName; $out .= $orderCustomer->lastName; $out .= $orderCustomer->email; $out .= $orderCustomer->isTaxExempt; // PRIMARY ADDRESS $out .= $orderCustomer->shippingAddressFirstName; $out .= $orderCustomer->shippingAddressMiddleName; $out .= $orderCustomer->shippingAddressLastName; $out .= $orderCustomer->shippingAddressPhone; $out .= $orderCustomer->shippingAddressCompany; $out .= $orderCustomer->shippingAddressLineOne; $out .= $orderCustomer->shippingAddressLineTwo; $out .= $orderCustomer->shippingAddressCity; $out .= $orderCustomer->shippingAddressRegion; $out .= $orderCustomer->shippingAddressCountry; echo $out; // ------ // ETC @see: https://docs.kongondo.com/api/order.html#padloper-getordercustomer for full list of properties. Note that getOrderCustomer() cannot be used in this case. That is only available during an order session. However, the customer properties remain the same, i.e. firstName, billingAddressPostalCode, etc.
  2. Hey @alexm, I see your point. I'll need to have a think. Padloper currently has a number of statuses for payment, order and shipment. Not all are currently in use/editable but we'll work them in in the future. There is a status for 'shipped' which would equate to your 'despatched', i.e. on its way. Delivered is exactly that; 'someone received the shipment' {unless....don't get me started about Evri, Amazon and you-know-who-stole-your-parcel'} 😁 I'll add to my TODO list. Good catch, ta.
  3. Hi @alexm, Nope, it's not you, it's me :-). This is by design. I cannot recall what my thought process was then but now that you mention it, I think it makes sense to show the full shipping address. Unless others have a strong opinion, I'll change it to that. If there are strong opinions otherwise, then we can make it configurable or hookable. Will add to my TODO. Meanwhile, if you really must change it now, gimme a shout.
  4. Hi @David Karich, I would have to look into this since I haven't worked with focus points before. My guess is that they are saved with the image, in which case they will be saved with the record for the original image in the MM page (i.e., not the page where the MM image is referenced in an MM Inputfield). I'll see if/how I can extend FieldtypeMediaManager to store focus information (and perhaps other info developers might be interested in) which you will be able to access via the MM object. I am hoping there will be no need for breaking changes. However, until I finish building it, I cannot promise. If such changes are inevitable, I'll provide code for migration. However, with the minimal progress I've made so far, I haven't encountered any breaking changes.
  5. Tight! Perhaps I could start with a soft upgrade/update that includes a hook that will allow you to retain names but not sure how this would work at the moment. Having said that, you can achieve what you need manually (not ideal, I know)....by opening the media for editing (in MM), uploading your new image and deleting the old one. Save and you are done. In future I'll think of how one can drag and drop over an existing media to replace it.
  6. Hi all, Media Manager Next/013 Sorry I haven't posted here in a while. I am currently working on the next version of Media Manager. It will part be refactoring and part be some new (some requested) features. I have been having some very helpful conversations with a number of you. Below are the current plans for the next version. Any other thoughts and/or ideas I should consider? It is a bit of work so I might have to stretch this into several updates (versions). Thanks. New Features Upload from external sources (Amazon, Google, etc.). Point media to external resource (e.g. to a video in YT, Vimeo, etc.). Independently set media title on upload Improve/extend media filter/profiles to MM Inputfields (possibly pick and apply a profile from a list) (thanks @gebeer) PDF thumb preview (thanks @gebeer) Upload and replace media (for single media MM inputfields). API (thanks @MrSnoozles) Any other thoughts.....? Refactor Remove dependency on JqueryFileUpload Remove dependency on jQuery -> use htmx and alpine JS instead. Easier to maintain for me as well as more flexibility. Improved preview of media and their properties. Better preview of media before upload. Redesigned GUI - Intuitive (like GDrive(?)), do away with media menus (use filters instead), need oMedia is just media. Remove/reduce use of modals. Allow grouping of media (link an album) <- not yet confirmed if will be implemented Implement hookable methods to allow easier developer control for those who need advanced/custom control of their MM. A number of reported bug fixes as well. ETA? I cannot give a firm date about this, sorry.
  7. Great work! Thanks @gebeer. I wonder if sanitizer name has something to do with this? Thanks for the suggestion. Noted for the next version. They are meant to show after bulk actions such has publishing, deleting, etc. as well as when uploads are done via drag and drop (in single or all media pages and when uploading directly to an MM Inpufield). In my testing now, I see the notifications in the GUI (upper right) except for when uploading via drag and drop in the single or all media pages in MM. I'll look into this in the next version.
  8. Hi @Jim Bailie, Apologies for the delay in responding. Thanks for the interest in MM. There is a setting for what to do when an attempt is made to upload a media whose filename matches one that already exists in the Media Library. The current options are skip / rename / replace. This currently does not cover your use case. This is because currently the media page is automatically created (on upload) off of the file name. Hence, in your case, lion.jpg would create a new media page title Lion. A similar request to yours has been made with respect to replacing the media in a Media Manager inputfield that stores only one image. In order to replace the media, one has to first delete the existing single media. It would be more intuitive and easier to (similar to PW) to just delete the existing media by the new one. I am currently working on a new version of Media Manager that amongst other things will have an option to give uploaded media custom names instead of grabbing this from the file name. I can add your scenario usage to the TODO list for this next version.
  9. I am hoping very soon. I am currently working on a 'Gift Cards/Vouchers' feature after which I'll work on 'Discounts'.
  10. Hi @Spinbox, The usual ProcessWire page view, edit, add, etc. permissions apply. The generic 'padloper-shop' permission will not cover all use cases especially since Padloper pages are live under admin in the pages tree. I suggest you create a role(s) for your use case and apply the appropriate permissions to this role. Please see roles and permissions docs for detailed information Please note that although those docs also detail how to use the API, you can use the ProcessWire GUI to accomplish this task. This: might be handy. Perhaps you can target the top most parent page with a padloper template, i.e. /shop/padloper/. It uses the template 'padloper' Hope this helps, otherwise let me know if you get stuck.
  11. Glad you got it sorted! Would love to see some screenshots if that's possible, just as a showcase of addons, thanks 😀.
  12. Hi @alexm, Fixed in Padloper 008 released today.
  13. Hi @alexm, Finally, fixed in Padloper 008 released today!
  14. Fixed in Padloper 008 released today.
  15. Fixed in Padloper 008 released today.
  16. Hey @joe_g, Removing a product requires the ID of the item in the cart. Here's an example: <?php namespace ProcessWire; // ================== // Just an example; you might be getting your product using a different approach $product = $padloper->get("template=product,id=1190"); bd($product, __METHOD__ . ': $product at line #' . __LINE__); /** @var array $cartItems */ $cartItems = $padloper->getCart(); // ALL CART ITEMS bd($cartItems, __METHOD__ . ': $cartItems at line #' . __LINE__); // FILTER CART ITEMS TO get the one product you want // PHP 8.X /** @var array $productInCart */ $productInCart = array_filter($cartItems, fn ($item) => $item->product_id === $product->id); bd($productInCart, __METHOD__ . ': $productInCart - at line #' . __LINE__); if (!empty($productInCart)) { // get first matched item FROM ARRAY /** @var stdClass $productInCart */ $productInCart = reset($productInCart); bd($productInCart, __METHOD__ . ': $productInCart - RESET - at line #' . __LINE__); } else { // HANDLE THIS PRODUCT NOT FOUND IN CART } ?> <form method="post" class="padloper-cart-add-product flex ml-auto" action="<?= $config->urls->root ?>padloper/add/"> <?= $session->CSRF->renderInput() ?> <input type='hidden' name='product_id' value='<?= $product->id ?>' /> <input type="submit" value="Add"> </form> <!-- @NOTE: we need the ID of the item in the cart --> <form method="post" class="padloper-cart-remove-product flex ml-auto" action="<?= $config->urls->root ?>padloper/remove/"> <?= $session->CSRF->renderInput() ?> <input type='hidden' name='product_id' value='<?= $productInCart->id ?>' /> <input type="submit" value="Remove"> <?= $productInCart->id ?> </form> Please let me know if you need further assistance with this.
  17. <?php namespace ProcessWire; // empty the whole cart $padloper->cart->emptyCart();
  18. Yes, that link is only about adding. The argument you pass here should be the ID of the cart item, not the product ID, i.e., <?php namespace ProcessWire; // ================== /** @var array $cartItems */ $cartItems = $padloper->getCart(); bd($cartItems, __METHOD__ . ': $cartItems at line #' . __LINE__); foreach ($cartItems as $cartID => $cartItem) { /** @var stdClass $cartItem */ echo "The ID of the cart item is: {$cartID}<br>"; // OR // echo "The ID of the cart item is: {$cart->id}<br>"; // REMOVE CART ITEM $padloper->cart->removeProduct($cart->id); // OR // $padloper->cart->removeProduct($cartID); }
  19. Supplementary to our conversation via PM, please also see this topic:
  20. Hi J, This is a very good suggestion. Please check your PM. Thanks.
  21. Hi @joe_g, In-built discounts feature is a planned feature. For now, you can achieve this via a Hook. This is not a good way to do it, as you have now found out 🙂. Implementation will (for now) be via a Hook. Before this though, you need to make a decision about the logic. For instance: Is the discount applied before or after tax? Is it applied (if relevant) pre- or post- shipping costs? This is especially relevant for 'fixed discount' type. Are you applying the discount automatically at checkout or via processing a form with an input(s) for discount code(s)? If the latter, you will need to process validity (e.g. discount available on system and is not expired, etc) and limits (e.g. used once only). How to manage the 'siblings' logic. Once you have the above decided, you can implement the logic by hooking into the 'price' during checkout. An example is provided in the docs here.
×
×
  • Create New...