• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/preset/basepreset.php
  • Класс: BitrixSaleDiscountPresetBasePreset
  • Вызов: BasePreset::processSaveCommonSettingsInternal
protected function processSaveCommonSettingsInternal(State $state, $nextStep = self::FINAL_STEP)
{
	if(!$state->get('discount_groups'))
	{
		$this->errorCollection[] = new Error(Loc::getMessage('SALE_BASE_PRESET_ERROR_EMPTY_USER_GROUPS'));
	}

	$priority = (int)$state->get('discount_priority');
	if($priority <= 0)
	{
		$this->errorCollection[] = new Error(Loc::getMessage('SALE_BASE_PRESET_ERROR_EMPTY_PRIORITY'));
	}
	else
	{
		$state['discount_priority'] = $priority;
	}

	if($state['discount_last_discount'] !== 'Y' || !$this->request->getPost('discount_last_discount'))
	{
		$state['discount_last_discount'] = 'N';
	}

	if($state['discount_last_level_discount'] !== 'Y' || !$this->request->getPost('discount_last_level_discount'))
	{
		$state['discount_last_level_discount'] = 'N';
	}

	if(!$this->errorCollection->isEmpty())
	{
		return array($state, 'CommonSettings');
	}

	return array($state, $nextStep);
}