Jump to content

kongondo

PW-Moderators
  • Posts

    7,390
  • Joined

  • Last visited

  • Days Won

    140

Everything posted by kongondo

  1. Please note that I have augmented this method to take two more arguments, $orderLineItemsPages and $orderLineItems. You could always get these two from the first argument, $orderPage, but this change makes your work easier.
  2. Hi @Sonia Margollé, Please have a look at this (demo-2) starter site/demo for an example of hooking into checkout and other order processing in order to collect, process, save and display product customisation details from customers. It also shows how to hook into and amend product weight during checkout (per your question here). If the READMEs are not clear, please let me know. Please use your download link to get the latest Padloper 003 files with some new/improved hookable methods. Thanks.
  3. Hi @Sonia Margollé, Please have a look at this (demo-2) starter site/demo for an example of hooking into product weight calculation as well as collecting, processing, saving and displaying product customisation details from customers (per your other question here). If the READMEs are not clear, please let me know. Please use your download link to get the latest Padloper 003 files with some new/improved hookable methods. Thanks.
  4. Demo & Starter Sites This thread is for me discussing Padloper 2 demo and starter sites. Thanks. Padloper starter sites can be found in this GitHub repo. Each demo branch is a standalone site demo/starter. Please see their individual READMEs for more information about a demo. This is WIP.
  5. I had a feeling that this might happen after I posted my suggestion. This is indeed a better plan. Glad you got it sorted.
  6. That's a good plan. Please let me know if you encounter issues. I'll look into where best to have a hook for order weight and let you know once I've implemented it.
  7. This is much clearer now. So, you need to collect this information from the customer in the frontend when they make their purchase. I have some ideas which I talk about below. I see three parts to this challenge: Collecting extra information from the customer in the frontend. Processing the customer information in #1 so that it is in sync with the cart and the order. Storing and accessing the customer information from #2 when order is finalised. Product versus Order versus Order Line Items Given that what a customer may want to be customised is unique for that purchase, I don't think customising it at the product level is a good idea. The product needs to remain generic, e.g. a 'blank t-shirt'. Similarly, customising it at the order-level also doesn't make sense since an order is a collection of one or more products (line items) that have been purchased. Hence, customising at the order-level is too broad. I think the best place to customise the purchased product is at the Order Line Item level. An order line item is just a product that has been purchased. However, doesn't change post-purchase. I'll get back to this when we get to #2 above. #1 Collecting Extra Information from Customer This is the easy bit. You would have to use custom form for your checkout. At this stage, you will have access to the order items and you have several ways of gathering the details from the customer. You can loop through each item in the cart to find out which ones offer customisation and display extra inputs/text fields for each of them. #2 Processing Extra Information Collected from Customer Here you will have to hook into a checkout process method. I'll have a look at which one is best and make it hookable if it isn't already. Ideally you should hook after the order and order line items have been created (given my argument in product vs order vs order line items above). This will then give you the chance of storing the 'custom' information for each order line item in the order. #3 Storing and Accessing Extra Information Collected from Customer Here, I have two thoughts with respect to storing the extra information. Alternative 1: Adding a custom field to the order line item template. Use that information to store the 'custom extra information' from the customer. This could b a typical text field to something more complex. Alternative 2: Using the Notes feature of an Order. All orders store notes. This alternative means you already have somewhere to store the extra customer information. You would need to ensure that such a note is clear as to which line item (bought product) it is referring to in case there are multiple items in the order. Viewing the information in the shop admin could be a bit tricky. If notes, then that is already built in. If using alternative #1, then it will need a bit more work. I can make the order dashboard hookable so you can display extra information. Or you might be able to hook into Page Edit Form for order template and even insert an extra tab there for customisation. Please let me know if this is the sort of thing you were referring to. Thanks.
  8. Padloper 003 has been released. It includes the Addons feature.
  9. Hi @gs-df, Just to let you know that Padloper 003 has now been released.
  10. Hi @Sonia Margollé, Currently, Padloper does not have a Gift Card feature. However, there are a number of ways you can implement this feature yourself. A gift card can be thought of as a special product. Hence, you can use a product as a gift card. The main challenge in this regard is you will need a single product per gift card, since gift cards need to be unique and cannot be reused. By client here I assume you mean the shop owner/admin? I am sorry I don't understand this statement. Who is the user here? The shop owner/admin or a frontend customer? Yes, this approach might work. Below, I discuss this and other possible approaches. Property Approach It would mean, perhaps, creating a property called 'Gift' and a dimension called 'Worth'. You can then add these to a product as a property as illustrated below. The main challenge with this idea is it can be confusing to the shop admin since they'll have to add this as a property. In addition, it is possible to add more than one property which might confuse the shop admin even more. However, you might want to add more properties for other aspects of the gift card, e.g. a unique number. Custom Field(s) Since Padloper products are also pages, it is possible to add extra field(s) to a product page template. Once you retrieve the Padloper page, you are able to access that/those field(s) as any other field. This approach is very versatile. You can use existing ProcessWire fields such as integers, texts, etc but can also create a custom field to store and edit your gift card information. One issue with this approach is that if you have products that are not gift cards, they will also have the gift card field(s) added to them even if they don't need them. This can confuse shop admins. Custom Addon A third approach is to use the new Padloper feature for Addons. This is probably the most powerful of these approaches and gives you complete freedom whilst still allowing you to utilise (hidden) pages and (custom) fields. I have some questions: Are these gift cards redeemable in the same shop or other shops or both? I.e., is your client selling gift cards or offering them for free to customers? Are the gift cards partly redeemable or need to be used once? Yes, they are already implemented. Are you not able to add properties to your products? Currently these are not displayed in the demo site, although properties do exist. I can give you access to the backend of the demo site if that will be helpful. Thanks.
  11. Addons docs are now up. I hope to upload the latest Padloper files by tomorrow. I need to do some final tests before they are ready. Thanks.
  12. Hi @gs-df, I recently noticed this when testing another user's install and came up with a fix. My plan was to release the fix alongside other incoming features. I hope to do so by tomorrow. Yes. Actually, just slopping coding on my part ?. What was happening in the other user's case, and I suspect it is the same situation in your case, is that Padloper was installed but the downloads feature was not selected for install. Hence, the table padloper_download_codes is not available. However, when you try to print or email an invoice, Padloper is also attempting to fetch downloads for that order, if any are available. It checks the table padloper_download_codes but there is no such table, hence SQL throws the error. I'll let you know when the updated files have been uploaded. You will then be able to re-download Padloper using the link that was sent to you after your purchase. After that, it is just a case of overwriting your existing install with the new files. Thanks.
  13. Hi @alexm, Apologies the docs are not clear. All shipping zones must have at least one shipping rate, even if it is for free shipping. They must also have at least one country added to them, unless you are using a Rest of the World Setup. Please try that, thanks.
  14. Introducing Flutter 3 The culmination of our journey to multiplatform UI development on phone, desktop, and web We’re delighted to announce the launch of Flutter 3 as part of the Google I/O keynote. Flutter 3 completes our roadmap from a mobile-centric to a multiplatform framework, with the availability of macOS and Linux desktop app support, along with improvements to Firebase integration, new productivity and performance features, and support for Apple Silicon. https://medium.com/flutter Game, set and match?
  15. Introducing Padloper Addons Addons allow you to easily extend the functionality of your Padloper Shop. All you need is to drop your addon files (.php) in /site/templates/padloper/addons/. There are currently two broad types of addons: Payment Addons and 'Custom Addons'. Addons only need to implement the PadloperAddons Interface. Payment addons must also extend the abstract PadloperPayment Class. That's it. With addons, your shop admins can perform various tasks without leaving the context of the shop. Your addons have access to the powerful ProcessWire and Padloper APIs. You can build anything you want. You are only limited by your imagination, or your budget, should you want me to develop a custom addon for you ?. Documentation is in the works, ready sometime this week. Once this is done, I'll release the latest Padloper that includes this feature. Below, a video demo of a few addons I developed to showcase this new feature. Please note that the addons demoed in the video are not part of the official Padloper distribution. Can't wait to see what you guys will build?.
  16. Yes. The figure your arrow points to is the year AOV. The monthly ones are visible on hover. You are right though, it could be clearer. Nothing comes to mind presently. Let me know if you have any thoughts please, thanks.
  17. Somebody else has tested on 3.0.200 and it works fine. The only main difference I know of so far is both @Jan Fromm and the other tester's sites are not multilingual or at least currently have English as the default language. Might not be related, but worth mentioning. I'd also like to rule out any other third-party modules you might have maybe?
  18. Defo! <?php if ($order->paymentMethod == Invoice){ echo 'Mate, clock is ticking! :-)'; } Sorry I wasn't clear.
  19. The examples on their website don't seem to work? Thanks for these resources!
  20. Hi @csaggo.com, I'm stumped on this one as I cannot replicate and this is a ProcessWire core Inputfield. In addition there are no JS errors to help us. Yes. This is inserted by ProcessWire itself. That's doesn't work if there is no current saved property (i.e. it won't delete and empty property line). So, that's the expected behaviour. The only thing I can think of now is to request other users to test on their environments. That will tell us if the issue is local to your environment, at least. I can also check your setup again if I can get access but not sure that is immediately helpful. @Jan Fromm, @Kholja, @alexm. Sorry to tag you like this. With respect to the issue above, are you able to please test if adding properties to products works in your case? Does the search kick in? Many thanks.
  21. Hi @alexm, This template file will receive $order as well as $orderLineItems, $orderCustomer and a bunch of other variables shown below: <?php namespace ProcessWire; /** @var WireData $order */ /** @var WireArray $orderLineItems */ /** @var float $orderSubtotal */ /** @var bool $isOrderGrandTotalComplete */ /** @var bool $isOrderConfirmed */ Payment info is in $order. We save the title of the payment method. You can use that by itself or use it to grab the payment gateway/method page itself (e.g. if you want the ID for some reason. Here's an example: <?php namespace ProcessWire; // COMPLETED ORDER /** @var WireData $order */ bd($order, __METHOD__ . ': $order at line #' . __LINE__); // PAYMENT GATEWAY/METHOD TITLE /** @var string $order->paymentMethod */ bd($order->paymentMethod, __METHOD__ . ': $order->paymentMethod at line #' . __LINE__); # OR ALIAS /** @var string $order->payment */ bd($order->payment, __METHOD__ . ': $order->payment at line #' . __LINE__); /** @var string $paymentGatewayTitle */ $paymentGatewayTitle = $order->payment; /// GET ID OF PAYMENT GATEWAY/METHOD /** @var int $paymentGatewayPageID */ $paymentGatewayPageID = (int)$padloper->getRaw("template=payment-provider,title={$paymentGatewayTitle}", 'id'); bd($paymentGatewayTitle, __METHOD__ . ': $paymentGatewayTitle at line #' . __LINE__); bd($paymentGatewayPageID, __METHOD__ . ': $paymentGatewayPageID at line #' . __LINE__); // IN CASE YOU WANT THE PAGE ITSELF FOR SOME REASON /** @var Page $paymentGatewayPage */ $paymentGatewayPage = $padloper->get("template=payment-provider,title={$paymentGatewayTitle}"); bd($paymentGatewayPage, __METHOD__ . ': $paymentGatewayPage at line #' . __LINE__); Hope this helps.
  22. Hi @Jan Fromm, That's the expected behaviour. This is because for a successful order checkout, when /checkout-custom/success/ is called, the order has been finalised hence Padloper clears the sessions related to the successful order. Hence, $padloper->getOrderTotalAmount() finds nothing. In fact, if you reload the page at this point, you will be redirected to the shop's homepage as their is no current 'cart'. There's at least two ways to do this. order-products-table.php template receives a number of template variables: <?php namespace ProcessWire; /** @var WireData $order */ /** @var WireArray $orderLineItems */ /** @var float $orderSubtotal */ /** @var bool $isOrderGrandTotalComplete */ /** @var bool $isOrderConfirmed */ We can use those to calculate the order amount minus taxes and shipping. Method #1: ADD TOTAL PRICE OF EACH LINE ITEM <?php namespace ProcessWire; // init empty total price $totalPriceMinusTaxesAndShipping = 0; foreach ($orderLineItems as $orderLineItem) { // @note: there are also aliases to line item 'totalPrice' // if you prefer, i.e. 'lineItemTotalPrice' and 'orderItemTotalPrice' // ------- // add price of each line item /** @var WireData $orderLineItem */ $totalPriceMinusTaxesAndShipping += (float) $orderLineItem->totalPrice; } // @debug: here is your total price without taxes and shipping // @note: if you applied discounts, those will be reflected in this value bd($totalPriceMinusTaxesAndShipping, __METHOD__ . ': $totalPriceMinusTaxesAndShipping at line #' . __LINE__); Method #2: GET ORDER SUBTOTAL AND MINUS ORDER TAX TOTALS <?php namespace ProcessWire; /** @var array $orderTaxTotalsArray */ // get all the taxes applied to order // this returns 'tax_name' => 'total_tax_applied' values $orderTaxTotalsArray = $padloper->getOrderTaxTotals($orderLineItems); // sum the tax totals $orderTaxTotals = array_sum($orderTaxTotalsArray); // $orderSubtotal = order_total + tax_total (it doesn't including shipping) // subtract taxes from order subtotal $totalPriceMinusTaxesAndShipping = (float) $orderSubtotal - $orderTaxTotals; // @debug: here is your total taxes bd($orderTaxTotals, __METHOD__ . ': $orderTaxTotals at line #' . __LINE__); // @debug: here is your total price without taxes and shipping bd($totalPriceMinusTaxesAndShipping, __METHOD__ . ': $totalPriceMinusTaxesAndShipping at line #' . __LINE__); Hope this helps.
  23. Hi @planmacher, I haven't tried, unfortunately. Maybe you could test for us? ?. Thanks. Please backup your existing site first, as usual.
  24. Yes indeed. Did you forget to attach the screenshots? ?. Issue is most like what @Spinbox mentioned. Hope it resolves your issue. I'll think about returning a meaningful error.
  25. Hi @Jan Fromm, Thanks for reporting this. Nope. Entirely my silly mistake. Nothing to do with your setup or Tracy ?. Forgot a 'check_access=0' in the selector to grab the line item to delete (since they are in admin). So, the reason it worked with 'Tracy enabled' is, I guess, you were logged in as a Superuser :-). Anyway, sorted for now. Please grab the updated files again. Not at all ?. Thanks.
×
×
  • Create New...