alexm Posted May 31, 2023 Share Posted May 31, 2023 Hey @kongondo hope all is well. Here's a little feature request that I think may tie in nicely, especially for those using PaymentInvoice as an option. A fieldset for Bank Account Details that would store Bank Name, Sort Code and Account Number. This could then be automatically displayed on invoices, which is more or less a necessity to have on invoice if you are offering people to check out using Invoice as the payment option. ?? 1 Link to comment Share on other sites More sharing options...
kongondo Posted June 3, 2023 Share Posted June 3, 2023 Hey @alexm, On 5/31/2023 at 11:54 AM, alexm said: Here's a little feature request that I think may tie in nicely, especially for those using PaymentInvoice as an option. A fieldset for Bank Account Details that would store Bank Name, Sort Code and Account Number. Cool idea. Given that people will have different needs on what extra information to capture for invoice payments (or indeed other payments or just general customer info), I am inclined to let devs implement this per their needs. The implementation would be similar to the custom fields example in demo-2. Thus: Display inputs for bank details in your checkout form. If only accepting invoice payments, always show the fields and make them required. If accepting other payment options, toggle-show the bank details inputs (e.g. using Alpine.js) In ready.php listen to PadloperProcessOrder::orderSaved as shown here in demo-2. Use that to save capture and save your bank details. Save those to some field(s) you have added to the template padloper-order. You have several choices here, e.g. multiple text fields, or a repeater matrix or a multiplier text field, etc. You could even get away with a single textarea since this is not a field you will need to query in the frontend. If user continues to shop after the first checkout attempt, you can use $order-your_bank_details_field to show them the bank details they entered when they first attempted checkout. It would be best to check if there is a valid Padloper session before doing this. Perhaps best just to let them re-enter the bank details though. To display the bank details in the backend, there are several places you can hook into in the single order view depending on where you want to display the info. To show the bank details on the invoice, copy /site/modules/Padloper/templates/invoice-content-html.php to /site/templates/padloper/invoice-content-html.php and edit per your needs. This template will receive the Page $order. That will give you access to $order-your_bank_details_field. Would this work for you? Lemme know. 1 Link to comment Share on other sites More sharing options...
alexm Posted June 23, 2023 Author Share Posted June 23, 2023 @kongondo sorry about my long overdue response. I think there might be some confusion, unless I'm having a bit of a moment. When the customer buys from the store I wouldn't need to get their bank details, but they would need to have the store's bank details to make the payment to the store. Therefore there would be no need to have the ability to collect the customers bank details at checkout as they won't need paying. However the invoice template in general, whether it be that the customer checked out via 'invoice' payment or 'stripe' etc would probably be advisable to include the stores bank details for receiving payments. Hence, I would think that most people will want the ability to add their store's bank details on the store configuration so they can be displayed on invoices sent/or printed via the system so customers can make bank transfer payments. For no I have hard coded it ?? 1 Link to comment Share on other sites More sharing options...
kongondo Posted June 23, 2023 Share Posted June 23, 2023 54 minutes ago, alexm said: I think there might be some confusion, unless I'm having a bit of a moment. @alexm. Sorry, my bad! I get you now. I'll add this to the settings together with your other idea about a 'from email address'. I'll make a variable, $storeDetails or something like that available to invoice-content-html.php. This will give you access to the bank details saved in the store config. Do you need more than these three pieces of info? Quote Bank Name, Sort Code and Account Number Cheers. 1 Link to comment Share on other sites More sharing options...
alexm Posted June 23, 2023 Author Share Posted June 23, 2023 NICE! I thought we might have crossed our wires!! ? I think that would be all that is required for bank details as far as I am aware for sure Cheers! Link to comment Share on other sites More sharing options...
alexm Posted June 21 Author Share Posted June 21 @kongondo Hey mate, what did you end up calling the variable for getting the store deets in the invoices in the end? Just trying wanting to grab the bank details from General settings you seeeee Link to comment Share on other sites More sharing options...
kongondo Posted June 22 Share Posted June 22 Hi @alexm, <?php namespace ProcessWire; /** @var WireData $shopBankDetails */ $shopBankDetails = $padloper->getShopBankDetails(); $shopBankDetails->bankName; $shopBankDetails->bankSortCode; $shopBankDetails->bankAccountNumber; $shopBankDetails->bankIBAN; $shopBankDetails->bankBIC; // @note: same as BIC $shopBankDetails->bankSWIFTCode; 1 Link to comment Share on other sites More sharing options...
alexm Posted June 22 Author Share Posted June 22 Thanks @kongondo! That's bloomin' marvellous ?? Just a thought... Sorry.... Haha. Would it be possible to add another property called 'bankAccountName' as sometimes it will ask for the business account name when people go to pay? What say you? 1 Link to comment Share on other sites More sharing options...
kongondo Posted July 26 Share Posted July 26 Hey @alexm, On 6/22/2024 at 1:55 PM, alexm said: What say you? Done! In upcoming version 010. Thanks. 1 Link to comment Share on other sites More sharing options...
alexm Posted August 26 Author Share Posted August 26 @kongondo Amazing thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now