first commit
This commit is contained in:
31
extension/opencart/catalog/model/total/tax.php
Normal file
31
extension/opencart/catalog/model/total/tax.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user