From 31a102ced30c7e1267c0ebac3416a2a9560f25d9 Mon Sep 17 00:00:00 2001 From: Dh42 Date: Fri, 7 Jun 2013 17:10:16 -0500 Subject: [PATCH] This makes paypal express work with countries with states Regarding this comment, http://www.prestashop.com/forums/index.php?/topic/225187-paypal-express-checkout-error-the-field-shipping-address-state-is-required/page__view__findpost__p__1107567 The issue is the module, states are returned from paypal to prestashop, they are not stored because there is no logic to store them. Looking back at other versions, I can't say this has ever worked. --- paypal/express_checkout/payment.php | 1 + 1 file changed, 1 insertion(+) diff --git a/paypal/express_checkout/payment.php b/paypal/express_checkout/payment.php index ce393e7c0..a92133e88 100644 --- a/paypal/express_checkout/payment.php +++ b/paypal/express_checkout/payment.php @@ -94,6 +94,7 @@ function setCustomerAddress($ppec, $customer) if (isset($ppec->result['PAYMENTREQUEST_0_SHIPTOSTREET2'])) $address->address2 = $ppec->result['PAYMENTREQUEST_0_SHIPTOSTREET2']; $address->city = $ppec->result['PAYMENTREQUEST_0_SHIPTOCITY']; + $address->id_state=(int)State::getIdByIso($ppec->result['SHIPTOSTATE'], $address->id_country); $address->postcode = $ppec->result['SHIPTOZIP']; $address->id_customer = $customer->id; return $address;