1
0
mirror of synced 2024-11-22 13:26:10 +03:00

orderCreate fix

This commit is contained in:
Grisha Pomadchin 2013-08-05 15:25:19 +04:00
parent 8935639265
commit 07805eb6c4

View File

@ -74,7 +74,7 @@ class ICrmOrderActions
while ($arOrder = $dbOrder->GetNext()) { //here orders by id asc; with offset while ($arOrder = $dbOrder->GetNext()) { //here orders by id asc; with offset
$order = self::orderCreate($arOrder['ID'], $api, $arParams); $order = self::orderCreate($arOrder, $api, $arParams);
if (!$order) if (!$order)
continue; continue;
@ -102,7 +102,7 @@ class ICrmOrderActions
while ($arOrder = $dbOrder->GetNext()) { // here orders by id asc while ($arOrder = $dbOrder->GetNext()) { // here orders by id asc
$order = self::orderCreate($arOrder['ID'], $api, $arParams); $order = self::orderCreate($arOrder, $api, $arParams);
if (!$order) if (!$order)
continue; continue;
@ -182,13 +182,11 @@ class ICrmOrderActions
else return; else return;
} }
public static function orderCreate($orderId, $api, $arParams, $send = false) { public static function orderCreate($arFields, $api, $arParams, $send = false) {
if(!$api || empty($arParams) || !$orderId) { // add cond to check $arParams if(!$api || empty($arParams)) { // add cond to check $arParams
return false; return false;
} }
$arFields = CSaleOrder::GetById($orderId);
if (empty($arFields)) { if (empty($arFields)) {
//handle err //handle err
self::eventLog('ICrmOrderActions::orderCreate', 'empty($arFields)', 'incorrect order'); self::eventLog('ICrmOrderActions::orderCreate', 'empty($arFields)', 'incorrect order');