Jump to content

useBillingAddress in Custom Order Customer Form


Jan Fromm
 Share

Recommended Posts

Hi @kongondo,

I am trying to place useBillingAddress in a Customer Checkout Form:

<input name="useBillingAddress" id="useBillingAddress" type="checkbox" value="1">
<label for="useBillingAddress">Use Billing Address</label>

I’m not sure if this is really required, but I also referred to this field in the checkout template:

$customFormFields = [
    [
        'input_name' => 'useBillingAddress',
        'type' => 'integer'
    ],
];

Anyway, no luck. When I look in $orderCustomer during checkout confirmation, it always shows ["useBillingAddress"]=> int(0), whether the checkbox is selected or not.

The documentation doesn’t list useBillingAddress as a Supported Form Input field – Should I assume it’s not possible this way?

Thanks!

Link to comment
Share on other sites

I would like to provide the customer with an optional license address (and occupy the billing address fields for this). In this case, useBillingAddress would be very useful for form validation: when this checkbox is selected, the billing address input fields become required.

I can solve this in another way, but useBillingAdress seems well suited for this.

Link to comment
Share on other sites

9 hours ago, Jan Fromm said:

I would like to provide the customer with an optional license address (and occupy the billing address fields for this). In this case, useBillingAddress would be very useful for form validation: when this checkbox is selected, the billing address input fields become required.

OK. I will re-enable this in a future Padloper version. Meanwhile, I'll send you a PM with a suggestion for an interim solution. Thanks.

  • Thanks 1
Link to comment
Share on other sites

Hi @kongondo,

I may have discovered a bug. I am using billingAddressCountry in the Customer Checkout form:

<select id="billingAddressCountry" name="billingAddressCountry">
	<option>&nbsp;</option>
	<option value="1195">Belgium</option>
	<option value="1205">Germany</option>
	<option value="1454">United Kingdom</option>
</select>

After submitting the form, $orderCustomer looks like this:

...
["billingAddressCountry"]=> string(4) "1205" 
["billingAddressCountryID"]=> int(0)
...

However, it should look like this:

...
["billingAddressCountry"]=> string(7) "Germany" 
["billingAddressCountryID"]=> int(1205)
...

Apparently $orderCustomer->billingAddressCountry is not determined based on the submitted Country ID of billingAddressCountry.

Or did I understand this wrong?

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi @Jan Fromm,

I can confirm that this is a bug. I have it fixed in my current dev version. I am hoping to make that the next release of Padloper. I hope to do this pretty soon. Hopefully it isn't too late for your needs. Please let me know if it is.

Thanks.

  • Like 1
Link to comment
Share on other sites

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