Skip to content

Commit

Permalink
Custom item description max 50 strlen
Browse files Browse the repository at this point in the history
  • Loading branch information
reindertvetter committed Apr 6, 2017
1 parent 1f6cfff commit ada65a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/code/community/TIG/MyParcel2014/Model/Api/MyParcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,14 @@ protected function _getConsignmentData(TIG_MyParcel2014_Model_Shipment $myParcel
);
}

$itemDescription = $item->getName();

if (strlen($itemDescription) > 50) {
$itemDescription = substr($itemDescription, 0, 50);
}

$data['customs_declaration']['items'][] = array(
'description' => $item->getName(),
'description' => $itemDescription,
'amount' => $qty,
'weight' => (int)$weight * 1000,
'item_value' => array('amount' => $price * 100, 'currency' => 'EUR'),
Expand Down

0 comments on commit ada65a3

Please sign in to comment.