OpenCart 🇺🇦

Схема

protected mixed validateDelete ( )

Аргументы

Аргумент Возможный тип Описание
У метода нет аргументов

Описание

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

Исходный код

if (!$this->user->hasPermission('modify', 'sale/voucher_theme')) {
	$this->error['warning'] = $this->language->get('error_permission');
}

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

foreach ($this->request->post['selected'] as $voucher_theme_id) {
	$voucher_total = $this->model_sale_voucher->getTotalVouchersByVoucherThemeId($voucher_theme_id);

	if ($voucher_total) {
		$this->error['warning'] = sprintf($this->language->get('error_voucher'), $voucher_total);
	}  
}

if (!$this->error) { 
	return true;
} else {
	return false;
}