Created
May 11, 2021 09:51
-
-
Save ichaykin/b1a2467e04338eb609beec2390448502 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/paypal/paypal_express.functions.php b/app/addons/paypal/paypal_express.functions.php | |
index c88bd2c6de..6caf976a41 100644 | |
--- a/app/addons/paypal/paypal_express.functions.php | |
+++ b/app/addons/paypal/paypal_express.functions.php | |
@@ -336,15 +336,19 @@ function fn_paypal_build_details(array $data, array $processor_data) | |
function fn_paypal_get_shipping_data($data) | |
{ | |
$shipping_data = array(); | |
- if (!empty($data) && (!empty($data['s_firstname']) || !empty($data['s_lastname'])) && !empty($data['s_address']) && !empty($data['s_city'])) { | |
+ if (!empty($data) && !empty($data['s_address']) && !empty($data['s_city'])) { | |
$shipping_data['ADDROVERRIDE'] = 1; | |
//We should made these checking because $data can contain only s_state, s_country, s_zipcode if we calculate shipping on checkout page. | |
$ship_name = ''; | |
if (!empty($data['s_firstname'])) { | |
$ship_name = $data['s_firstname']; | |
+ } elseif (!empty($data['firstname'])) { | |
+ $ship_name = $data['firstname']; | |
} | |
if (!empty($data['s_lastname'])) { | |
$ship_name .= ' ' . $data['s_lastname']; | |
+ } elseif (!empty($data['lastname'])) { | |
+ $ship_name .= ' ' . $data['lastname']; | |
} | |
if (!empty($ship_name)) { | |
$shipping_data['PAYMENTREQUEST_0_SHIPTONAME'] = $ship_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment