OpenCart 🇺🇦

Схема

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

Аргументы

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

Описание

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

Исходный код

if (isset($this->session->data['voucher'])) {
	$this->language->load('total/voucher');

	$this->load->model('checkout/voucher');

	$voucher_info = $this->model_checkout_voucher->getVoucher($this->session->data['voucher']);

	if ($voucher_info) {
		if ($voucher_info['amount'] > $total) {
			$amount = $total;	
		} else {
			$amount = $voucher_info['amount'];	
		}				

		$total_data[] = array(
			'code'       => 'voucher',
			'title'      => sprintf($this->language->get('text_voucher'), $this->session->data['voucher']),
			'text'       => $this->currency->format(-$amount),
			'value'      => -$amount,
			'sort_order' => $this->config->get('voucher_sort_order')
		);

		$total -= $amount;
	} 
}