Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ichaykin/b1a2467e04338eb609beec2390448502 to your computer and use it in GitHub Desktop.
Save ichaykin/b1a2467e04338eb609beec2390448502 to your computer and use it in GitHub Desktop.
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