diff --git a/src/Service/ShipmentService.php b/src/Service/ShipmentService.php index ffe9dcc..fdcac7b 100644 --- a/src/Service/ShipmentService.php +++ b/src/Service/ShipmentService.php @@ -221,16 +221,14 @@ public function createShipmentFromOrder(Order $order) private function createNonDistributedShipment(Order $order, $idProduct, $isTestMode) { $products = $order->getProducts(); - $parcelPrice = 0; + $parcelPrice = $order->getTotalPaid(); $parcelWeight = 0; - $orderShippingCost = $order->total_shipping_tax_incl ?: 0; + foreach ($products as $product) { - $parcelPrice += $this->calculateProductsPrice($product); $parcelWeight += $product['weight'] * $product['product_quantity']; } $parcelPrice = $this->calculateParcelPriceWithOrderDiscount($order, $parcelPrice); - $parcelPrice += $orderShippingCost; $shipment = $this->createShipment($order, $idProduct, $isTestMode, 1, $parcelWeight, $parcelPrice); if (!$shipment->id) {