Skip to content

Commit

Permalink
[DGS-349] initialize pr
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijusCoding committed Dec 4, 2024
1 parent 834d62b commit 7f2a9d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Service/ShipmentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ public function createShipmentFromOrder(Order $order)
private function createNonDistributedShipment(Order $order, $idProduct, $isTestMode)
{
$products = $order->getProducts();
$parcelPrice = $order->getTotalPaid();
$goodsPrice = $order->total_paid;
$parcelWeight = 0;

foreach ($products as $product) {
$parcelWeight += $product['weight'] * $product['product_quantity'];
}

$parcelPrice = $this->calculateParcelPriceWithOrderDiscount($order, $parcelPrice);
$shipment = $this->createShipment($order, $idProduct, $isTestMode, 1, $parcelWeight, $parcelPrice);
$goodsPrice = $this->calculateParcelPriceWithOrderDiscount($order, $goodsPrice);
$shipment = $this->createShipment($order, $idProduct, $isTestMode, 1, $parcelWeight, $goodsPrice);

if (!$shipment->id) {
return false;
Expand Down

0 comments on commit 7f2a9d0

Please sign in to comment.