Paypal Express Not Sending Country Field

When a customer views cart and clicks the “Pay with PayPal Express” button at the bottom, after they submit payment and return to checkout, it gives an error because PayPal does not send the customer's Country, so the Country field is left with “Please select a country”. This often confuses the customer.



Why does the Country field not fill in? All the other fields like Name and Address are filled automatically, but the Country field is left blank.



The checkout won't let them proceed until the customer selects a Country. I have received many calls from confused customers because of this.



Please help

If anyone is curious of the fix, here it is from CS-Cart:



[color=#454545][font=Verdana][size=3]Unfortunately, it seems to be a bug in the standard CS-Cart installation. In order to fix it, please replace the following part of code:[/size][/font][/color]

$s_state_codes = db_get_hash_array(“SELECT ?:states.code, lang_code FROM ?:states LEFT JOIN ?:state_descriptions ON ?:state_descriptions.state_id = ?:states.state_id WHERE ?:states.country_code = ?s AND ?:state_descriptions.state = ?s”, 'lang_code', $checkout_details['SHIPTOCOUNTRYNAME'], $s_state);



[color=#454545][font=Verdana][size=3]with this one:[/size][/font][/color]

$s_state_codes = db_get_hash_array(“SELECT ?:states.code, lang_code FROM ?:states LEFT JOIN ?:state_descriptions ON ?:state_descriptions.state_id = ?:states.state_id WHERE ?:states.country_code = ?s AND ?:state_descriptions.state = ?s”, 'lang_code', $checkout_details['SHIPTOCOUNTRYCODE'], $s_state);



[color=#454545][font=Verdana][size=3]and replace the following part of code:[/size][/font][/color]

's_country' => $checkout_details['SHIPTOCOUNTRYNAME'],



[color=#454545][font=Verdana][size=3]with this one:[/size][/font][/color]

's_country' => $checkout_details['SHIPTOCOUNTRYCODE'],



[color=#454545][font=Verdana][size=3]in the [/size][/font][/color]paypal_express.functions.php[color=#454545][font=Verdana][size=3] file located in the [/size][/font][/color]app/payments/paypal[color=#454545][font=Verdana][size=3] directory of your CS-Cart installation. After that please check the issue again.[/size][/font][/color]