Ekdant-Online-Store/extension/opencart/catalog/model/total/tax.php

31 lines
667 B
PHP
Raw Normal View History

2024-08-06 12:21:00 +00:00
<?php
namespace Opencart\Catalog\Model\Extension\Opencart\Total;
/**
* Class Tax
*
* @package
*/
class Tax extends \Opencart\System\Engine\Model {
/**
* @param array $totals
* @param array $taxes
* @param float $total
*
* @return void
*/
public function getTotal(array &$totals, array &$taxes, float &$total): void {
foreach ($taxes as $key => $value) {
if ($value > 0) {
$totals[] = [
'extension' => 'opencart',
'code' => 'tax',
'title' => $this->tax->getRateName($key),
'value' => $value,
'sort_order' => (int)$this->config->get('total_tax_sort_order')
];
$total += $value;
}
}
}
}