165 if (!$result->isSuccess())
170 $data = $result->getData();
171 if (empty($data) || empty($data[self::FLAT_AVAILABLE_QUANTITY_LIST]))
175 if (!is_array($data[self::FLAT_AVAILABLE_QUANTITY_LIST]))
177 $result->setData([]);
182 $quantityByStore = [];
184 foreach ($products as $productId => $item)
186 $quantityByStore[$productId] = $this->distributeQuantityByStore($item[
'QUANTITY_LIST_BY_STORE'], $data[self::FLAT_AVAILABLE_QUANTITY_LIST][$productId]);
190 self::STORE_AVAILABLE_QUANTITY_LIST => $quantityByStore
224 if (!$result->isSuccess())
229 $data = $result->getData();
230 if (empty($data) || empty($data[self::SUMMMARY_PRODUCT_LIST]))
234 if (!is_array($data[self::SUMMMARY_PRODUCT_LIST]))
236 $result->setData([]);
244 !empty($summary[self::FLAT_PRICE_LIST])
245 && is_array($summary[self::FLAT_PRICE_LIST])
247 ? $summary[self::FLAT_PRICE_LIST]
251 !empty($summary[self::FLAT_AVAILABLE_QUANTITY_LIST])
252 && is_array($summary[self::FLAT_AVAILABLE_QUANTITY_LIST])
259 self::SUMMMARY_PRODUCT_LIST => [
260 self::FLAT_PRICE_LIST => $priceList,
261 self::STORE_AVAILABLE_QUANTITY_LIST => $quantityList,
264 unset($quantityList, $priceList, $summary, $data);