OpenCart 🇺🇦

Схема

protected mixed validateDelete ( )

Аргументы

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

Описание

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

Исходный код

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

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

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

	$store_total = $this->model_setting_store->getTotalStoresByCustomerGroupId($customer_group_id);

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

	$customer_total = $this->model_sale_customer->getTotalCustomersByCustomerGroupId($customer_group_id);

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

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