Skip to content

Commit fddb1ba

Browse files
authored
Merge pull request #133 from Invertus/DGS-328/totla-paid-fix
DGS-328/ Multiple payment transaction and total price fix
2 parents 74847d5 + 9664a7d commit fddb1ba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Service/ShipmentService.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,14 @@ public function createShipmentFromOrder(Order $order)
221221
private function createNonDistributedShipment(Order $order, $idProduct, $isTestMode)
222222
{
223223
$products = $order->getProducts();
224-
$parcelPrice = 0;
224+
$parcelPrice = $order->getTotalPaid();
225225
$parcelWeight = 0;
226-
$orderShippingCost = $order->total_shipping_tax_incl ?: 0;
226+
227227
foreach ($products as $product) {
228-
$parcelPrice += $this->calculateProductsPrice($product);
229228
$parcelWeight += $product['weight'] * $product['product_quantity'];
230229
}
231230

232231
$parcelPrice = $this->calculateParcelPriceWithOrderDiscount($order, $parcelPrice);
233-
$parcelPrice += $orderShippingCost;
234232
$shipment = $this->createShipment($order, $idProduct, $isTestMode, 1, $parcelWeight, $parcelPrice);
235233

236234
if (!$shipment->id) {

0 commit comments

Comments
 (0)