Jump to content

Checkout Confirmation: Call to member function first() on null for CUSTOM form


alexm
 Share

Recommended Posts

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

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
	],

];

 

  • Like 2
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

@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

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 😀.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...