- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/helpers/order/builder/basketbuilder.php
- Класс: BitrixSaleHelpersOrderBuilderBasketBuilder
- Вызов: BasketBuilder::preliminaryDataPreparation
public function preliminaryDataPreparation()
{
foreach($this->formData["PRODUCT"] as $basketCode => $productData)
{
if(!$this->checkProductData($productData))
{
throw new BuildingException();
}
if(self::isBasketItemNew($basketCode))
{
$basketInternalId = intval(mb_substr($basketCode, 1));
if($basketInternalId > $this->maxBasketCodeIdx)
$this->maxBasketCodeIdx = $basketInternalId;
// by the way let's mark rows for update data if need
if($this->isNeedUpdateNewProductPrice()) //???is it right for edit orders
{
$this->needDataUpdate[] = $basketCode; //???is it needed by new orders
unset($this->formData["PRODUCT"][$basketCode]["PROVIDER_DATA"]);
unset($this->formData["PRODUCT"][$basketCode]["SET_ITEMS_DATA"]);
}
}
}
/*
* Because of one of discounts, require that the first product must be the most expencsve.
* If we want to save the sorting of the products we must use field "SORT" - fill it earlier
* and use it during layout.
*/
sortByColumn($this->formData["PRODUCT"], array("BASE_PRICE" => SORT_DESC, "PRICE" => SORT_DESC), '', null, true);
return $this;
}