update tax row in blockcart module

This commit is contained in:
Shreesh Arora
2023-01-16 11:51:02 +05:30
parent c8bdac6cdd
commit fd80d069ed
3 changed files with 4 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ class Blockcart extends Module
$wrappingCost = (float) ($params['cart']->getOrderTotal($useTax, Cart::ONLY_WRAPPING));
$totalToPay = $params['cart']->getOrderTotal($useTax);
$tax_cost = 0;
if ($showTax) {
if ($useTax && $showTax) {
$totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);
$tax_cost = Tools::displayPrice($totalToPay - $totalToPayWithoutTaxes, $currency);
}
@@ -206,6 +206,7 @@ class Blockcart extends Module
'shipping_cost_float' => $shipping_cost_float,
'show_wrapping' => $wrappingCost > 0 ? true : false,
'show_tax' => $showTax,
'use_tax' => $useTax,
'tax_cost' => $tax_cost,
'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_PRODUCTS), $currency),

View File

@@ -211,7 +211,7 @@
</span>
</div>
{/if} --><!-- commented by webkul unnecessary data -->
{if $show_tax && isset($tax_cost)}
{if $show_tax && $use_tax}
<div class="cart-prices-line">
<span class="price cart_block_tax_cost ajax_cart_tax_cost">{$tax_cost}</span>
<span>{l s='Tax' mod='blockcart'}</span>

View File

@@ -211,7 +211,7 @@
</span>
</div>
{/if} --><!-- commented by webkul unnecessary data -->
{if $show_tax && isset($tax_cost)}
{if $show_tax && $use_tax}
<div class="cart-prices-line">
<span class="price cart_block_tax_cost ajax_cart_tax_cost">{$tax_cost}</span>
<span>{l s='Tax' mod='blockcart'}</span>