• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/basketbase.php
  • Класс: BitrixSaleBasketBase
  • Вызов: BasketBase::verifyItemSort
protected function verifyItemSort(BasketItemBase $item)
{
	$itemSort = (int)$item->getField('SORT') ?: 100;

	if ($this->maxItemSort === null)
	{
		$this->maxItemSort = $itemSort;
	}
	else
	{
		if ($itemSort > $this->maxItemSort)
		{
			$this->maxItemSort = $itemSort;
		}
		else
		{
			$this->maxItemSort += 100 + $this->maxItemSort % 100;
		}
	}

	$item->setFieldNoDemand('SORT', $this->maxItemSort);
}