@@ -437,6 +437,14 @@ public function setRequest(RateRequest $request)
437437 $ rowRequest ->setPackageWidth ($ request ->getPackageWidth ());
438438 $ rowRequest ->setPackageDepth ($ request ->getPackageDepth ());
439439
440+ if ($ rowRequest ->getUnitMeasure () == 'KGS ' ) {
441+ $ rowRequest ->setUnitDimensions ('CM ' );
442+ $ rowRequest ->setUnitDimensionsDescription ('Centimeter ' );
443+ } else {
444+ $ rowRequest ->setUnitDimensions ('IN ' );
445+ $ rowRequest ->setUnitDimensionsDescription ('Inches ' );
446+ }
447+
440448 $ rowRequest ->setIsReturn ($ request ->getIsReturn ());
441449 $ rowRequest ->setBaseSubtotalInclTax ($ request ->getBaseSubtotalInclTax ());
442450
@@ -1139,13 +1147,6 @@ protected function _getRestQuotes()
11391147 $ rateParams ['RateRequest ' ]['Shipment ' ]['Service ' ]['Description ' ] = $ serviceDescription ;
11401148 }
11411149
1142- if ($ rowRequest ->getUnitMeasure () == 'KGS ' ) {
1143- $ dimensionUnit = 'CM ' ;
1144- $ dimensionUnitDescription = 'Centimeter ' ;
1145- } else {
1146- $ dimensionUnit = 'IN ' ;
1147- $ dimensionUnitDescription = 'Inches ' ;
1148- }
11491150 $ height = $ rowRequest ->getPackageHeight () ?? 0 ;
11501151 $ width = $ rowRequest ->getPackageWidth () ?? 0 ;
11511152 $ length = $ rowRequest ->getPackageDepth () ?? 0 ;
@@ -1158,8 +1159,8 @@ protected function _getRestQuotes()
11581159 ],
11591160 "Dimensions " => [
11601161 "UnitOfMeasurement " => [
1161- "Code " => "{$ dimensionUnit }" ,
1162- "Description " => "{$ dimensionUnitDescription }"
1162+ "Code " => "{$ rowRequest -> getUnitDimensions () }" ,
1163+ "Description " => "{$ rowRequest -> getUnitDimensionsDescription () }"
11631164 ],
11641165 "Length " => "{$ length }" ,
11651166 "Width " => "{$ width }" ,
0 commit comments