@@ -630,7 +630,7 @@ protected function _getXmlQuotes()
630
630
$ serviceCode = null ;
631
631
} else {
632
632
$ params ['10_action ' ] = 'Rate ' ;
633
- $ serviceCode = $ rowRequest ->getProduct () ? $ rowRequest ->getProduct () : '' ;
633
+ $ serviceCode = $ rowRequest ->getProduct () ? $ rowRequest ->getProduct () : null ;
634
634
}
635
635
$ serviceDescription = $ serviceCode ? $ this ->getShipmentByCode ($ serviceCode ) : '' ;
636
636
@@ -664,8 +664,8 @@ protected function _getXmlQuotes()
664
664
<Shipper>
665
665
XMLRequest ;
666
666
667
- if ($ this ->getConfigFlag ('negotiated_active ' ) && ($ shipper = $ this ->getConfigData ('shipper_number ' ))) {
668
- $ xmlParams .= "<ShipperNumber> {$ shipper }</ShipperNumber> " ;
667
+ if ($ this ->getConfigFlag ('negotiated_active ' ) && ($ shipperNumber = $ this ->getConfigData ('shipper_number ' ))) {
668
+ $ xmlParams .= "<ShipperNumber> {$ shipperNumber }</ShipperNumber> " ;
669
669
}
670
670
671
671
if ($ rowRequest ->getIsReturn ()) {
@@ -688,6 +688,7 @@ protected function _getXmlQuotes()
688
688
<StateProvinceCode> {$ shipperStateProvince }</StateProvinceCode>
689
689
</Address>
690
690
</Shipper>
691
+
691
692
<ShipTo>
692
693
<Address>
693
694
<PostalCode> {$ params ['19_destPostal ' ]}</PostalCode>
@@ -703,8 +704,7 @@ protected function _getXmlQuotes()
703
704
$ xmlParams .= <<<XMLRequest
704
705
</Address>
705
706
</ShipTo>
706
-
707
-
707
+
708
708
<ShipFrom>
709
709
<Address>
710
710
<PostalCode> {$ params ['15_origPostal ' ]}</PostalCode>
@@ -714,9 +714,13 @@ protected function _getXmlQuotes()
714
714
</ShipFrom>
715
715
716
716
<Package>
717
- <PackagingType><Code> {$ params ['48_container ' ]}</Code></PackagingType>
717
+ <PackagingType>
718
+ <Code> {$ params ['48_container ' ]}</Code>
719
+ </PackagingType>
718
720
<PackageWeight>
719
- <UnitOfMeasurement><Code> {$ rowRequest ->getUnitMeasure ()}</Code></UnitOfMeasurement>
721
+ <UnitOfMeasurement>
722
+ <Code> {$ rowRequest ->getUnitMeasure ()}</Code>
723
+ </UnitOfMeasurement>
720
724
<Weight> {$ params ['23_weight ' ]}</Weight>
721
725
</PackageWeight>
722
726
</Package>
@@ -730,8 +734,8 @@ protected function _getXmlQuotes()
730
734
}
731
735
732
736
$ xmlParams .= <<<XMLRequest
733
- </Shipment>
734
- </RatingServiceSelectionRequest>
737
+ </Shipment>
738
+ </RatingServiceSelectionRequest>
735
739
XMLRequest ;
736
740
737
741
$ xmlRequest .= $ xmlParams ;
@@ -907,10 +911,13 @@ protected function _parseXmlResponse($xmlResponse)
907
911
$ error = $ this ->_rateErrorFactory ->create ();
908
912
$ error ->setCarrier ('ups ' );
909
913
$ error ->setCarrierTitle ($ this ->getConfigData ('title ' ));
914
+ if ($ this ->getConfigData ('specificerrmsg ' ) !== '' ) {
915
+ $ errorTitle = $ this ->getConfigData ('specificerrmsg ' );
916
+ }
910
917
if (!isset ($ errorTitle )) {
911
918
$ errorTitle = __ ('Cannot retrieve shipping rates ' );
912
919
}
913
- $ error ->setErrorMessage ($ this -> getConfigData ( ' specificerrmsg ' ) );
920
+ $ error ->setErrorMessage ($ errorTitle );
914
921
$ result ->append ($ error );
915
922
} else {
916
923
foreach ($ priceArr as $ method => $ price ) {
@@ -1014,14 +1021,14 @@ protected function _getXmlTracking($trackings)
1014
1021
1015
1022
foreach ($ trackings as $ tracking ) {
1016
1023
/**
1017
- * RequestOption==>'activity' or ' 1' to request all activities
1024
+ * RequestOption==>'1' to request all activities
1018
1025
*/
1019
1026
$ xmlRequest = <<<XMLAuth
1020
1027
<?xml version="1.0" ?>
1021
1028
<TrackRequest xml:lang="en-US">
1022
1029
<Request>
1023
1030
<RequestAction>Track</RequestAction>
1024
- <RequestOption>activity </RequestOption>
1031
+ <RequestOption>1 </RequestOption>
1025
1032
</Request>
1026
1033
<TrackingNumber> $ tracking</TrackingNumber>
1027
1034
<IncludeFreight>01</IncludeFreight>
@@ -1085,15 +1092,15 @@ protected function _parseXmlTrackingResponse($trackingValue, $xmlResponse)
1085
1092
if ($ activityTags ) {
1086
1093
$ index = 1 ;
1087
1094
foreach ($ activityTags as $ activityTag ) {
1088
- $ addArr = [];
1095
+ $ addressArr = [];
1089
1096
if (isset ($ activityTag ->ActivityLocation ->Address ->City )) {
1090
- $ addArr [] = (string )$ activityTag ->ActivityLocation ->Address ->City ;
1097
+ $ addressArr [] = (string )$ activityTag ->ActivityLocation ->Address ->City ;
1091
1098
}
1092
1099
if (isset ($ activityTag ->ActivityLocation ->Address ->StateProvinceCode )) {
1093
- $ addArr [] = (string )$ activityTag ->ActivityLocation ->Address ->StateProvinceCode ;
1100
+ $ addressArr [] = (string )$ activityTag ->ActivityLocation ->Address ->StateProvinceCode ;
1094
1101
}
1095
1102
if (isset ($ activityTag ->ActivityLocation ->Address ->CountryCode )) {
1096
- $ addArr [] = (string )$ activityTag ->ActivityLocation ->Address ->CountryCode ;
1103
+ $ addressArr [] = (string )$ activityTag ->ActivityLocation ->Address ->CountryCode ;
1097
1104
}
1098
1105
$ dateArr = [];
1099
1106
$ date = (string )$ activityTag ->Date ;
@@ -1117,8 +1124,8 @@ protected function _parseXmlTrackingResponse($trackingValue, $xmlResponse)
1117
1124
//HH:MM:SS
1118
1125
$ resultArr ['deliverylocation ' ] = (string )$ activityTag ->ActivityLocation ->Description ;
1119
1126
$ resultArr ['signedby ' ] = (string )$ activityTag ->ActivityLocation ->SignedForByName ;
1120
- if ($ addArr ) {
1121
- $ resultArr ['deliveryto ' ] = implode (', ' , $ addArr );
1127
+ if ($ addressArr ) {
1128
+ $ resultArr ['deliveryto ' ] = implode (', ' , $ addressArr );
1122
1129
}
1123
1130
} else {
1124
1131
$ tempArr = [];
@@ -1127,8 +1134,8 @@ protected function _parseXmlTrackingResponse($trackingValue, $xmlResponse)
1127
1134
//YYYY-MM-DD
1128
1135
$ tempArr ['deliverytime ' ] = implode (': ' , $ timeArr );
1129
1136
//HH:MM:SS
1130
- if ($ addArr ) {
1131
- $ tempArr ['deliverylocation ' ] = implode (', ' , $ addArr );
1137
+ if ($ addressArr ) {
1138
+ $ tempArr ['deliverylocation ' ] = implode (', ' , $ addressArr );
1132
1139
}
1133
1140
$ packageProgress [] = $ tempArr ;
1134
1141
}
0 commit comments