Skip to content

Commit

Permalink
If package type == 2 and country id == nl, use type 1
Browse files Browse the repository at this point in the history
  • Loading branch information
reindertvetter committed Mar 9, 2017
1 parent 54991ad commit 1543062
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Model/Sales/MyParcelTrackTrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 1543062

Please sign in to comment.