Paypal State code not showing in Paypal page

  • Posts: 11
  • Thank you received: 0
11 years 6 months ago #102406

Hi guys,

Anyone know why the 3 letter code referring to a STATE is not appearing in the Paypal webpage (after re-direct on check-out).

If I choose paypal (standard) as the method of payment I am redirected to the Paypal page for payment.
If I choose to pay without logging into a paypal account (i.e - pay by debit or credit card) the address fields are completed / filled in as expected, except for the State/Territory section of the paypal webpage.

My Hikashop address page shows the Long version / Full name of the state in a drop down box.

Any ideas how to get the 3 letter code or 2 letter code to transfer across to the Paypal payment page??

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #102478

Hi,

This code should be sent to Paypal thanks to the code:

$vars["state"]=@$order->cart->$address_type->address_state->zone_code_3;
				$vars["country"]=@$order->cart->$address_type->address_country->zone_code_2;
Have you the latest version of HikaShop ? Have you edited the zone codes, or the paypal plugin ?

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
11 years 6 months ago #102553

I'll check on that code. Thanks.

And Yes, I have the latest version of hika shop.

No, I haven't edited the state codes, and I'm pretty sure I haven't played with the PayPal.php file

Last edit: 11 years 6 months ago by adzy1981.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
11 years 6 months ago #102599

well that code is written into the Paypal.php exactly as you posted.

To be specific, If I am in Australia and I choose New South Wales as the country in my drop down. I proceed to Paypal payment page and the State code at the bottom of the page is Blank.

I'm stuck as to why this is happening (I have Hikashop essentials, latest update and a Joomla 1.5.26 site)

Another note - USA addresses work just fine. It's the Australian states I seem to be having trouble with. All other info comes across okay.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #102671

Hi,

Can you try with the "Northern Territory" Australia state ?
Is the state code displayed in PayPal ?

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
11 years 6 months ago #102737

Same result with Northern Territory. No transfer of info to PayPal payment site

Please Log in or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 6 months ago #102751

Hi,

Searching on the Internet, I found an interesting message:
stackoverflow.com/questions/7578717/payp...stralian-state-codes

So I guess that a specific check is required, something like:

$vars["country"]=@$order->cart->$address_type->address_country->zone_code_2;
$vars["state"]=@$order->cart->$address_type->address_state->zone_code_3;
if($vars["country"] == 'AU')
   $vars["state"] = @$order->cart->$address_type->address_state->zone_name_english;

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
11 years 5 months ago #105084

Hi guys, sorry for the delayed response. This worked for me:

Go to the root folder of your website and edit the following file:
public_html/plugins/hikashoppayment/paypal.php


Replace these 2 lines

$vars["state"]=@$order->cart->$address_type->address_state->zone_code_3;
$vars["country"]=@$order->cart->$address_type->address_country->zone_code_2;

With
$vars["country"]=@$order->cart->$address_type->address_country->zone_code_2;
$vars["state"]=@$order->cart->$address_type->address_state->zone_code_3;
if($vars["country"] == 'AU')
   $vars["state"] = @$order->cart->$address_type->address_state->zone_name_english;

Last edit: 11 years 5 months ago by adzy1981.

Please Log in or Create an account to join the conversation.

Time to create page: 0.076 seconds
Powered by Kunena Forum