OpenCart 🇺🇦

Схема

protected mixed validateDelete ( )

Аргументы

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

Описание

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

Исходный код

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

$this->load->model('setting/store');
$this->load->model('sale/order');

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

	if ($this->config->get('config_download_status_id') == $order_status_id) {
		$this->error['warning'] = $this->language->get('error_download');
	}  

	$store_total = $this->model_setting_store->getTotalStoresByOrderStatusId($order_status_id);

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

	$order_total = $this->model_sale_order->getTotalOrderHistoriesByOrderStatusId($order_status_id);

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

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