OpenCart 🇺🇦

Схема

protected mixed validateDelete ( )

Аргументы

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

Описание

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

Исходный код

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

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

foreach ($this->request->post['selected'] as $return_status_id) {
	if ($this->config->get('config_return_status_id') == $return_status_id) {
		$this->error['warning'] = $this->language->get('error_default');
	}  

	$return_total = $this->model_sale_return->getTotalReturnsByReturnStatusId($return_status_id);

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

	$return_total = $this->model_sale_return->getTotalReturnHistoriesByReturnStatusId($return_status_id);

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

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