alexm Posted June 28, 2022 Share Posted June 28, 2022 Afternoon @kongondo, Hope you are good! I've just implemented a custom form following your setup closely on the github demo and when I proceed to confirmation screen I get Call to member function first() on null in modules/Padloper/includes/helper/PadloperUtilities.php:1470 I've attached screenshots to see if you have any clue. I've got tax set up and a rate specified for United Kingdom and the built in checkout rendered process works, so I must be missing something, but I'm unsure what exactly. Many thanks as always, Alex Link to comment Share on other sites More sharing options...
Spinbox Posted June 28, 2022 Share Posted June 28, 2022 Hi Alex, Had the same problem, seems like the padloper input names have changed. They are now camelcase. The specific problem comes from shippingAddressCountry. It can't find the country. $customFormFields = [ // first name [ // the name of the input of the custom form 'input_name' => 'firstName', // the input type (for sanitization) // @todo: @note: for selects and checkbox, use the expected value type 'type' => 'text', // if field/input is required 'required' => true ], // last name [ 'input_name' => 'lastName', 'type' => 'text', 'required' => true ], // email [ 'input_name' => 'email', 'type' => 'email', 'required' => true ], // address line one [ 'input_name' => 'shippingAddressLineOne', 'type' => 'text', 'required' => true ], // address line two [ 'input_name' => 'shippingAddressLineTwo', 'type' => 'text', ], // city/town [ 'input_name' => 'shippingAddressCity', 'type' => 'text', 'required' => true ], // postcode [ 'input_name' => 'shippingAddressPostalCode', 'type' => 'text', 'required' => true ], // country [ 'input_name' => 'shippingAddressCountry', // @note: country ID, hence integer! 'type' => 'integer', 'required' => true ], // region/state/province [ 'input_name' => 'shippingAddressRegion', 'type' => 'text' ], // ------------------------ // SPECIAL (NON-ALIASED) // PAYMENT TYPE/CLASS // @todo: @note: name might change! [ 'input_name' => 'padloper_order_payment_id', 'type' => 'integer', 'required' => true ], ]; 2 Link to comment Share on other sites More sharing options...
alexm Posted June 28, 2022 Author Share Posted June 28, 2022 @Spinbox Ah, good spot. Yes, I'll try this then! I'm just on the move at the mo! Thank you ? Link to comment Share on other sites More sharing options...
kongondo Posted June 28, 2022 Share Posted June 28, 2022 55 minutes ago, Spinbox said: seems like the padloper input names have changed. They are now camelcase. Yes indeed. 1 hour ago, alexm said: I've attached screenshots to see if you have any clue. Did you forget to attach the screenshots? ?. Issue is most like what @Spinbox mentioned. Hope it resolves your issue. 1 hour ago, alexm said: so I must be missing something, but I'm unsure what exactly. I'll think about returning a meaningful error. 1 Link to comment Share on other sites More sharing options...
alexm Posted June 28, 2022 Author Share Posted June 28, 2022 32 minutes ago, kongondo said: Did you forget to attach the screenshots? ?. Yes I did ? Classic! Cheers both! Link to comment Share on other sites More sharing options...
alexm Posted November 27, 2022 Author Share Posted November 27, 2022 @kongondo just an update on this. If I try and use custom form fields, even when using equivalent_padloper_input_name if you use a custom input_name as below will result in the same error as originally posted at confirmation. I have to use shippingAddressCountry as the input_name for whatever reason. // country [ 'input_name' => 'shipping_address_country', 'equivalent_padloper_input_name' => 'shippingAddressCountry', // @note: country ID, hence integer! 'type' => 'integer', 'required' => true ], Just thought you should know as it seems like a tiny teeny bug ? Link to comment Share on other sites More sharing options...
kongondo Posted November 27, 2022 Share Posted November 27, 2022 Hi @alexm, 24 minutes ago, alexm said: If I try and use custom form fields, even when using equivalent_padloper_input_name if you use a custom input_name as below will result in the same error as originally posted at confirmation. I have to use shippingAddressCountry as the input_name for whatever reason. Sorry, my communication and docs were not clear enough. We stopped supporting the 'equivalent_padloper_input_name' option. You need to use the input names specified here in the docs ?. 1 Link to comment Share on other sites More sharing options...
alexm Posted November 27, 2022 Author Share Posted November 27, 2022 @kongondo ahhhh ok ??. It's still in the code on github just so's ya know: https://github.com/kongondo/Padloper2Starter/blob/demo-1/templates/checkout.php 1 Link to comment Share on other sites More sharing options...
kongondo Posted December 2, 2022 Share Posted December 2, 2022 On 11/27/2022 at 2:47 PM, alexm said: @kongondo ahhhh ok ??. It's still in the code on github just so's ya know: https://github.com/kongondo/Padloper2Starter/blob/demo-1/templates/checkout.php Oops! I'll update soon. Link to comment Share on other sites More sharing options...
kongondo Posted January 8, 2023 Share Posted January 8, 2023 Fixed in Padloper 008 released today. 1 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