Skip to content

Instantly share code, notes, and snippets.

@torunar
Created December 30, 2015 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torunar/ea2cd1afabb5fe7b0956 to your computer and use it in GitHub Desktop.
Save torunar/ea2cd1afabb5fe7b0956 to your computer and use it in GitHub Desktop.
diff --git a/app/Tygh/Shippings/Services/Ups.php b/app/Tygh/Shippings/Services/Ups.php
index 8e6bb56..435b28b 100644
--- a/app/Tygh/Shippings/Services/Ups.php
+++ b/app/Tygh/Shippings/Services/Ups.php
@@ -188,13 +188,13 @@ class Ups implements IService
$origination = $this->_shipping_info['package_info']['origination'];
$location = $this->_shipping_info['package_info']['location'];
- $origination_postal = $origination['zipcode'];
- $origination_country = $origination['country'];
- $origination_state = $origination['state'];
+ $origination_postal = !empty($origination['zipcode']) ? $origination['zipcode'] : '';
+ $origination_country = !empty($origination['country']) ? $origination['country'] : '';
+ $origination_state = !empty($origination['state']) ? $origination['state'] : '';
- $destination_postal = $location['zipcode'];
- $destination_country = $location['country'];
- $destination_state = $location['state'];
+ $destination_postal = !empty($location['zipcode']) ? $location['zipcode'] : '';
+ $destination_country = !empty($location['country']) ? $location['country'] : '';
+ $destination_state = !empty($location['state']) ? $location['state'] : '';
$height = !empty($shipping_settings['height']) ? $shipping_settings['height'] : '0';
$width = !empty($shipping_settings['width']) ? $shipping_settings['width'] : '0';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment