1
0
Fork 0
mirror of synced 2025-04-04 14:23:33 +03:00
изменения по стилю кода
Добавлена проверка на api v5
This commit is contained in:
Ivan Chaplygin 2023-08-28 17:31:41 +03:00
parent 1355fac2f2
commit e3cf400be7
2 changed files with 17 additions and 8 deletions

View file

@ -547,13 +547,16 @@ class RCrmActions
'params' => $params
), 'uploadApiErrors');
} elseif ($methodApi == 'cartGet') {
Logger::getInstance()->write(array(
'api' => $version,
'methodApi' => $methodApi,
'errorMsg' => !empty($result['errorMsg']) ? $result['errorMsg'] : '',
'errors' => !empty($result['errors']) ? $result['errors'] : '',
'params' => $params,
), 'apiErrors');
Logger::getInstance()->write(
[
'api' => $version,
'methodApi' => $methodApi,
'errorMsg' => !empty($result['errorMsg']) ? $result['errorMsg'] : '',
'errors' => !empty($result['errors']) ? $result['errors'] : '',
'params' => $params,
],
'apiErrors'
);
} else {
self::eventLog(
__CLASS__ . '::' . $method,

View file

@ -109,8 +109,14 @@ class RetailCrmEvent
*
* @param object $event
*/
public static function onChangeBasket($event)
public static function onChangeBasket($event)
{
$apiVersion = COption::GetOptionString(self::$MODULE_ID, 'api_version', 0);
if ($apiVersion !== 'v5') {
return;
}
$id = \Bitrix\Main\Engine\CurrentUser::get()->getId();
if ($id) {