OpenCart 🇺🇦

Схема

public mixed getTotal ( &$total_data, &$total, &$taxes )

Аргументы

Аргумент Возможный тип Описание
&$total_data
&$total
&$taxes

Описание

Метод пока еще не документирован.

Исходный код

if ($this->config->get('credit_status')) {
	$this->language->load('total/credit');

	$balance = $this->customer->getBalance();
	
	if ((float)$balance) {
		if ($balance > $total) {
			$credit = $total;	
		} else {
			$credit = $balance;	
		}
		
		if ($credit > 0) {
			$total_data[] = array(
				'code'       => 'credit',
				'title'      => $this->language->get('text_credit'),
				'text'       => $this->currency->format(-$credit),
				'value'      => -$credit,
				'sort_order' => $this->config->get('credit_sort_order')
			);
			
			$total -= $credit;
		}
	}
}