WIP: refactoring
This commit is contained in:
parent
17071d407e
commit
b2ecf34977
6 changed files with 220 additions and 88 deletions
|
@ -75,6 +75,15 @@ class RetailcrmConfigProvider
|
|||
/** @var array $customFields */
|
||||
private static $customFields;
|
||||
|
||||
/** @var array $infoblocksInventories */
|
||||
private static $infoblocksInventories;
|
||||
|
||||
/** @var array $stores */
|
||||
private static $stores;
|
||||
|
||||
/** @var array $shops */
|
||||
private static $shops;
|
||||
|
||||
/**
|
||||
* @return bool|string|null
|
||||
*/
|
||||
|
@ -104,7 +113,7 @@ class RetailcrmConfigProvider
|
|||
*
|
||||
* @return bool|string|null
|
||||
*/
|
||||
public static function getCorporateClient()
|
||||
public static function getCorporateClientStatus()
|
||||
{
|
||||
if (empty(static::$corporateClient)) {
|
||||
static::$corporateClient = static::getOption(RetailcrmConstants::CRM_CC);
|
||||
|
@ -263,6 +272,16 @@ class RetailcrmConfigProvider
|
|||
return static::getOption(RetailcrmConstants::CRM_ORDER_LAST_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* setLastOrderId
|
||||
*
|
||||
* @param $id
|
||||
*/
|
||||
public static function setLastOrderId($id)
|
||||
{
|
||||
static::setOption(RetailcrmConstants::CRM_ORDER_LAST_ID, $id);
|
||||
}
|
||||
|
||||
/**
|
||||
* getFailedOrdersIds
|
||||
*
|
||||
|
@ -273,6 +292,16 @@ class RetailcrmConfigProvider
|
|||
return static::getUnserializedOption(RetailcrmConstants::CRM_ORDER_FAILED_IDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* setFailedOrdersIds
|
||||
*
|
||||
* @param $ids
|
||||
*/
|
||||
public static function setFailedOrdersIds($ids)
|
||||
{
|
||||
static::setOption(RetailcrmConstants::CRM_ORDER_FAILED_IDS, serialize($ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* getOrderNumbers
|
||||
*
|
||||
|
@ -335,6 +364,60 @@ class RetailcrmConfigProvider
|
|||
return static::$currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns currency from settings. If it's not set - returns Bitrix base currency.
|
||||
*
|
||||
* @return bool|string|null
|
||||
*/
|
||||
public static function getCurrencyOrDefault()
|
||||
{
|
||||
return self::getCurrency() ? self::getCurrency() : \Bitrix\Currency\CurrencyManager::getBaseCurrency();
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfoblocksInventories
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getInfoblocksInventories()
|
||||
{
|
||||
if (empty(static::$infoblocksInventories)) {
|
||||
static::$infoblocksInventories = static::getUnserializedOption(
|
||||
RetailcrmConstants::CRM_IBLOCKS_INVENTORIES
|
||||
);
|
||||
}
|
||||
|
||||
return static::$infoblocksInventories;
|
||||
}
|
||||
|
||||
/**
|
||||
* getStores
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getStores()
|
||||
{
|
||||
if (empty(static::$stores)) {
|
||||
static::$stores = static::getUnserializedOption(RetailcrmConstants::CRM_STORES);
|
||||
}
|
||||
|
||||
return static::$stores;
|
||||
}
|
||||
|
||||
/**
|
||||
* getShops
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getShops()
|
||||
{
|
||||
if (empty(static::$shops)) {
|
||||
static::$shops = static::getUnserializedOption(RetailcrmConstants::CRM_SHOPS);
|
||||
}
|
||||
|
||||
return static::$shops;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps Bitrix COption::GetOptionString(...)
|
||||
*
|
||||
|
@ -352,6 +435,25 @@ class RetailcrmConfigProvider
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* setOption
|
||||
*
|
||||
* @param $name
|
||||
* @param string $value
|
||||
* @param bool $desc
|
||||
* @param string $site
|
||||
*/
|
||||
private static function setOption($name, $value = "", $desc = false, $site = "")
|
||||
{
|
||||
COption::SetOptionString(
|
||||
RetailcrmConstants::MODULE_ID,
|
||||
$name,
|
||||
$value,
|
||||
$desc,
|
||||
$site
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps Bitrix unserialize(COption::GetOptionString(...))
|
||||
*
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 5.3
|
||||
*
|
||||
* RetailcrmDependencyLoader class
|
||||
*
|
||||
* @category RetailCrm
|
||||
* @package RetailCrm
|
||||
* @author RetailCrm <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion4
|
||||
*/
|
||||
|
||||
IncludeModuleLangFile(__FILE__);
|
||||
|
||||
/**
|
||||
* PHP version 5.3
|
||||
*
|
||||
* RetailcrmDependencyLoader class
|
||||
*
|
||||
* @category RetailCrm
|
||||
* @package RetailCrm
|
||||
* @author RetailCrm <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion4
|
||||
*/
|
||||
class RetailcrmDependencyLoader
|
||||
{
|
||||
/**
|
||||
* Loads dependencies
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function loadDependencies()
|
||||
{
|
||||
foreach (self::getDependencies() as $dependency) {
|
||||
if (!CModule::IncludeModule($dependency)) {
|
||||
RCrmActions::eventLog(
|
||||
__CLASS__ . '::' . __METHOD__,
|
||||
$dependency,
|
||||
'module not found'
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array of required modules names
|
||||
*
|
||||
* @return array<string>
|
||||
*/
|
||||
public static function getDependencies()
|
||||
{
|
||||
return array("iblock", "sale", "catalog");
|
||||
}
|
||||
}
|
|
@ -40,11 +40,8 @@ class RetailCrmEvent
|
|||
return false;
|
||||
}
|
||||
|
||||
$api_host = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_HOST_OPTION, 0);
|
||||
$api_key = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_KEY_OPTION, 0);
|
||||
$optionsSitesList = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_SITES_LIST, 0));
|
||||
|
||||
$api = new RetailCrm\ApiClient($api_host, $api_key);
|
||||
$optionsSitesList = RetailcrmConfigProvider::getSitesList();
|
||||
$api = new RetailCrm\ApiClient(RetailcrmConfigProvider::getApiUrl(), RetailcrmConfigProvider::getApiKey());
|
||||
$resultOrder = RetailCrmUser::customerEdit($arFields, $api, $optionsSitesList);
|
||||
|
||||
if (!$resultOrder) {
|
||||
|
@ -147,25 +144,22 @@ class RetailCrmEvent
|
|||
$log = new Logger();
|
||||
$arOrder = RetailCrmOrder::orderObjToArr($obOrder);
|
||||
|
||||
//api
|
||||
$api_host = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_HOST_OPTION, 0);
|
||||
$api_key = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_KEY_OPTION, 0);
|
||||
$api = new RetailCrm\ApiClient($api_host, $api_key);
|
||||
$api = new RetailCrm\ApiClient(RetailcrmConfigProvider::getApiUrl(), RetailcrmConfigProvider::getApiKey());
|
||||
|
||||
//params
|
||||
$optionsOrderTypes = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_TYPES_ARR, 0));
|
||||
$optionsDelivTypes = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_DELIVERY_TYPES_ARR, 0));
|
||||
$optionsPayTypes = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT_TYPES, 0));
|
||||
$optionsPayStatuses = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT_STATUSES, 0)); // --statuses
|
||||
$optionsPayment = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT, 0));
|
||||
$optionsSitesList = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_SITES_LIST, 0));
|
||||
$optionsOrderProps = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_PROPS, 0));
|
||||
$optionsLegalDetails = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_LEGAL_DETAILS, 0));
|
||||
$optionsContragentType = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_CONTRAGENT_TYPE, 0));
|
||||
$optionsCustomFields = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_CUSTOM_FIELDS, 0));
|
||||
$optionsOrderTypes = RetailcrmConfigProvider::getOrderTypes();
|
||||
$optionsDelivTypes = RetailcrmConfigProvider::getDeliveryTypes();
|
||||
$optionsPayTypes = RetailcrmConfigProvider::getPaymentTypes();
|
||||
$optionsPayStatuses = RetailcrmConfigProvider::getPaymentStatuses(); // --statuses
|
||||
$optionsPayment = RetailcrmConfigProvider::getPayment();
|
||||
$optionsSitesList = RetailcrmConfigProvider::getSitesList();
|
||||
$optionsOrderProps = RetailcrmConfigProvider::getOrderProps();
|
||||
$optionsLegalDetails = RetailcrmConfigProvider::getLegalDetails();
|
||||
$optionsContragentType = RetailcrmConfigProvider::getContragentTypes();
|
||||
$optionsCustomFields = RetailcrmConfigProvider::getCustomFields();
|
||||
|
||||
//corp cliente swich
|
||||
$optionCorpClient = COption::GetOptionString(self::$MODULE_ID, self::$CRM_CC, 0);
|
||||
$optionCorpClient = RetailcrmConfigProvider::getCorporateClientStatus();
|
||||
|
||||
$arParams = RCrmActions::clearArr(array(
|
||||
'optionsOrderTypes' => $optionsOrderTypes,
|
||||
|
|
|
@ -2,13 +2,6 @@
|
|||
IncludeModuleLangFile(__FILE__);
|
||||
class RetailCrmInventories
|
||||
{
|
||||
public static $MODULE_ID = 'intaro.retailcrm';
|
||||
public static $CRM_API_HOST_OPTION = 'api_host';
|
||||
public static $CRM_API_KEY_OPTION = 'api_key';
|
||||
public static $CRM_INVENTORIES_UPLOAD = 'inventories_upload';
|
||||
public static $CRM_STORES = 'stores';
|
||||
public static $CRM_SHOPS = 'shops';
|
||||
public static $CRM_IBLOCKS_INVENTORIES = 'iblocks_inventories';
|
||||
public static $pageSize = 500;
|
||||
|
||||
public static function inventoriesUpload()
|
||||
|
@ -29,13 +22,10 @@ class RetailCrmInventories
|
|||
return false;
|
||||
}
|
||||
|
||||
$api_host = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_HOST_OPTION, 0);
|
||||
$api_key = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_KEY_OPTION, 0);
|
||||
$api = new RetailCrm\ApiClient($api_host, $api_key);
|
||||
|
||||
$infoBlocks = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_IBLOCKS_INVENTORIES, 0));
|
||||
$stores = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_STORES, 0));
|
||||
$shops = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_SHOPS, 0));
|
||||
$api = new RetailCrm\ApiClient(RetailcrmConfigProvider::getApiUrl(), RetailcrmConfigProvider::getApiKey());
|
||||
$infoBlocks = RetailcrmConfigProvider::getInfoblocksInventories();
|
||||
$stores = RetailcrmConfigProvider::getStores();
|
||||
$shops = RetailcrmConfigProvider::getShops();
|
||||
|
||||
try {
|
||||
$inventoriesList = $api->storesList()->stores;
|
||||
|
|
|
@ -40,14 +40,13 @@ class RetailCrmOrder
|
|||
if (!$api || empty($arParams)) { // add cond to check $arParams
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($arFields)) {
|
||||
RCrmActions::eventLog('RetailCrmOrder::orderSend', 'empty($arFields)', 'incorrect order');
|
||||
return false;
|
||||
}
|
||||
|
||||
$optionsCurrency = COption::GetOptionString(self::$MODULE_ID, self::$CRM_CURRENCY, 0);
|
||||
$currency = $optionsCurrency ? $optionsCurrency : \Bitrix\Currency\CurrencyManager::getBaseCurrency();
|
||||
|
||||
$currency = RetailcrmConfigProvider::getCurrencyOrDefault();
|
||||
$order = array(
|
||||
'number' => $arFields['NUMBER'],
|
||||
'externalId' => $arFields['ID'],
|
||||
|
@ -67,9 +66,11 @@ class RetailCrmOrder
|
|||
'cost' => $arFields['PRICE_DELIVERY']
|
||||
),
|
||||
);
|
||||
|
||||
if ($send && isset($_COOKIE['_rc']) && $_COOKIE['_rc'] != '') {
|
||||
$order['customer']['browserId'] = $_COOKIE['_rc'];
|
||||
}
|
||||
|
||||
$order['contragent']['contragentType'] = $arParams['optionsContragentType'][$arFields['PERSON_TYPE_ID']];
|
||||
|
||||
//fields
|
||||
|
@ -189,31 +190,29 @@ class RetailCrmOrder
|
|||
|
||||
/**
|
||||
* Mass order uploading, without repeating; always returns true, but writes error log
|
||||
* @param $pSize
|
||||
* @param $failed -- flag to export failed orders
|
||||
*
|
||||
* @param int $pSize
|
||||
* @param bool $failed -- flag to export failed orders
|
||||
* @param bool $orderList
|
||||
*
|
||||
* @return boolean
|
||||
* @throws \Bitrix\Main\ArgumentNullException
|
||||
* @throws \Bitrix\Main\ObjectPropertyException
|
||||
* @throws \Bitrix\Main\SystemException
|
||||
* @throws \Bitrix\Main\ArgumentException
|
||||
*/
|
||||
public static function uploadOrders($pSize = 50, $failed = false, $orderList = false)
|
||||
{
|
||||
if (!CModule::IncludeModule("iblock")) {
|
||||
RCrmActions::eventLog('RetailCrmOrder::uploadOrders', 'iblock', 'module not found');
|
||||
return true;
|
||||
}
|
||||
if (!CModule::IncludeModule("sale")) {
|
||||
RCrmActions::eventLog('RetailCrmOrder::uploadOrders', 'sale', 'module not found');
|
||||
return true;
|
||||
}
|
||||
if (!CModule::IncludeModule("catalog")) {
|
||||
RCrmActions::eventLog('RetailCrmOrder::uploadOrders', 'catalog', 'module not found');
|
||||
return true;
|
||||
if (!RetailcrmDependencyLoader::loadDependencies()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$resOrders = array();
|
||||
$resCustomers = array();
|
||||
$orderIds = array();
|
||||
|
||||
$lastUpOrderId = COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_LAST_ID, 0);
|
||||
$failedIds = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_FAILED_IDS, 0));
|
||||
$lastUpOrderId = RetailcrmConfigProvider::getLastOrderId();
|
||||
$failedIds = RetailcrmConfigProvider::getFailedOrdersIds();
|
||||
|
||||
if ($failed == true && $failedIds !== false && count($failedIds) > 0) {
|
||||
$orderIds = $failedIds;
|
||||
|
@ -238,18 +237,18 @@ class RetailCrmOrder
|
|||
$api_host = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_HOST_OPTION, 0);
|
||||
$api_key = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_KEY_OPTION, 0);
|
||||
|
||||
$optionsSitesList = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_SITES_LIST, 0));
|
||||
$optionsOrderTypes = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_TYPES_ARR, 0));
|
||||
$optionsDelivTypes = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_DELIVERY_TYPES_ARR, 0));
|
||||
$optionsPayTypes = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT_TYPES, 0));
|
||||
$optionsPayStatuses = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT_STATUSES, 0)); // --statuses
|
||||
$optionsPayment = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT, 0));
|
||||
$optionsOrderProps = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_PROPS, 0));
|
||||
$optionsLegalDetails = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_LEGAL_DETAILS, 0));
|
||||
$optionsContragentType = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_CONTRAGENT_TYPE, 0));
|
||||
$optionsCustomFields = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_CUSTOM_FIELDS, 0));
|
||||
$optionsSitesList = RetailcrmConfigProvider::getSitesList();
|
||||
$optionsOrderTypes = RetailcrmConfigProvider::getOrderTypes();
|
||||
$optionsDelivTypes = RetailcrmConfigProvider::getDeliveryTypes();
|
||||
$optionsPayTypes = RetailcrmConfigProvider::getPaymentTypes();
|
||||
$optionsPayStatuses = RetailcrmConfigProvider::getPaymentStatuses(); // --statuses
|
||||
$optionsPayment = RetailcrmConfigProvider::getPayment();
|
||||
$optionsOrderProps = RetailcrmConfigProvider::getOrderProps();
|
||||
$optionsLegalDetails = RetailcrmConfigProvider::getLegalDetails();
|
||||
$optionsContragentType = RetailcrmConfigProvider::getContragentTypes();
|
||||
$optionsCustomFields = RetailcrmConfigProvider::getCustomFields();
|
||||
|
||||
$api = new RetailCrm\ApiClient($api_host, $api_key);
|
||||
$api = new RetailCrm\ApiClient(RetailcrmConfigProvider::getApiUrl(), RetailcrmConfigProvider::getApiKey());
|
||||
|
||||
$arParams = array(
|
||||
'optionsOrderTypes' => $optionsOrderTypes,
|
||||
|
|
|
@ -52,10 +52,9 @@ class RetailCrmOrder
|
|||
return false;
|
||||
}
|
||||
|
||||
$dimensionsSetting = COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_DIMENSIONS, 'N');
|
||||
$optionsCurrency = COption::GetOptionString(self::$MODULE_ID, self::$CRM_CURRENCY, 0);
|
||||
$currency = $optionsCurrency ? $optionsCurrency : \Bitrix\Currency\CurrencyManager::getBaseCurrency();
|
||||
$optionCorpClient = COption::GetOptionString(self::$MODULE_ID, self::$CRM_CC, 0);
|
||||
$dimensionsSetting = RetailcrmConfigProvider::getOrderDimensions();
|
||||
$currency = RetailcrmConfigProvider::getCurrencyOrDefault();
|
||||
$optionCorpClient = RetailcrmConfigProvider::getCorporateClientStatus();
|
||||
|
||||
$order = array(
|
||||
'number' => $arFields['NUMBER'],
|
||||
|
@ -324,16 +323,7 @@ class RetailCrmOrder
|
|||
*/
|
||||
public static function uploadOrders($pSize = 50, $failed = false, $orderList = false)
|
||||
{
|
||||
if (!CModule::IncludeModule("iblock")) {
|
||||
RCrmActions::eventLog(__CLASS__ . '::' . __METHOD__, 'iblock', 'module not found');
|
||||
return true;
|
||||
}
|
||||
if (!CModule::IncludeModule("sale")) {
|
||||
RCrmActions::eventLog(__CLASS__ . '::' . __METHOD__, 'sale', 'module not found');
|
||||
return true;
|
||||
}
|
||||
if (!CModule::IncludeModule("catalog")) {
|
||||
RCrmActions::eventLog(__CLASS__ . '::' . __METHOD__, 'catalog', 'module not found');
|
||||
if (!RetailcrmDependencyLoader::loadDependencies()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -342,8 +332,8 @@ class RetailCrmOrder
|
|||
$resCustomersCorporate = array();
|
||||
$orderIds = array();
|
||||
|
||||
$lastUpOrderId = COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_LAST_ID, 0);
|
||||
$failedIds = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_FAILED_IDS, 0));
|
||||
$lastUpOrderId = RetailcrmConfigProvider::getLastOrderId();
|
||||
$failedIds = RetailcrmConfigProvider::getFailedOrdersIds();
|
||||
|
||||
if ($failed == true && $failedIds !== false && count($failedIds) > 0) {
|
||||
$orderIds = $failedIds;
|
||||
|
@ -424,7 +414,7 @@ class RetailCrmOrder
|
|||
continue;
|
||||
}
|
||||
|
||||
if ("Y" == RetailcrmConfigProvider::getCorporateClient()
|
||||
if ("Y" == RetailcrmConfigProvider::getCorporateClientStatus()
|
||||
&& $optionsContragentType[$order['PERSON_TYPE_ID']] == 'legal-entity'
|
||||
) {
|
||||
// TODO check if order is corporate, and if it IS - make corporate order
|
||||
|
@ -522,7 +512,7 @@ class RetailCrmOrder
|
|||
return false;
|
||||
}
|
||||
|
||||
if ("Y" == RetailcrmConfigProvider::getCorporateClient()) {
|
||||
if ("Y" == RetailcrmConfigProvider::getCorporateClientStatus()) {
|
||||
foreach ($resOrders as $packKey => $pack) {
|
||||
foreach ($pack as $key => $orderData) {
|
||||
if (isset($orderData['contragent']['contragentType'])
|
||||
|
@ -565,13 +555,9 @@ class RetailCrmOrder
|
|||
}
|
||||
|
||||
if ($failed == true && $failedIds !== false && count($failedIds) > 0) {
|
||||
COption::SetOptionString(
|
||||
self::$MODULE_ID,
|
||||
self::$CRM_ORDER_FAILED_IDS,
|
||||
serialize(array_diff($failedIds, $recOrders))
|
||||
);
|
||||
RetailcrmConfigProvider::setFailedOrdersIds(array_diff($failedIds, $recOrders));
|
||||
} elseif ($lastUpOrderId < max($recOrders) && $orderList === false) {
|
||||
COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_LAST_ID, max($recOrders));
|
||||
RetailcrmConfigProvider::setLastOrderId(max($recOrders));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue