From 37ff17ec5634004c744dcab6feae1aa016f7e2fa Mon Sep 17 00:00:00 2001 From: shazar rahman Date: Fri, 18 Sep 2026 13:33:26 +0530 Subject: [PATCH] Fixed: Code review changes and issues found in unit testing Co-authored-by: Name --- modules/blockcart/blockcart.php | 5 ++++ modules/blockcart/blockcart.tpl | 24 ++++++++++++++--- .../css/modules/blockcart/blockcart.css | 1 + .../js/modules/blockcart/ajax-cart.js | 9 ++++--- .../modules/blockcart/blockcart.tpl | 27 ++++++++++++++++--- 5 files changed, 55 insertions(+), 11 deletions(-) diff --git a/modules/blockcart/blockcart.php b/modules/blockcart/blockcart.php index f81a4c785..edb46552d 100644 --- a/modules/blockcart/blockcart.php +++ b/modules/blockcart/blockcart.php @@ -218,11 +218,14 @@ class Blockcart extends Module $tax_cost = 0; $tourismTaxCost = Tools::displayPrice(0, $currency); + $totalTaxesCost = Tools::displayPrice(0, $currency); if ($useTax && $useTax) { $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false); $tax_cost = Tools::displayPrice(($totalToPay - $totalToPayWithoutTaxes) - $tourismTax, $currency); $tourismTaxCost = Tools::displayPrice($tourismTax, $currency); + $totalTaxesCost = Tools::displayPrice($totalToPay - $totalToPayWithoutTaxes, $currency); } + $showTourismTaxSeparately = (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE'); // The cart content is altered for display $orderProcess = Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc' : 'order'; foreach ($cart_rules as &$cart_rule) { @@ -439,6 +442,8 @@ class Blockcart extends Module 'tax_cost' => $tax_cost, 'tourism_tax_cost' => $tourismTaxCost, 'tourism_tax' => $tourismTax, + 'total_taxes_cost' => $totalTaxesCost, + 'show_tourism_tax_separately' => $showTourismTaxSeparately, 'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency), 'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_PRODUCTS), $currency), 'room_total' => ($totalRoomsPrice + $totalAdditionalServicesWithAutoAddPrice + $totalAdditionalServicesWithoutAutoAddPrice), diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl index 80249a25a..a4227cd3e 100644 --- a/modules/blockcart/blockcart.tpl +++ b/modules/blockcart/blockcart.tpl @@ -137,7 +137,7 @@ {/if} --> {block name='blockcart_shopping_cart_total_tax'} {if $show_tax && $use_tax} -
+ @@ -145,12 +145,20 @@ {/block} {block name='blockcart_shopping_cart_total_tourism_tax'} {if $show_tax && $use_tax} -