OpenCart 🇺🇦

Схема

protected mixed validateDelete ( )

Аргументы

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

Описание

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

Исходный код

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

$this->load->model('setting/store');
$this->load->model('catalog/product');

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

	$product_total = $this->model_catalog_product->getTotalProductsByStockStatusId($stock_status_id);

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

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