From e5dd7e67a5bc53fb43407074e9cefb394fc6dc45 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Tue, 3 Mar 2026 10:27:45 +0530 Subject: [PATCH] Fix display service product total and unit price using quantity --- modules/blockcart/blockcart.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/blockcart/blockcart.php b/modules/blockcart/blockcart.php index eb364c6e6..2c2ea59ac 100644 --- a/modules/blockcart/blockcart.php +++ b/modules/blockcart/blockcart.php @@ -358,8 +358,11 @@ class Blockcart extends Module $addedProduct['option_name'] = $productOption->name; } } - $addedProduct['price'] = Tools::displayPrice($addedProduct['unit_price'] * $addedProduct['qty']); - $addedProduct['unit_price'] = Tools::displayPrice($addedProduct['unit_price']); + $quantity = $addedProduct['qty']; + $totalPrice = (float) $addedProduct['unit_price']; + $unitPrice = $totalPrice / $quantity; + $addedProduct['price'] = Tools::displayPrice($totalPrice); + $addedProduct['unit_price'] = Tools::displayPrice($unitPrice); } unset($this->context->cookie->currentAddedProduct); }