mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-02 19:33:14 +03:00
Fixed formatting
This commit is contained in:
parent
ce43131231
commit
14cbac39a6
@ -62,7 +62,7 @@ function upgrade_module_3_3_2($module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmTools::setShopContext(intval($shop['id_shop']));
|
RetailcrmTools::setShopContext((int) $shop['id_shop']);
|
||||||
$api = RetailcrmTools::getApiClient();
|
$api = RetailcrmTools::getApiClient();
|
||||||
|
|
||||||
if (empty($api)) {
|
if (empty($api)) {
|
||||||
@ -101,7 +101,7 @@ function upgrade_module_3_3_2($module)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = $api->credentials();
|
$response = $api->credentials();
|
||||||
} catch (\RetailCrm\Exception\CurlException $e) {
|
} catch (\RetailCrm\Exception\CurlException $e) {
|
||||||
@ -113,7 +113,7 @@ function upgrade_module_3_3_2($module)
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$response->isSuccessful()
|
if (!$response->isSuccessful()
|
||||||
|| $response['siteAccess'] !== 'access_selective'
|
|| $response['siteAccess'] !== 'access_selective'
|
||||||
|| count($response['sitesAvailable']) !== 1
|
|| count($response['sitesAvailable']) !== 1
|
||||||
@ -129,7 +129,7 @@ function upgrade_module_3_3_2($module)
|
|||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = $api->sitesList();
|
$response = $api->sitesList();
|
||||||
} catch (\RetailCrm\Exception\CurlException $e) {
|
} catch (\RetailCrm\Exception\CurlException $e) {
|
||||||
@ -141,13 +141,13 @@ function upgrade_module_3_3_2($module)
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($response->isSuccessful() && $response['sites']) {
|
if ($response->isSuccessful() && $response['sites']) {
|
||||||
$crmSite = current($response['sites']);
|
$crmSite = current($response['sites']);
|
||||||
$site = $crmSite['code'];
|
$site = $crmSite['code'];
|
||||||
$oldYmlUrl = $crmSite['ymlUrl'];
|
$oldYmlUrl = $crmSite['ymlUrl'];
|
||||||
$newYmlUrl = str_replace('/retailcrm', '/simla', $oldYmlUrl);
|
$newYmlUrl = str_replace('/retailcrm', '/simla', $oldYmlUrl);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = $api->sitesEdit([
|
$response = $api->sitesEdit([
|
||||||
'code' => $site,
|
'code' => $site,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user