-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
Customers and Customer Groups are new features in Padloper 009. Customers You can add/remove this optional feature at any time via ‘/admin/shop/configure-padloper/’. This feature does not require the 'Customer Groups' feature. Please note that there is no direct relationship between a 'shop customer' and an 'order customer'. This decoupling allows for a better delineation between guest and non-guest checkouts. The field for storing order customers is separate from the field for storing shop customers. The former is a 'permanent' record of a transaction (an order) in your shop. There is no direct link between a shop customer and a ProcessWire user, until you link them. Padloper allows you to do this easily. You can add customers to your shop either via the API or the admin. Note: When creating a customer, you have the option to create a (ProcessWire) user account for them as well. You can also do this later when editing the customer. Padloper does not handle the customer registration for you. This is because some devs prefer to send customer a link to register whilst others prefer emailing a temporary password to the customer. Padloper allows you to handle the registration and pass the details back to it to email to the customer. Padloper passes the new customer details, new user details and the temporary password set to the new user to the partial template 'customer-registration-request-email-content-html.php'. Devs can then use that information to handle customer registration. When you add a customer, they get the role 'padloper-customer'. A customer linked to a ProcessWire user is a 'registered customer'. In this case, the $customer->userID equals $user->id and $customer->email is $user->email. Currently, in case you had existing users in your shop that were customers prior to Padloper 009, Padloper does not currently link those users to the customers. You can do this via the API. If you change a 'linked' user's email, the email of the corresponding customer will also be changed to keep them in sync. The same thing happens if you edit the email of a linked (registered) customer; the corresponding user's email will also be amended. If you delete a ProcessWire user linked to a Padloper customer, the customer will be delinked, i.e. will no longer be a registered customer and $customer->userID will be 0. If you delete a registered Padloper customer, the corresponding ProcessWire user will also be deleted. It is possible to email a customer directly from the admin. A customer can have multiple addresses. These can be of types: Primary Shipping Shipping Primary Billing Billing A customer can only have one Primary Shipping and one Primary Billing address. The 'customer view' page allows you to see the details of the last 10 orders of the customer and the total of all their orders to date. With the customers feature, you can pre-populate address details of logged-in customers for a better checkout experience. You can also use this feature to build customer dashboards, address books, etc. as @alexm points out here. Currently, there is no dedicated API to retrieve, amend, etc. a customer. This is planned. For now, you can get a customer as follows: <?php namespace ProcessWire; $email = "mario@blaze.br"; $customer = $padloper->get("template=customer, customer.email={$email}"); if(!$customer instanceof NullPage){ // CUSTOMER FOUND /** @var WireData $customerBasics */ $customerBasics = $customer->padloper_customer; /** @var WireArray $customerAddresses */ $customerAddresses = $customer->padloper_customer_addresses; bd($customer, __METHOD__ . ': $customer - at line #' . __LINE__); bd($customerBasics, __METHOD__ . ': $customerBasics - at line #' . __LINE__); bdb($customerAddresses, __METHOD__ . ': $customerAddresses - at line #' . __LINE__); } Customer Groups You can add/remove this optional feature at any time via ‘/admin/shop/configure-padloper/’. This feature requires the 'Customers' feature. The Customer Groups feature allows you to segment your customers using certain criteria. The segmentation allows you to target specific customers for various purposes including marketing, loyalty services, discounts, statistical analysis, bulk emailing, etc. You will need to implement such actions per your needs, e.g. via an addon, etc. A customer can belong to more than one Customer Group. You can create unlimited Customer Groups. Currently, you need to manually create Customer Groups and add them to Customers. However, in future, you will be able to: Use a GUI query builder to create a customer group then apply it to matching customers. For instance, a Customer Group named 'Europe High' with the criteria "order > 500, country = Italy|Switzerland" Automatically add a Customer to a Customer Group if they meet the criteria. E.g., if a customer places an order and the customer's order totals becomes greater than >= 500 and the customer country is Italy or Switzerland, Padloper will automatically add them to the above 'Europe High' Customer Group. Screenshots
-
- 2
-
-
-
An example of how to use new discounts feature in Padloper 009 in the frontend. Important things to note: You can validate and apply discounts programmatically or by capturing details using your custom form. Padloper does not output a discount input since discounts are an optional feature. Padloper provides a discount API that allows you to validate, apply, invalidate, remove, etc. discounts from an order. You can submit your discount code form to the server however you wish, i.e. ajax or non-ajax. The example below applies a discount with code 'SAVE10'. This is a 10% whole order discount. The example uses htmx (ajax). The form is in the checkout page but the ajax endpoint can be a single place, e.g. your home page. Example Apply Discount Form Screenshots Discount form on checkout page Discount validation failed Discount applied successfully Example Apply Discount Ajax Form Handling Please see the comments in the code. Thanks.
-
Hey @Neue Rituale. Yes, Padloper is very much still being developed. Version 009 is due for a release this week (I have been dealing with a number of issues, including this one).
-
Hi @Spinbox, Not sure I understand this one. All you have to do is make the product 'not shippable' in the product settings as shown in the screenshot below. Padloper will not apply shipping to non-shippable items. Is this what you were after? Thanks.
-
For the present question about 1 product per user, here is example code: <?php namespace ProcessWire; $eventProductID = 2678; $customerEmail = 'wario_best@gmail.com'; /* NOTES 1. line-time -> padloper-order-line-item (order line item template) 2. product_id -> subfield in padloper_order_line_item field with product ID value 3. parent.order_customer -> Order is the parent of line items. padloper_order_customer is the field with customer details */ // $boughtTicket = $padloper->get("template=line-item, line_item.product_id={$eventProductID},parent.order_customer.email={$customerEmail}"); // if ($boughtTicket instanceof NullPage) { // // NOT YET BOUGHT TICKET // } else { // // BOUGHT TICKET ALREADY // } # OR $boughtTicketID = (int) $padloper->getRaw("template=line-item, line_item.product_id={$eventProductID},parent.order_customer.email={$customerEmail}", 'id'); if (empty($boughtTicketID)) { // NOT YET BOUGHT TICKET } else { // BOUGHT TICKET ALREADY } Let me know if you need clarification. Sorry for the delay! Thanks.
-
Saving Stripe's charge_id to order
kongondo replied to Spinbox's topic in ProcessWire Commerce (Padloper) Support
Hi @Spinbox, I have made this hookable so you have access to $response and $options. However, we have no dedicated field for saving this value. You could add a text field to your order template. Then save the latest_charge value to that field. This way, it stays together with the order and you can easily retrieve and add it to your invoices. Does this make sense or you need example code? Thanks. -
@Spinbox You are the boss ?! Thank you so much for the detailed response! I've heard great things about the C2. This guy has some helpful tips on screen splitting (PowerToys FancyZones, Aquasnap and Groupy). Was 2x 1080p your previous setup? Thanks again for the detailed answers!
-
Hi @sebibu, Yes. I am hoping to do so soon ?. I'll post an update later this week. Yes, sorry, this (see bit about shop):
-
https://www.cognition-labs.com/introducing-devin Well I guess that's it then. It was nice riding with you folks. I am out...? Oh, wait a minute. There's still hope. I just need to learn ML... ?
-
Thanks for looking into this. Looks like they gave a response for an 8K TV ?.
-
Thanks. It was one of the first ones I watched ?. I've watched at least a dozen, maybe more. I have watched some that are like a series...now, 6 months later, 2 years, later, etc! Some people have gone back to PC monitors, others have stuck it out, others have gone for smaller TVs, etc. Like you said, there's quite a lot of factors to take into account as well as end use of the thing. Gamers, for instance, seem to like the LG C series a lot.
-
Anyone using a 4K TV as a computer monitor? What has your experience been? Primary use would be coding and video editing (not gaming or graphics or for smart TV features). 43 inch, maybe LED or QLED (not OLED). What I've found out so far: Distance from screen! Anything bigger than 50 inch is asking for trouble (ergonomics). QLED best for bright rooms. OLED best for darker rooms but... OLED burn-in! and pricey! Eye strain + possible headaches (see #1). Refresh rate (not important for coding?). Auto dimming. Font aliasing (reverse RGB to BGR if possible). One big screen might be better than two smaller ones (central focal point) - YMMV! Thoughts? Thanks.
-
Hi everyone. Padloper 009 is ready! The release has been delayed by issues with my site. It is currently offline as I work on upgrading it. I hit a number of issues which I am currently resolving. I am hoping this won't extend beyond two weeks. I request your patience please, thanks. Best.
-
November 2023 (version 1.85) Floating editor windows Finally this ?!
- 246 replies
-
- 1
-
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
Hi @alexm, Sorry, I saw this late. Yes, that's the easiest way to do do it. You could also have done this programmatically but much easier at the DB level especially if you don't have many line items. A third way would have been to recreate the whole order manually in the backend using Padloper but this would have meant creating a new order. As you have found out the hard way, manual order creation and frontend orders are not compatible (for now) ?.
-
I didn't know this! Where does this code go, ready.php or init.php? Or in config.php?
-
Padloper status end 2023
kongondo replied to joe_g's topic in ProcessWire Commerce (Padloper) Support
No worries ?. I didn't for once consider it that way ?. Everything you said was spot on and constructive. I am just frustrated at myself that I have not been able to bring the docs to a reasonable standard (yet). I take your point and will consider this. My plan has been to make short (5 minutes maximum) video. Thanks. -
Padloper status end 2023
kongondo replied to joe_g's topic in ProcessWire Commerce (Padloper) Support
Hi @joe_g, Apologies for the very late reply. I have been away. First, thanks for your continued interest in Padloper despite the difficulties you have previously encountered. The docs are still not great, sorry. I am currently working on releasing version 009 of Padloper after which I'll introduce a soft feature freeze and solely focus on working on documentation and bug fixes. I decided to focus on video documentation rather than written ones at the moment. You are right. I focused on using htmx since that was the easiest way I could illustrate how to build a shop using ajax. It was my intention to quickly follow this up with other examples using jQuery and non-ajax examples. Apologies that I never got round to this but my plan for the video documentation is to start from scratch with very simple examples, first without ajax, then with ajax and subsequently cover more advanced techniques. I take full responsibility for this misconception. Padloper does not produce any markup except for a checkout form which you don't have to use. Perhaps my (complicated) htmx examples created the impression that the markup was coming from Padloper. Padloper closely aligns with the ProcessWire approach; it gets out of your way but is always on hand to assist you with its powerful API. I don't know what your timescales are but I think this would be a great opportunity to learn how to use Padloper's API. I know the video docs are not ready but perhaps your project could help shape my video documentation? Please let me know. Thanks. -
Hi @gornycreative, I have been away so just picking up messages now. Thanks for your interest in Dynamic Selects. I'll respond to your questions ASAP. There might be a delay as I settle in after a long absence, thanks.
- 96 replies
-
- 1
-
-
- chained-selects
- dropdowns
-
(and 2 more)
Tagged with:
-
Hi @MrSnoozles, all. Sorry I have been awfully quiet. I have been very busy with a number of projects. This has caused a delay regarding MM Next work. I am going to be away this week for about 2 weeks without access to the internet. This will quieten down a bit then with the other projects and I'll be able to continue with MM Next. Apologies for this!