Support

Home Forums Event Espresso Premium Extra Address on Billing Page (EE4)

Extra Address on Billing Page (EE4)

Posted: November 6, 2014 at 8:57 am

Viewing 9 reply threads


Ray

November 6, 2014 at 8:57 am

Hi – I’m interested in adding an extra address line on the billing page of EE4, can you help me understand what has to be done? I’m using Paypal Pro.

What do I need to change in the code after ‘street2’ in the following code? And do I have to do anything in Paypal? Thanks!

$BillingAddress = array(
// Required. First street address.
‘street’ => $billing_info[‘_reg-page-billing-address-‘ . $this->_gateway_name ][‘value’],
// Second street address.
‘street2’ => ”,

to


Dean

November 7, 2014 at 6:11 am

Hi,

The code above does not seem complete, you may wish to use Pastebin to add code.

I assume you mean like a third street address e.g.

123 My street
a locality
**something else**
City
State
Country

If that is the case, I’m not sure it can be done as looking at PayPals API docs, it only recognises Street(1) and Street2. So while you can add an extra line in, that data is not going to be used or saved anywhere.


Ray

November 7, 2014 at 8:00 am

Hi – I’m actually asking for Street(2). The current billing page only shows Street(1) and not Street(2). Please see attached image.
http://take.ms/SxNyP


Sidney Harrell

November 7, 2014 at 11:10 am

You’ll also need a corresponding entry in the $reg_page_billing_inputs array. Look down around line 967.


Ray

November 7, 2014 at 12:44 pm

To be clear, I have to to do 2 things:

1) change the $BillingAddress array (line 457) from
‘street2’ => ”,

to

‘street2’ => $billing_info[‘_reg-page-billing-address-‘ . $this->_gateway_name ][‘value’]

2) Add $reg_page_billing_inputs array for street2 (line 966) with the following code:

‘_reg-page-billing-address2-‘ . $this->_gateway_name => array(
‘db-col’ => ‘address2‘,
‘label’ => __(‘Address 2‘, ‘event_espresso’),
‘input’ => EEM_Question::QST_type_text,
‘type’ => ‘string’,
‘sanitize’ => ‘no_html’,
‘required’ => TRUE,
‘validation’ => TRUE,
‘value’ => NULL,
‘format’ => ‘%s’


Sidney Harrell

November 10, 2014 at 11:50 am

I think for the first part, you’d want:
‘street2? => $billing_info['_reg-page-billing-address2-' . $this->_gateway_name ]['value']
to match up with the part that you added for the second part


Sidney Harrell

November 10, 2014 at 11:52 am

oh, and in that second part, I think you have it set to make the address 2 field required. I think you might want to change that to FALSE.


Ray

November 18, 2014 at 8:52 am

Hi-I did this but it doesn’t seem to show up on the /registration-checkout/?ee=_register page.

Is there something else I need to do to show the 2nd address line on the page template?


Ray

November 18, 2014 at 8:57 am

BTW – I’m referring to “Step 2 – Payment Options” of the /registration-checkout/?ee=_register process


Sidney Harrell

November 18, 2014 at 9:48 am

I just tested it out, and you were right, you also need to go into core/db_classes/EE_Onsite_Gateway.class.php to line 32. It needs to have an additional line in there for address2, like the one for address on line 31. I put it in there, and made the other 2 mods from earlier, and the address2 field shows on the reg form.

Viewing 9 reply threads

The support post ‘Extra Address on Billing Page (EE4)’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso