16 private function checkParams(array $fields):
Sale\Result
20 if (empty($fields[
'SITE_ID']))
30 if (empty($fields[
'FUSER_ID']) || (
int)$fields[
'FUSER_ID'] <= 0)
43 public function run(array $fields)
45 $checkParamsResult = $this->checkParams($fields);
46 if (!$checkParamsResult->isSuccess())
48 $this->
addErrors($checkParamsResult->getErrors());
52 $fuserId = $fields[
'FUSER_ID'];
53 $basket = $this->getBasketByFuserId($fuserId, $fields[
'SITE_ID']);
57 $orderClassName = $registry->getOrderClassName();
58 $order = $orderClassName::create($fields[
'SITE_ID']);
59 $order->setBasket($basket);
62 'BASKET_ITEMS' => Sale\Helpers\Controller\Action\Entity\Order::getOrderProductsByBasket($basket),
63 'ORDER_PRICE_TOTAL' => Sale\Helpers\Controller\Action\Entity\Order::getTotal($order),
72 $basketClassName = $registry->getBasketClassName();
73 return $basketClassName::loadItemsForFUser($fuserId, $siteId)->getOrderableItems();