From 15430621f875d58e46c477e7d9e28a34ae4291a7 Mon Sep 17 00:00:00 2001 From: reindertvetter Date: Thu, 9 Mar 2017 09:53:32 +0100 Subject: [PATCH] If package type == 2 and country id == nl, use type 1 --- Model/Sales/MyParcelTrackTrace.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Model/Sales/MyParcelTrackTrace.php b/Model/Sales/MyParcelTrackTrace.php index 8d02eaa8..5d96559a 100755 --- a/Model/Sales/MyParcelTrackTrace.php +++ b/Model/Sales/MyParcelTrackTrace.php @@ -101,6 +101,11 @@ public function createTrackTraceFromShipment(Order\Shipment &$shipment) public function convertDataFromMagentoToApi($magentoTrack, $options) { $address = $magentoTrack->getShipment()->getShippingAddress(); + + if ($address->getCountryId() != 'NL' && (int)$options['package_type'] == 2) { + $options['package_type'] = 1; + } + $this ->setApiKey($this->helper->getGeneralConfig('api/key')) ->setReferenceId($magentoTrack->getEntityId())