Skip to content

Commit

Permalink
1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dpdplugin committed May 31, 2024
1 parent 3cc7ebc commit dc38a3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Order/Shipment/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function execute()
}

$order->setData(Constants::ORDER_EXTRA_SHIPPING_DATA, $rows);
$this->dataHelper->generateShippingLabel($order);
$this->dataHelper->generateShippingLabel($order, null, $packages);

$order->setCustomerNoteNotify(!empty($data['send_email']));

Expand Down
10 changes: 5 additions & 5 deletions Helper/Services/OrderConvertService.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ public function addParcelsFromPackages(Order $order, ?Order\Shipment $shipment =
$parcels = [];

foreach ($packages as $package) {

$weight = floatval($package['weight'] ?? $package['params']['weight'] ?? 0);
$unit = $package['weight_units'] ?? $package['params']['weight_units'] ?? \Zend_Measure_Weight::KILOGRAM;
$unit = $package['weight_units'] ?? $package['params']['weight_units'] ?? 'KILOGRAM';

if ($unit === 'POUND') {
$weight = $weight * 0.45359237;
}

$unit = new \Zend_Measure_Weight($weight, $unit);
$unit->convertTo(\Zend_Measure_Weight::KILOGRAM, 2);
$weight = round(floatval($unit->getValue(2)) * 100, 0);
$parcel = [
'customerReferences' => [
$order->getIncrementId() ?? '',
Expand Down

0 comments on commit dc38a3b

Please sign in to comment.