Page 1 of 1

Address not pre-populating in paypal

Posted: Wed Jun 26, 2013 9:32 am
by tora0515
Hey all,

I just started accepting orders from other countries and am running into a problem with pre populating paypal fields. I am using payment standard.

Anyway, It is populating the name, number and email, but not the address, state, or zip code. Any idea why this would happen? Then only thing I changed was before I was accepting only Australian orders, but now I accept orders from US, Canada, Japan and New Zealand. All the input fields have been left untouched, just added the countries in admin.

Thanks

So if I select Australia as the country, everything is passing over just fine. But When I choose any of the other countries I am not seeing address, state, or zip.

Maybe there is a setting in paypal's back end somewhere that I am missing?

Re: Address not pre-populating in paypal

Posted: Wed Jun 26, 2013 3:28 pm
by tora0515
For some stupid reason, "STATE" is not included in the paypal module...come on guys.

/catalog/controller/payment/pp_standard.php

you need to put in

Code: Select all

$this->data['state'] = html_entity_decode($order_info['payment_zone_code'], ENT_QUOTES, 'UTF-8');	
after:

Code: Select all

$this->data['city'] = html_entity_decode($order_info['payment_city'], ENT_QUOTES, 'UTF-8');

Then

/catalog/view/theme/default/template/payment/pp_standard

and put in:

Code: Select all

 <input type="hidden" name="state" value="<?php echo $state; ?>" />
after

Code: Select all

<input type="hidden" name="city" value="<?php echo $city; ?>" />
This should make your customers nice and happy because now just about every country is taken care of. Still won't populate the Australian and Japaense states, and the Japanese post code will need to be re entered if the screen is refreshed with errors from other fields. But oh well, will work on that later.

Re: Address not pre-populating in paypal

Posted: Wed Jul 08, 2015 8:31 pm
by leandromello
I'm having this problem, but i checked somes difference in the fields.
For example: in Opencart we have POSTCODE and in PAYPAL have field ZIP.

This could be a problem?
My OC is not sending de address to Paypal.

Re: Address not pre-populating in paypal

Posted: Wed Jul 08, 2015 9:53 pm
by Qphoria
leandromello wrote:I'm having this problem, but i checked somes difference in the fields.
For example: in Opencart we have POSTCODE and in PAYPAL have field ZIP.

This could be a problem?
My OC is not sending de address to Paypal.
no.. that is just a label.. OC is passing the correct parameter name for that field.

Re: Address not pre-populating in paypal

Posted: Wed Jul 08, 2015 9:54 pm
by Qphoria
leandromello wrote:I'm having this problem, but i checked somes difference in the fields.
For example: in Opencart we have POSTCODE and in PAYPAL have field ZIP.

This could be a problem?
My OC is not sending de address to Paypal.
no.. that is just a label.. OC is passing the correct parameter name for that field.

Re: Address not pre-populating in paypal

Posted: Thu Jul 09, 2015 3:47 am
by leandromello
@Qphoria
Thanks for the answer.

I OC 2.0.3.1 i create a NEW field...
How can i add this field in Paypal mod, to populate the form?

The new field:
name=custom_field[account][1]

Re: Address not pre-populating in paypal

Posted: Sat Jul 11, 2015 9:52 pm
by Qphoria
leandromello wrote:@Qphoria
Thanks for the answer.

I OC 2.0.3.1 i create a NEW field...
How can i add this field in Paypal mod, to populate the form?

The new field:
name=custom_field[account][1]
You can only pass fields that paypal has an equivalent allowed parameter for.
So depending on the field, you may be able to repurpose another field like "company" for "favorite color" but you can't just pass arbitrary fields over with a custom label.

Re: Address not pre-populating in paypal

Posted: Mon Jul 13, 2015 7:06 pm
by leandromello
thanks... i'll try.
I discovered that for now it is not supported on Paypal Brazil.